#ifndef PLS_LIBRARY_H
#define PLS_LIBRARY_H

#include <utility>

#include "pls/algorithms/invoke.h"
#include "pls/algorithms/for_each.h"
#include "pls/algorithms/reduce.h"

#include "pls/internal/scheduling/scheduler.h"

#include "pls/internal/helpers/range.h"
#include "pls/internal/helpers/member_function.h"

namespace pls {

// 'basic' for-join APIs
using internal::scheduling::scheduler;
template<typename Function>
static void spawn(Function &&function) {
  scheduler::spawn(std::forward<Function>(function));
}
static void sync() {
  scheduler::sync();
}

// general helpers that can be handy when using PLS
template<class C, typename R, typename ...ARGS>
using member_function = internal::helpers::member_function<C, R, ARGS...>;
using internal::helpers::range;

// parallel patterns API
using algorithm::invoke;
using algorithm::for_each;
using algorithm::for_each_range;
using algorithm::reduce;
}

#endif
