X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=examples%2FDemo.hs;h=849693f5b338f877afdacfe0aca5159ba65db277;hp=74bbef0ef54ecdd731b6f8e0e1384ebeaae86e33;hb=013a93a8fbae4b8c8df290e9eff226f786770762;hpb=15df3430938d7175361b848de6578aea195e612f diff --git a/examples/Demo.hs b/examples/Demo.hs index 74bbef0..849693f 100644 --- a/examples/Demo.hs +++ b/examples/Demo.hs @@ -1,10 +1,18 @@ {-# OPTIONS_GHC -XRankNTypes -XScopedTypeVariables -XFlexibleContexts -XModalTypes -XKindSignatures -fcoqpass -XMultiParamTypeClasses -dcore-lint #-} +module Demo (foo) where import GHC.HetMet.GArrow import GHC.HetMet.CodeTypes import GHC.HetMet.Private -import GArrowTikZ +--import GArrowTikZ -foo x = <[ ~~x ]> -foo' = unG . pga_flatten . foo . pga_unflatten ---foo x z = <[ let y = ~~x in ~~z y y ]> -main = tikz (foo' (PGArrowD { unG = TikZ_const 12 })) +{- +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 const merge = <[ ~~merge ~~const (~~merge ~~const ~~const) ]> + +--tester2 f = <[ \x -> ~~f x x ]> + +--main = tikz' $ \a b -> pga_flatten (foo (pga_unflatten a))