├── .dockerignore ├── tests ├── main.cpp ├── utils.h ├── CMakeLists.txt ├── function_test.cpp ├── variant_test.cpp ├── optional_test.cpp └── sequence_container_test.cpp ├── .travis.yml ├── profiles └── common ├── Dockerfile ├── conanfile.py ├── include └── kitten │ ├── kitten.h │ ├── detail │ ├── deriving │ │ └── from_monad │ │ │ ├── derive_functor.h │ │ │ └── derive_applicative.h │ └── ranges │ │ └── algorithm.h │ ├── instances │ ├── variant.h │ ├── function.h │ ├── optional.h │ └── sequence_container.h │ ├── multifunctor.h │ ├── functor.h │ ├── monad.h │ └── applicative.h ├── .clang-format ├── .gitignore ├── LICENSE ├── CMakeLists.txt ├── Makefile └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /tests/main.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | services: 4 | - docker 5 | 6 | script: 7 | - make env-format-check 8 | - make env-test 9 | -------------------------------------------------------------------------------- /profiles/common: -------------------------------------------------------------------------------- 1 | [settings] 2 | compiler=gcc 3 | compiler.version=8 4 | compiler.libcxx=libstdc++11 5 | os=Linux 6 | os_build=Linux 7 | arch=x86_64 8 | arch_build=x86_64 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM conanio/gcc9:1.22.2 2 | 3 | RUN pip install clang-format 4 | 5 | USER root 6 | 7 | WORKDIR kitten 8 | 9 | COPY . . 10 | 11 | CMD ["/bin/bash"] 12 | -------------------------------------------------------------------------------- /conanfile.py: -------------------------------------------------------------------------------- 1 | from conans import ConanFile 2 | 3 | class KittenConan(ConanFile): 4 | 5 | build_requires = "catch2/2.11.3" 6 | generators = "cmake_find_package" 7 | -------------------------------------------------------------------------------- /include/kitten/kitten.h: -------------------------------------------------------------------------------- 1 | #ifndef RVARAGO_KITTEN_KITTEN_H 2 | #define RVARAGO_KITTEN_KITTEN_H 3 | 4 | #include "kitten/applicative.h" 5 | #include "kitten/functor.h" 6 | #include "kitten/monad.h" 7 | #include "kitten/multifunctor.h" 8 | 9 | #endif -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Microsoft 3 | BreakBeforeBraces: Attach 4 | UseTab: Never 5 | --- 6 | Language: Cpp 7 | SortIncludes: true 8 | SortUsingDeclarations: true 9 | FixNamespaceComments: false 10 | AlwaysBreakTemplateDeclarations: Yes -------------------------------------------------------------------------------- /tests/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RVARAGO_KITTEN_TEST_UTILS_H 2 | #define RVARAGO_KITTEN_TEST_UTILS_H 3 | 4 | namespace rvarago::kitten::test::utils { 5 | 6 | template 7 | inline constexpr bool is_same_after_decaying = std::is_same, std::decay_t>::value; 8 | } 9 | 10 | #endif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | .idea/ 35 | build/ 36 | -------------------------------------------------------------------------------- /include/kitten/detail/deriving/from_monad/derive_functor.h: -------------------------------------------------------------------------------- 1 | #ifndef RVARAGO_KITTEN_DERIVE_FUNCTOR_H 2 | #define RVARAGO_KITTEN_DERIVE_FUNCTOR_H 3 | 4 | #include "kitten/functor.h" 5 | #include "kitten/monad.h" 6 | 7 | namespace rvarago::kitten::detail::deriving { 8 | 9 | template