]> Git — Sourcephile - tmp/julm/symantic-reify.git/blob - Examples.hs
776de876a4ede5f9b220a704f76b3921a0f67f72
[tmp/julm/symantic-reify.git] / Examples.hs
1 {-# LANGUAGE NoMonomorphismRestriction #-} -- To get polymorphic types without type annotations
2 module Examples where
3
4 -- * Haskell terms to represent as a custom (G)ADT, String,
5 -- Identity, TH.CodeQ, or whatever...
6 -- They could perfectly well be "black boxes" in another Haskell module.
7 -- Their only constraint is to have only arguments whose type is *polymorphic*
8 -- (possibly with contraints or type parameters though).
9
10 -- Note the beta-reductible 'w', it will be normalized-out.
11 e0 = \x y z -> x / y + y + 2 * z + (\w -> y) z
12
13 -- Note that 'f' is a function: arguments can be functions.
14 e1 = \f x -> f x