Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/francomelandri/lib-tiny-fp
Tiny Functional Programming library for C++
https://github.com/francomelandri/lib-tiny-fp
functional-programming noif tdd
Last synced: 16 days ago
JSON representation
Tiny Functional Programming library for C++
- Host: GitHub
- URL: https://github.com/francomelandri/lib-tiny-fp
- Owner: FrancoMelandri
- License: gpl-3.0
- Created: 2024-10-01T08:08:12.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-17T10:46:29.000Z (2 months ago)
- Last Synced: 2024-10-20T04:46:11.051Z (2 months ago)
- Topics: functional-programming, noif, tdd
- Language: C++
- Homepage:
- Size: 157 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CI](https://github.com/FrancoMelandri/lib-tiny-fp/actions/workflows/ci.yaml/badge.svg)](https://github.com/FrancoMelandri/lib-tiny-fp/actions/workflows/ci.yaml/badge.svg)
# lib-tiny-fp
C++ Functional programming library.
## abstract
The aim of `lib-tiny-fp` library is to implement the basic functional data types allows you to use **Railway Oriented Programming** in native way.
Example:
```c++
auto sut = makeOption(
TinyFp::Try::handle(onHandle)
.match(trySuccees),
whenNonde)
.toEither(LeftValue)
.map(mapEither)
.match(onRight,
onLeft);```
## types
- [Types](./docs/types.md)
- [Option](./docs/option.md)
- [Either](./docs/either.md)
- [Try](./docs/try.md)
- [Sequence](./docs/sequence.md)
- [Pipeline](./docs/pipeline.md)
- [Extensions](./docs/extensions.md)## install
To install the latest versionlibrary you can use directly the source code files.
clone the repository:```bash
> git clone https://github.com/francomelandri/lib-tiny-fp> cd lib-tiny-fp
> make install```
The libray will be installed into `/usr/local/lib/libtinyfp` and `/usr/local/include/libtinyfp` folders.
To build your own code you should include these path in the Kakefile
```makefile
CFLAGS = -O1 -Wall -I/usr/local/inlcude/libtinyfp
CCX = g++LIBTINYFP = /usr/local/lib/libtinyfp/libtinyfp.a
APPNAME = testall: $(APPNAME)
DEMOFILES = test.o
$(APPNAME): $(DEMOFILES)
$(CCX) $(DEMOFILES) $(LIBTINYFP) -o $(APPNAME)%.o: %.cpp
$(CCX) $(CFLAGS) -c $<clean:
rm -f $(APPNAME) $(DEMOFILES)rebuild: clean all
```## developer
Some advices on how to build the code in windows; the day by day work.
[Developer](./docs/developer.md)