41 void ApplicativeTest::testBoostOptionalPure ()
43 const auto& pure = Pure<boost::optional> (2);
44 QCOMPARE (pure, boost::optional<int> { 2 });
47 void ApplicativeTest::testBoostOptionalGSL ()
49 const auto& pure = Pure<boost::optional> ([] (
int a) {
return ++a; });
50 const auto& app =
GSL (pure, Pure<boost::optional> (2));
51 QCOMPARE (app, boost::optional<int> { 3 });
54 void ApplicativeTest::testBoostOptionalGSLCurry ()
56 const auto& summer = Pure<boost::optional> (
Curry ([] (
int a,
int b) {
return a + b; }));
57 const auto& s1 = Pure<boost::optional> (1);
58 const auto& s2 = Pure<boost::optional> (2);
59 const auto& app =
GSL (
GSL (summer, s1), s2);
60 QCOMPARE (app, boost::optional<int> { 3 });
63 void ApplicativeTest::testBoostOptionalGSLOperatorCurry ()
65 const auto& summer = Pure<boost::optional> (
Curry ([] (
int a,
int b) {
return a + b; }));
66 const auto& app = summer * Pure<boost::optional> (1) * Pure<boost::optional> (2);
67 QCOMPARE (app, boost::optional<int> { 3 });
GSLResult_t< AF, AV > GSL(const AF &af, const AV &av)
CurryImpl< F > Curry(F f)