Partial evaluation reflection a la simple-reflect.
The library provides a simple reflection technique, substituting functions like fmap
and <*>
with reflection-aware analogues. This library can be used with simple-reflect package.
ap-reflect
Partial evaluation reflection a la simple-reflect.
Installation
You can install the ap-reflect
from Hackage:
$ cabal install ap-reflect
or directly from the repository:
$ git clone https://github.com/cmc-msu-ai/ap-reflect
$ cd ap-reflect
$ cabal install
For some possibilities of using this library you may need to install simple-reflect
. It is available from Hackage. Install it, by typing:
cabal install simple-reflect
Documentation
Haddock documentation is available at http://cmc-msu-ai.github.io/ap-reflect/doc/html/ap-reflect/
Usage
For example:
let (.+) = makeBinOp "+" (+)
mapM_ print . reductions $ (.+) -$- Just a -*- Just b
Result:
(+) <$> Just a <*> Just b
Just (a +) <*> Just b
Just (a + b)
You can find another examples of using this library at https://github.com/cmc-msu-ai/ap-reflect/tree/master/examples
Contributors
- Oleg Baev
- Nickolay Kudasov
Contribution
Contact me (Oleg Baev): [email protected].