C++ Functional programming library.
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:
auto sut = makeOption<FakeClass>(
TinyFp::Try<FakeClass>::handle(onHandle)
.match(trySuccees),
whenNonde)
.toEither<Error>(LeftValue)
.map<FakeClassMapped>(mapEither)
.match<int>(onRight,
onLeft);
To install the latest versionlibrary you can use directly the source code files. clone the repository:
> 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
CFLAGS = -O1 -Wall -I/usr/local/inlcude/libtinyfp
CCX = g++
LIBTINYFP = /usr/local/lib/libtinyfp/libtinyfp.a
APPNAME = test
all: $(APPNAME)
DEMOFILES = test.o
$(APPNAME): $(DEMOFILES)
$(CCX) $(DEMOFILES) $(LIBTINYFP) -o $(APPNAME)
%.o: %.cpp
$(CCX) $(CFLAGS) -c $<
clean:
rm -f $(APPNAME) $(DEMOFILES)
rebuild: clean allSome advices on how to build the code in windows; the day by day work.