clean up demo code
authorAdam Megacz <megacz@cs.berkeley.edu>
Wed, 15 Jun 2011 00:14:06 +0000 (17:14 -0700)
committerAdam Megacz <megacz@cs.berkeley.edu>
Wed, 15 Jun 2011 00:14:06 +0000 (17:14 -0700)
examples/Demo.hs
examples/DemoMain.hs
examples/GArrowTikZ.hs

index 74fe4de..3f63168 100644 (file)
@@ -1,11 +1,12 @@
-{-# OPTIONS_GHC -XModalTypes -fflatten -funsafe-skolemize -dcore-lint #-}
+{-# OPTIONS_GHC -XModalTypes -fflatten -funsafe-skolemize -dcore-lint -XScopedTypeVariables #-}
 module Demo (demo) where
 
 
 --demo con mer = <[ ~~mer ~~(con (2::Int)) ~~(con (12::Int)) ]>
 
 demo const mult =
-   <[ let four   = ~~mult four ~~(const  4)
+   <[ \(y::Int) ->
+      let four   = ~~mult four ~~(const  4)
 --          twelve = {- {- ~~mult four -}  ~~(const 12) -} four
       in  four
     ]>
@@ -14,7 +15,7 @@ demo ::
     forall a c . 
          (Int -> <[a]>@c) -> 
         <[a -> a -> a]>@c ->
-        <[a]>@c
+        <[Int -> a]>@c
 
 {-
 demo const mult =
index e3e56b7..08fab3e 100644 (file)
@@ -4,12 +4,4 @@ import GHC.HetMet.Private
 import GHC.HetMet.GArrow
 import Demo
 
-{-
-demo' ::
-         (Int -> PGArrow g (GArrowUnit g) (GArrowTensor g (GArrowUnit g) Int) ) -> 
-         (       PGArrow g (GArrowTensor g (GArrowTensor g Int Int) (GArrowUnit g)) Int) ->
-         (PGArrow g (GArrowUnit g) (GArrowTensor g (GArrowUnit g) Int) )
-demo' = demo
--}
-
-main = tikz $ \const merge -> demo const merge
+main = tikz demo
index c094892..819ca1d 100644 (file)
@@ -485,11 +485,11 @@ toTikZ g =
            }
      
 
-tikz ::
+tikz :: forall c .
     (forall g .
              (Int -> PGArrow g (GArrowUnit g) Int) ->
-             (forall b . PGArrow g (GArrowTensor g b b) b) ->
-             PGArrow g b c)
+             (PGArrow g (GArrowTensor g c c) c) ->
+             PGArrow g c c)
      -> IO ()
 tikz x = tikz' $ optimize $ unG (x (\c -> PGArrowD { unG = GAS_const c }) (PGArrowD { unG = GAS_merge }))