viboes / Pure

An almost-pure C++ library for writing functional code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

INTODUCTION 

Pure is an experimental library to reimplement Haskell in C++. There are many
reasons for wanting to do so but the main one is that it makes code easier to
write in many ways. Explaining what the library does would be equivalent to
explaining Haskell, so use and development of it requires a working knowledge
of Haskell.

See the wiki for documentation.

Some of the techniques used to do this, however, are generally useful and I
have been maintaining a blog about it:

http://yapb-soc.blogspot.com/

The basic functionality of the library comes from Functional.h and List.h. The
first defines types and functions from which to build new functions. The most
commonly used functions are closure, closet, compose, and ncompose. List.h
defines almost all the functions from Haskell's Data.List. Monad.h defines
Functors and Monads. Most of the other files define their Haskell counterparts
with the same names.

./examples.cpp is a demonstration of each part of the library. When a new
feature is added, an example is often added here to test it.

./euler contains solutions to problems 1-30, with a few missing, from the Euler
Project. It uses mostly List.h functions.

./game contains a generic implementation of the AStar algorithm.

About

An almost-pure C++ library for writing functional code.