From: Mart Lubbers Date: Thu, 23 Aug 2018 16:48:06 +0000 (+0200) Subject: Merge branch 'master' of git.martlubbers.net:clean-tests X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=afe5bb5845b9b12c02834f0eb5745da84a92eab8;hp=9f05ee89761c00fe033bddc6a4a3c25c21c77a68;p=clean-tests.git Merge branch 'master' of git.martlubbers.net:clean-tests --- diff --git a/abstract-newtypes/nt.dcl b/abstract-newtypes/nt.dcl new file mode 100644 index 0000000..956b15b --- /dev/null +++ b/abstract-newtypes/nt.dcl @@ -0,0 +1,4 @@ +definition module nt + +:: NT a +:: RT a diff --git a/abstract-newtypes/nt.icl b/abstract-newtypes/nt.icl new file mode 100644 index 0000000..627578f --- /dev/null +++ b/abstract-newtypes/nt.icl @@ -0,0 +1,4 @@ +implementation module nt + +:: NT a =: NT a +:: RT a = RT a diff --git a/cli/test.icl b/cli/test.icl new file mode 100644 index 0000000..1f2059f --- /dev/null +++ b/cli/test.icl @@ -0,0 +1,4 @@ +module test + +Start :: [Char] -> [Char] +Start cs = cs diff --git a/deep-var/eval.dcl b/deep-var/eval.dcl new file mode 100644 index 0000000..d3397a5 --- /dev/null +++ b/deep-var/eval.dcl @@ -0,0 +1,5 @@ +definition module eval + +from test import :: DSL + +eval :: DSL -> Int diff --git a/deep-var/eval.icl b/deep-var/eval.icl new file mode 100644 index 0000000..359bead --- /dev/null +++ b/deep-var/eval.icl @@ -0,0 +1,9 @@ +implementation module eval + +import StdEnv +import test + +eval :: DSL -> Int +eval (Lit i) = i +eval (Var def) = let (i In d) = def (Lit i) in eval d +eval (a +. b) = eval a + eval b diff --git a/deep-var/pprint b/deep-var/pprint new file mode 100755 index 0000000..9efca5e Binary files /dev/null and b/deep-var/pprint differ diff --git a/deep-var/pprint.dcl b/deep-var/pprint.dcl new file mode 100644 index 0000000..b3da9ff --- /dev/null +++ b/deep-var/pprint.dcl @@ -0,0 +1,5 @@ +definition module pprint + +from test import :: DSL + +pprint :: DSL -> String diff --git a/deep-var/pprint.icl b/deep-var/pprint.icl new file mode 100644 index 0000000..33feaff --- /dev/null +++ b/deep-var/pprint.icl @@ -0,0 +1,26 @@ +implementation module pprint + +import Control.Applicative +import Control.Monad => qualified join +import Control.Monad.Reader +import Control.Monad.Identity +import Data.Func +import Data.Functor +import Data.List +import Text +import StdEnv + +import test + +:: DSL | PPrintVar String + +pprint :: DSL -> String +pprint d = concat $ runReader (print d) ["x" +++ toString i\\i<-[0..]] + +print :: DSL -> Reader [String] [String] +print (Lit i) = pure $ pure $ toString i +print (PPrintVar s) = pure $ pure s +print (Var def) = asks hd >>= \v-> + let (i In d) = def (PPrintVar v) + in local tl $ ((++) ["var ",v,"=",toString i," in\n"]) <$> print d +print (a +. b) = liftA2 (\as bs->as++["+":bs]) (print a) (print b) diff --git a/deep-var/test.dcl b/deep-var/test.dcl new file mode 100644 index 0000000..69caac4 --- /dev/null +++ b/deep-var/test.dcl @@ -0,0 +1,8 @@ +definition module test + +:: In a b = In infix 0 a b +:: DSL + = Lit Int + | Var (DSL -> In Int DSL) + | (+.) infixl 6 DSL DSL + | .. diff --git a/deep-var/test.icl b/deep-var/test.icl new file mode 100644 index 0000000..8763ffa --- /dev/null +++ b/deep-var/test.icl @@ -0,0 +1,7 @@ +implementation module test + +import pprint, eval + +Start = (pprint expr, eval expr) +where + expr = Var \x=4 In Lit 38 +. x diff --git a/lat/test.icl b/lat/test.icl new file mode 100644 index 0000000..1db4bdf --- /dev/null +++ b/lat/test.icl @@ -0,0 +1,7 @@ +module test + +import StdEnv + +f = (+) 4 + +Start = f 6 diff --git a/overloading_tc/test.icl b/overloading_tc/test.icl new file mode 100644 index 0000000..cf14d22 --- /dev/null +++ b/overloading_tc/test.icl @@ -0,0 +1,20 @@ +module test + +import StdEnv + +class type a | c1 a & TC a + +class c1 a :: a -> Int +class rtrn v :: v () +class arith v +where + (+.) :: (v a) (v a) -> (v a) | type, + a + +//:: WMT = E.e v: WMT (v e) & type e & iTask e & rtrn v & arith v +:: WMT = E.e v: WMT (v e) & type e & rtrn v & arith v + +Start :: [WMT] +Start = + [undef + ,undef + ] diff --git a/runtime-generic/test.icl b/runtime-generic/test.icl new file mode 100644 index 0000000..248ef5d --- /dev/null +++ b/runtime-generic/test.icl @@ -0,0 +1,13 @@ +module test + +import StdEnv => qualified return +import iTasks + +derive class iTask UInt8 + +Start w = startEngine t w + +:: UInt8 =: UInt8 Int + +t :: Task UInt8 +t = enterInformation () [] diff --git a/strictlet/test.icl b/strictlet/test.icl new file mode 100644 index 0000000..524e34e --- /dev/null +++ b/strictlet/test.icl @@ -0,0 +1,6 @@ +module test + +//Start = let! a = 4 in a +Start +#! a = 4 += a