From 423b0bd3972c5bcbbd757cb715e13b5b9104a9a6 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Tue, 14 Jun 2011 17:14:06 -0700 Subject: [PATCH] clean up demo code --- examples/Demo.hs | 7 ++++--- examples/DemoMain.hs | 10 +--------- examples/GArrowTikZ.hs | 6 +++--- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/examples/Demo.hs b/examples/Demo.hs index 74fe4de..3f63168 100644 --- a/examples/Demo.hs +++ b/examples/Demo.hs @@ -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 = diff --git a/examples/DemoMain.hs b/examples/DemoMain.hs index e3e56b7..08fab3e 100644 --- a/examples/DemoMain.hs +++ b/examples/DemoMain.hs @@ -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 diff --git a/examples/GArrowTikZ.hs b/examples/GArrowTikZ.hs index c094892..819ca1d 100644 --- a/examples/GArrowTikZ.hs +++ b/examples/GArrowTikZ.hs @@ -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 })) -- 1.7.10.4