@hackage DrHylo0.0.2
A tool for deriving hylomorphisms
Categories
License
BSD-3-Clause
Maintainer
Hugo Pacheco <hpacheco@di.uminho.pt>
Links
- Homepage
- Documentation
- No source repository
- Security
Versions
Installation
Dependencies (5)
- base >=4
- haskell-src-exts ==0.4.4.1
- mtl
- pointless-haskell
- syb Show all…
Dependents (1)
@hackage/acme-everything
Package Flags
splitbase
(on by default)
Choose the new smaller, split-up base package.
DrHylo
This cabal package can be installed with:
$ cabal install DrHylo
For a manual install, execute:
$ runhaskell Setup.lhs configure $ runhaskell Setup.lhs build $ runhaskell Setup.lhs install
DrHylo derives point-free hylomorphisms from restricted Haskell syntax.
Usage: DrHylo [OPTION...] -o[FILE] --output[=FILE] output FILE -i[FILE] --input[=FILE] input FILE -f --fix use fixpoints instead of hylomorphisms -w --pointwise do not convert to point-free -O --observable generate observable hylomorphisms
The module Sample.hs defines some Haskell definitions that are compliant with the DrHylo supported syntax. As an example, we can generate observable hylomorphisms for the functions frm Sample.hs into some file Out.hs:
$ DrHylo -iSample.hs -oOut.hs -O
The resulting file Out.hs can be normally interpreted with GHC as long as we have the Pointless Haskell library installed.
$ ghci Out.hs -fglasgow-exts -XUndecidableInstances
Since we asked for observable hylomorphisms, we can inspect the recursion tree for hylomorphisms via GHood. Just make sure that you have the GHood library installed (available on Hackage). A sample execution is:
let four = Succ $ Succ $ Succ $ Succ Zero runO $ print $ fact four