From bb5ad91dc2d9cf1e35895e293b4e3e1478b4af00 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Fri, 13 May 2011 20:33:10 -0700 Subject: [PATCH] update examples --- examples/Demo.hs | 12 ++++++++++-- examples/GArrowTikZ.hs | 8 ++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/Demo.hs b/examples/Demo.hs index fea2dc7..f5069fa 100644 --- a/examples/Demo.hs +++ b/examples/Demo.hs @@ -4,6 +4,14 @@ import GHC.HetMet.CodeTypes import GHC.HetMet.Private import GArrowTikZ -foo x = <[ ~~x ]> +{- +foo :: (forall g a . <[ () -> a + PGArrow g (GArrowUnit g) a -> + (forall b . PGArrow g (GArrowTensor g b b) b) -> +-} +--foo con mer = <[ ~~mer ~~con ~~con ]> +foo f = <[ ~~f ]> -main = tikz' $ pga_flatten . foo . pga_unflatten +--tester2 f = <[ \x -> ~~f x x ]> + +main = tikz' $ \a b -> pga_flatten (foo (pga_unflatten a)) diff --git a/examples/GArrowTikZ.hs b/examples/GArrowTikZ.hs index db21658..b3a468f 100644 --- a/examples/GArrowTikZ.hs +++ b/examples/GArrowTikZ.hs @@ -424,8 +424,12 @@ toTikZ' g = foldr (\x y -> x++"\\\\\n"++y) [] (map foo s) s = sortit (strip k) m = valuatit empty s -tikz' :: (forall g a . PGArrow g (GArrowUnit g) a -> PGArrow g (GArrowUnit g) a) -> IO () -tikz' x = tikz $ unG (x (PGArrowD { unG = TikZ_const 12 })) +tikz' :: (forall g a . + PGArrow g (GArrowUnit g) a -> + ( + forall b . PGArrow g (GArrowTensor g b b) b) -> + PGArrow g (GArrowUnit g) a) -> IO () +tikz' x = tikz $ unG (x (PGArrowD { unG = TikZ_const 12 }) (PGArrowD { unG = TikZ_merge }) ) main = do putStrLn "hello" tikz example = do putStrLn "\\documentclass{article}" -- 1.7.10.4