X-Git-Url: http://git.megacz.com/?p=coq-hetmet.git;a=blobdiff_plain;f=examples%2FDemo.hs;h=4e7f599682ed224e8df3251a7727cb361261a404;hp=74bbef0ef54ecdd731b6f8e0e1384ebeaae86e33;hb=68f41d71d573b422b04ed3f4a3eb3ab41de09a79;hpb=15df3430938d7175361b848de6578aea195e612f diff --git a/examples/Demo.hs b/examples/Demo.hs index 74bbef0..4e7f599 100644 --- a/examples/Demo.hs +++ b/examples/Demo.hs @@ -1,10 +1,18 @@ -{-# OPTIONS_GHC -XRankNTypes -XScopedTypeVariables -XFlexibleContexts -XModalTypes -XKindSignatures -fcoqpass -XMultiParamTypeClasses -dcore-lint #-} -import GHC.HetMet.GArrow -import GHC.HetMet.CodeTypes -import GHC.HetMet.Private -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 })) +{-# OPTIONS_GHC -XModalTypes -fcoqpass -dcore-lint #-} +module Demo (demo) where + +demo con mer = <[ ~~mer ~~(con (2::Int)) ~~(con (12::Int)) ]> + +-- demo const mult = <[ let q = ~~(const (1::Int)) in ~~mult q q ]> + +--demo const mult = +-- <[ let twelve = ~~(const (12::Int)) +-- in ~~mult (~~mult twelve twelve) (~~mult twelve twelve) ]> + +{- +demo const mult = demo' 3 + where + demo' 0 = const 12 + demo' 1 = const 12 + demo' n = <[ ~~mult ~~(demo' (n-1)) ~~(demo' (n-2)) ]> +-} \ No newline at end of file