From 69f558efb7f9224691bb93de54e5417be9f1ba65 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Sun, 14 Apr 2019 16:25:47 +0300 Subject: [PATCH] Added `Seq` --- internals/testing/functional_test.cpp | 28 ++++++++++ internals/testing/seq_test.cpp | 26 ++++++++++ internals/testing/tycon_test.cpp | 11 ++++ provides/include/lax_v1/functional.hpp | 71 ++++++++++++++++++++++++++ provides/include/lax_v1/seq.hpp | 26 ++++++++++ provides/include/lax_v1/synopsis.hpp | 39 ++++++++++++++ provides/include/lax_v1/tycon.hpp | 56 ++++++++++++++++++++ 7 files changed, 257 insertions(+) create mode 100644 internals/testing/functional_test.cpp create mode 100644 internals/testing/seq_test.cpp create mode 100644 internals/testing/tycon_test.cpp create mode 100644 provides/include/lax_v1/functional.hpp create mode 100644 provides/include/lax_v1/seq.hpp create mode 100644 provides/include/lax_v1/tycon.hpp diff --git a/internals/testing/functional_test.cpp b/internals/testing/functional_test.cpp new file mode 100644 index 0000000..6cb741e --- /dev/null +++ b/internals/testing/functional_test.cpp @@ -0,0 +1,28 @@ +#include "lax_v1/arithmetic.hpp" +#include "lax_v1/functional.hpp" + +#include "config.hpp" + +static_assert(lax::value_of_v, lax::fn_t>, + lax::value_t>> == 2); + +static_assert( + lax::value_of_v>, + lax::fn_t, + lax::fn_t>>, + lax::value_t>> == 1); + +static_assert(lax::value_of_v>, + lax::fn_t, + lax::fn_t>>, + lax::value_t>> == -3); + +static_assert( + lax::value_of_v< + lax::thru_m, + lax::fn_t>, + lax::fn_t, + lax::fn_t>>> == -3); diff --git a/internals/testing/seq_test.cpp b/internals/testing/seq_test.cpp new file mode 100644 index 0000000..404a778 --- /dev/null +++ b/internals/testing/seq_test.cpp @@ -0,0 +1,26 @@ +#include "lax_v1/arithmetic.hpp" +#include "lax_v1/functional.hpp" +#include "lax_v1/seq.hpp" +#include "lax_v1/value.hpp" + +#include "config.hpp" + +#include + +using values_t = lax::Seq::t, + lax::value_t, + lax::value_t, + lax::value_t, + lax::value_t, + lax::value_t>; + +static_assert(lax::value_of_v> == 6); + +static_assert(std::is_same_v< + lax::force_t, values_t>>, + lax::Seq::t, + lax::value_t, + lax::value_t, + lax::value_t, + lax::value_t, + lax::value_t>>); diff --git a/internals/testing/tycon_test.cpp b/internals/testing/tycon_test.cpp new file mode 100644 index 0000000..d371039 --- /dev/null +++ b/internals/testing/tycon_test.cpp @@ -0,0 +1,11 @@ +#include "lax_v1/arithmetic.hpp" +#include "lax_v1/functional.hpp" +#include "lax_v1/tycon.hpp" + +#include "config.hpp" + +struct V; + +static_assert( + lax::value_of_v>>, + lax::value_t>> == 0); diff --git a/provides/include/lax_v1/functional.hpp b/provides/include/lax_v1/functional.hpp new file mode 100644 index 0000000..14bc7b8 --- /dev/null +++ b/provides/include/lax_v1/functional.hpp @@ -0,0 +1,71 @@ +#pragma once + +#include "lax_v1/logical.hpp" +#include "lax_v1/synopsis.hpp" + +template