clean up demo code
[coq-hetmet.git] / examples / Demo.hs
1 {-# OPTIONS_GHC -XModalTypes -fflatten -funsafe-skolemize -dcore-lint -XScopedTypeVariables #-}
2 module Demo (demo) where
3
4
5 --demo con mer = <[ ~~mer ~~(con (2::Int)) ~~(con (12::Int)) ]>
6
7 demo const mult =
8    <[ \(y::Int) ->
9       let four   = ~~mult four ~~(const  4)
10 --          twelve = {- {- ~~mult four -}  ~~(const 12) -} four
11       in  four
12     ]>
13
14 demo ::
15     forall a c . 
16          (Int -> <[a]>@c) -> 
17         <[a -> a -> a]>@c ->
18         <[Int -> a]>@c
19
20 {-
21 demo const mult =
22  <[ let     twelve = ~~(const (12::Int))
23     in let  four    = ~~(const (4::Int))
24          in  ~~mult four twelve  ]>
25 -}
26 {-
27 demo const mult =
28  <[ let     twelve = ~~(const (12::Int))
29     in let  twelvea = twelve
30             four    = ~~(const (4::Int))
31             twelveb = twelve
32          in  ~~mult (~~mult twelvea four) (~~mult twelveb twelveb) ]>
33 -}
34
35 {-
36 demo const mult = demo' 3
37  where
38   demo' 0 = const 12
39   demo' 1 = const 12
40   demo' n = <[ ~~mult ~~(demo' (n-1)) ~~(demo' (n-2)) ]>
41 -}