/
/README
1 DrHylo
2
3 This cabal package can be installed with:
4
5 $ cabal install DrHylo
6
7 For a manual install, execute:
8
9 $ runhaskell Setup.lhs configure
10 $ runhaskell Setup.lhs build
11 $ runhaskell Setup.lhs install
12
13 DrHylo derives point-free hylomorphisms from restricted Haskell syntax.
14
15 Usage: DrHylo [OPTION...]
16 -o[FILE] --output[=FILE] output FILE
17 -i[FILE] --input[=FILE] input FILE
18 -f --fix use fixpoints instead of hylomorphisms
19 -w --pointwise do not convert to point-free
20 -O --observable generate observable hylomorphisms
21
22 The module Sample.hs defines some Haskell definitions that are compliant with the DrHylo supported syntax.
23 As an example, we can generate observable hylomorphisms for the functions frm Sample.hs into some file Out.hs:
24
25 $ DrHylo -iSample.hs -oOut.hs -O
26
27 The resulting file Out.hs can be normally interpreted with GHC as long as we have the Pointless Haskell library installed.
28
29 $ ghci Out.hs -fglasgow-exts -XUndecidableInstances
30
31 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:
32
33 > let four = Succ $ Succ $ Succ $ Succ Zero
34 > runO $ print $ fact four
35
36
37