From: Mart Lubbers Date: Wed, 19 Feb 2020 08:14:04 +0000 (+0100) Subject: - X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=4b62b5d397d86147e393c05b3083af74a3a0c4af;p=clean-tests.git - --- diff --git a/deep.icl b/deep.icl new file mode 100644 index 0000000..5124c43 --- /dev/null +++ b/deep.icl @@ -0,0 +1,29 @@ +module deep + +import StdEnv + +:: DSL + = Lit Int + | Plus DSL DSL + | Div DSL DSL + +eval :: DSL -> Int +eval (Lit i) = i +eval (Plus x y) = eval x + eval y +eval (Div x y) = eval x / eval y + +//Start = eval (Plus (Lit 41) (Lit 1)) + +import Control.Applicative +import Control.Monad +import Data.Functor +import Data.Maybe + +evalM :: DSL -> Maybe Int +evalM (Lit i) = pure i +evalM (Plus x y) = (+) <$> evalM x <*> evalM y +evalM (Div x y) = evalM x >>= \x->evalM y >>= \y->case y of + 0 = Nothing + x = Just (x / y) + +Start = evalM (Plus (Lit 41) (Lit 1)) diff --git a/dep/a.out b/dep/a.out deleted file mode 100755 index 4fba07f..0000000 Binary files a/dep/a.out and /dev/null differ diff --git a/eadt.icl b/eadt.icl new file mode 100644 index 0000000..30ec0e1 --- /dev/null +++ b/eadt.icl @@ -0,0 +1,73 @@ +module eadt + +import StdEnv +import Control.Monad +import Control.Applicative +import Data.Functor +import Data.Maybe + +:: BM a b = { to :: a -> b, fro :: b -> a} +bm :: BM a a +bm = {to=id, fro=id} + +class eval m where eval :: (m a) -> Maybe a +class print m where print :: (m a) [String] -> [String] +class flat m where flat :: (m a) -> DSL a +:: DSL a + = E.e: Lit (BM e a) a & toString e + | E.e: Plus (BM e a) (DSL e) (DSL e) & + e + | E.m: Ext (m a) & eval, print, flat m +lit = Lit bm +(+.) infixl 6 +(+.) = Plus bm + +instance eval DSL where + eval (Lit _ a) = Just a + eval (Plus bm x y) = bm.to <$> ((+) <$> eval x <*> eval y) + eval (Ext m) = eval m + +instance print DSL where + print (Lit bm a) c = [toString (bm.fro a):c] + print (Plus _ x y) c = print x ["+":print y c] + print (Ext m) c = print m c + +instance flat DSL where + flat (Ext m) = Ext (flat m) + flat a = a + +:: Div a = E.e: Div (BM e a) (DSL e) (DSL e) & /, zero, == e +(/.) infixl 7 +(/.) x y = Ext (Div bm x y) + +instance eval Div where + eval (Div bm x y) = bm.to <$> (eval x >>= \x->eval y >>= \y-> + if (y == zero) Nothing (Just (x/y))) + +instance print Div where + print (Div bm x y) c = print x ["/":print y c] + +instance flat Div where + flat a = Ext a + +:: In a b = In infix 0 a b +:: Var a = E.b: Var ((DSL b) -> In (DSL b) (DSL a)) +var = Ext o Var +instance eval Var where + eval (Var def) = + let (init In body) = def init + in eval body + +instance print Var where + print (Var def) c = + let (init In body) = def init + in ["let _ = ":print init [" in ":print body c]] + +instance flat Var where + flat (Var def) = + let (init In body) = def init + in body + +Start = printEval (var \x=lit 41 In x +. lit 1) + +printEval :: (DSL a) -> (Maybe a, [String]) +printEval e = (eval e, print e []) diff --git a/exeditor/test.icl b/exeditor/test.icl new file mode 100644 index 0000000..dc32b37 --- /dev/null +++ b/exeditor/test.icl @@ -0,0 +1,112 @@ +module test + +import StdEnv +import Data.Maybe +import Data.Functor +import qualified Data.Map as DM +import iTasks +import iTasks.Internal.Serialization + +:: Box = E.t: Box t & iTask t +unBox (Box b) :== b + +gEq{|Box|} (Box l) (Box r) = dynamicJSONEncode l == dynamicJSONEncode r +JSONEncode{|Box|} _ c = [dynamicJSONEncode c] +JSONDecode{|Box|} _ [c:r] = (dynamicJSONDecode c, r) +JSONDecode{|Box|} _ r = (Nothing, r) +gText{|Box|} tv ma = maybe [] (gText{|*|} tv o Just) ma +gEditor{|Box|} = bijectEditorValue fromBox toBox gEditor{|*|} + +fromBox :: Box -> Type +fromBox (Box t) = fromBoxd (dynamic t) + +fromBoxd :: Dynamic -> Type +fromBoxd (a :: ()) = Unit +fromBoxd (a :: Int) = Int a +fromBoxd (a :: Bool) = Bool a +fromBoxd (a :: Real) = Real a +fromBoxd (a :: String) = String a +fromBoxd ((a, b) :: (a, b)) = Tuple (fromBoxd (dynamic a)) (fromBoxd (dynamic b)) +fromBoxd ((a, b, c) :: (a, b, c)) = Tuple3 (fromBoxd (dynamic a)) (fromBoxd (dynamic b)) (fromBoxd (dynamic b)) +fromBoxd (a :: Person) = Person a + +toBox :: Type -> Box +toBox (Int a) = Box a +toBox (Bool a) = Box a +toBox (Real a) = Box a +toBox (String a) = Box a +toBox Unit = Box () +toBox (Tuple l r) = case (toBox l, toBox r) of + (Box l, Box r) = Box (l, r) +toBox (Tuple3 l m r) = case (toBox l, toBox m, toBox r) of + (Box l, Box m, Box r) = Box (l, m, r) +toBox (Person p) = Box p + /* +gEditor{|Box|} = + { Editor + | genUI = \uia dp em vst->case em of + Enter = (Error "enterInformation not possible for existentials (genUI)", vst) + (View b=:(Box a)) = case (castEditor a).Editor.genUI uia dp (View a) vst of + (Error e, vst) = (Error e, vst) + (Ok (ui, es), vst) = (Ok (ui, AnnotatedState (dynamicJSONEncode (View (), uia, b)) es), vst) + (Update b=:(Box a)) = case (castEditor a).Editor.genUI uia dp (Update a) vst of + (Error e, vst) = (Error e, vst) + (Ok (ui, es), vst) = (Ok (ui, AnnotatedState (dynamicJSONEncode (Update (), uia, b)) es), vst) + , onEdit = \dp dpn es vst->case es of + AnnotatedState ebox es = case dynamicJSONDecode ebox of + Just (Enter, _, Box b) = case (castEditor b).Editor.onEdit dp dpn es vst of + (Error e, vst) = (Error e, vst) + (Ok (ui, es), vst) = (Ok (ui, AnnotatedState ebox es), vst) + Just (View (), _, Box b) = case (castEditor b).Editor.onEdit dp dpn es vst of + (Error e, vst) = (Error e, vst) + (Ok (ui, es), vst) = (Ok (ui, AnnotatedState ebox es), vst) + Just (Update (), _, Box b) = case (castEditor b).Editor.onEdit dp dpn es vst of + (Error e, vst) = (Error e, vst) + (Ok (ui, es), vst) = (Ok (ui, AnnotatedState ebox es), vst) + Nothing = (Error "corrupt editor state in Box", vst) + _ = (Error "corrupt editor state in Box", vst) + , onRefresh = \dp b=:(Box nb) es vst->case es of + AnnotatedState box es = case dynamicJSONDecode box of + Just (View (), uia, Box _) = case (castEditor nb).Editor.genUI uia dp (View nb) vst of + (Ok (ui, es), vst) = (Ok (ReplaceUI ui, AnnotatedState (dynamicJSONEncode (View (), uia, b)) es), vst) + (Error e, vst) = (Error e, vst) + Just (Update (), uia, Box _) = case (castEditor nb).Editor.genUI uia dp (Update nb) vst of + (Ok (ui, es), vst) = (Ok (ReplaceUI ui, AnnotatedState (dynamicJSONEncode (Update (), uia, b)) es), vst) + (Error e, vst) = (Error e, vst) + Just (Enter, uia, Box _) = case (castEditor nb).Editor.genUI uia dp (Update nb) vst of + (Ok (ui, es), vst) = (Ok (ReplaceUI ui, AnnotatedState (dynamicJSONEncode (Update (), uia, b)) es), vst) + (Error e, vst) = (Error e, vst) + Nothing = (Error "corrupt editor state in Box", vst) + _ = (Error "corrupt editor state in Box", vst) + , valueFromState = \es->case es of + AnnotatedState box es = case dynamicJSONDecode box of + Just (_, _, Box a) = case (castEditor a).Editor.valueFromState es of + Just a = Just (Box a) + Nothing = Nothing + Nothing = Nothing + } +where + castEditor :: t -> Editor t | gEditor{|*|} t + castEditor _ = gEditor{|*|} +*/ + +Start w = doTasks t w + +//t = updateSharedInformation [] (Box 42) +t = withShared (Box 42) \bs-> + updateSharedInformation [] bs + -|| updateSharedInformation [] bs + +:: Type + = Int Int + | Bool Bool + | String String + | Real Real + | Unit + | List [Type] + | Tuple Type Type + | Tuple3 Type Type Type + | Person Person +:: Person = {firstName :: String, lastName :: String} + +derive class iTask Type, Person diff --git a/foreign/test.c b/foreign/test.c deleted file mode 100644 index 586ac74..0000000 --- a/foreign/test.c +++ /dev/null @@ -1,9 +0,0 @@ -#include - -extern int fac(int n); - -int cmain() -{ - for(int i = 0; i<10; i++) - printf("Fac %d: %d\n", i, fac(i)); -} diff --git a/gopt/gopt.icl b/gopt/gopt.icl deleted file mode 100644 index 09089ab..0000000 --- a/gopt/gopt.icl +++ /dev/null @@ -1,166 +0,0 @@ -module gopt - -import StdEnv, StdGeneric - -import Data.List -import Data.Error -import Data.Func -import Data.Functor -import Data.Tuple -import Data.Maybe -import Control.Applicative -import Control.Monad => qualified join -import System.CommandLine -import Text - -:: Opt a - = BinaryFlag (a -> a) (a -> a) - | Flags [(String, ([String] a -> (MaybeError [String] (a, [String]))))] - | Positionals [(String, String a -> (MaybeError [String] a))] - | SubParsers [(String, Opt a)] - -class bifmap m :: (a -> b) (b -> a) (m b) -> m a -instance bifmap Opt -where - bifmap fr to (BinaryFlag set unset) = BinaryFlag (to o set o fr) (to o unset o fr) - bifmap fr to (Flags fs) = Flags $ map (appSnd $ (\f s->fm (appFst to) o f s o fr)) fs - bifmap fr to (Positionals fs) = Positionals $ map (appSnd $ fmap $ \f->fm to o f o fr) fs - bifmap fr to (SubParsers sp) = SubParsers $ map (appSnd (bifmap fr to)) sp - -fm f (Ok a) = Ok (f a) -fm f (Error e) = Error e - -combine sel app p s t = p s (sel t) >>= \l->pure (app (const l) t) -combine` sel app p s t = p s (sel t) >>= \(l, as)->pure ((app (const l) t), as) - -ar0 s f as = Ok o flip tuple as o f - -generic gopt a *! :: Opt a -//generic gopt a :: Opt a -gopt{|Bool|} = BinaryFlag (const True) (const False) -gopt{|Int|} = Positionals [("INT", \s _->if (and [isDigit c\\c<-:s]) (Ok $ toInt s) (Error ["Not an integer"]))] -gopt{|Char|} = Positionals [("CHAR", \s _->if (size s == 1) (Ok s.[0]) (Error ["Not a single character"]))] -gopt{|String|} = Positionals [("STRING", \s _->Ok s)] -gopt{|RECORD|} f = bifmap (\(RECORD a)->a) (\x->RECORD x) f -gopt{|OBJECT|} f = bifmap (\(OBJECT a)->a) (\x->OBJECT x) f -gopt{|FIELD of {gfd_name}|} f = case f of - //Child is a boolean - BinaryFlag set unset = mapF $ Flags [(gfd_name, ar0 gfd_name set), ("no-" +++ gfd_name, ar0 ("no-" +++ gfd_name) unset)] - //Child is a basic value or a tuple - Positionals ps = mapF $ Flags [(gfd_name, ptoarg ps)] - //Child is another record, make the arguments ddstyle TODO - Flags x = mapF (Flags x) - //Child is a subparser - SubParsers ps = mapF (Flags [(gfd_name, pOpts (SubParsers ps))]) - x = abort "Subparsers not supported" -where - mapF :: ((m a) -> m (FIELD a)) | bifmap m - mapF = bifmap (\(FIELD a)->a) (\x->FIELD x) - - ptoarg [p] [] i = Error ["Not enough arguments for " +++ gfd_name] - ptoarg [(_, p):ps] [a:as] i = p a i >>= ptoarg ps as - ptoarg [] as i = Ok (i, as) -gopt{|PAIR|} l r = case (l, r) of - (Positionals pl, Positionals pr) - = Positionals - $ map (appSnd $ combine PFst appPFst) pl - ++ map (appSnd $ combine PSnd appPSnd) pr - (Flags fl, Flags fr) - = Flags - $ map (appSnd $ combine` PFst appPFst) fl - ++ map (appSnd $ combine` PSnd appPSnd) fr - (x, y) = abort $ "gopt{|PAIR|}: " +++ consPrint x +++ " " +++ consPrint y -where - appPFst f (PAIR x y) = PAIR (f x) y - appPSnd f (PAIR x y) = PAIR x (f y) - PFst (PAIR x y) = x - PSnd (PAIR x y) = y -gopt{|UNIT|} = Positionals [] -gopt{|CONS of {gcd_name}|} c = bifmap (\(CONS a)->a) CONS $ SubParsers [(gcd_name, c)] -gopt{|EITHER|} l r = case (l, r) of - (SubParsers sl, SubParsers sr) - = SubParsers - $ map (appSnd $ bifmap (\(LEFT a)->a) LEFT) sl - ++ map (appSnd $ bifmap (\(RIGHT a)->a) RIGHT) sr -gopt{|(,)|} l r = case (l, r) of - (Positionals pl, Positionals pr) - = Positionals - $ map (appSnd $ combine fst appFst) pl - ++ map (appSnd $ combine snd appSnd) pr -gopt{|(,,)|} f s t = case (f, s, t) of - (Positionals pf, Positionals ps, Positionals pt) - = Positionals - $ map (appSnd $ combine fst3 appFst3) pf - ++ map (appSnd $ combine snd3 appSnd3) ps - ++ map (appSnd $ combine thd3 appThd3) pt - -consPrint (Positionals x) = "Positionals" -consPrint (BinaryFlag x _) = "BinaryFlag" -consPrint (Flags x) = "Flags" -consPrint (SubParsers x) = "SubParsers" - -parseOpts :: [String] a -> MaybeError [String] (a, [String]) | gopt{|*|} a -parseOpts args a = pOpts gopt{|*|} args a - -pOpts :: (Opt a) [String] a -> MaybeError [String] (a, [String]) -pOpts (Positionals [p:ps]) [] a = Error [toString (length [p:ps]) +++ " positional arguments required"] -pOpts (Positionals [p:ps]) [arg:args] a = (snd p) arg a >>= pOpts (Positionals ps) args -pOpts (SubParsers ps) [arg:args] a = case find (\(l,p)->l==arg) ps of - Nothing = Error ["Unrecognized subcommand"] - Just (l, p) = pOpts p args a -pOpts (SubParsers ps) [] a = Error ["One of these subcommands required: " +++ join ", " (map fst ps)] -pOpts (Flags fs) [arg:args] a - | not (startsWith "--" arg) = Ok (a, [arg:args]) - = case find (\(l,p)->"--" +++ l == arg) fs of - Nothing = Error ["Unrecognized option: " +++ arg] - Just (l, p) = p args a >>= \(a, args)->pOpts (Flags fs) args a -pOpts (BinaryFlag yes no) args a - = pOpts (Positionals [("BOOL", \s v-> - if (s == "True") - (Ok (yes v)) - (if (s == "False") - (Ok (no v)) - (Error ["Not True or False"]) - ) - )]) args a -pOpts t args a = Ok (a, args) - -pHelp :: (Opt a) -> [String] -pHelp (Positionals []) = [] -pHelp (Positionals [(i, _):ps]) = [i, " ":pHelp $ Positionals ps] -pHelp (SubParsers ps) = - flatten - [[n, " ":pHelp opt] ++ ["\n"] - \\(n, opt)<-ps - ] -pHelp (Flags fs) = - ["Flags\n" - : - flatten - [["--",f, "\n"] - \\(f, p)<-fs - ] - ] - -:: T = - { field :: (Int,Int) - , field2 :: String - , t2 :: C - } -:: T2 = {f :: Int, f2 :: Bool} -:: C = A Int | B | C Bool - -:: ADT - = ADT1 - | ADT2 Int String - -derive binumap Opt, [], (,), MaybeError -derive gopt T, T2, ADT, C - -Start w -# ([argv0:args], w) = getCommandLine w -//= pHelp opt -= parseOpts args {field=(0, 0),field2="",t2=A 4} - -opt :: Opt T -opt = gopt{|*|} diff --git a/228-rawvarcons-in-default-layout-for-certain-adt/test.icl b/old/228-rawvarcons-in-default-layout-for-certain-adt/test.icl similarity index 100% rename from 228-rawvarcons-in-default-layout-for-certain-adt/test.icl rename to old/228-rawvarcons-in-default-layout-for-certain-adt/test.icl diff --git a/237-deriving-generic-editors-for-newtypes-crashes/test.icl b/old/237-deriving-generic-editors-for-newtypes-crashes/test.icl similarity index 100% rename from 237-deriving-generic-editors-for-newtypes-crashes/test.icl rename to old/237-deriving-generic-editors-for-newtypes-crashes/test.icl diff --git a/238-geditor-for-maybe-is-broken/test.icl b/old/238-geditor-for-maybe-is-broken/test.icl similarity index 100% rename from 238-geditor-for-maybe-is-broken/test.icl rename to old/238-geditor-for-maybe-is-broken/test.icl diff --git a/239-derived-editor-for-map-broken/test.icl b/old/239-derived-editor-for-map-broken/test.icl similarity index 100% rename from 239-derived-editor-for-map-broken/test.icl rename to old/239-derived-editor-for-map-broken/test.icl diff --git a/7gui/test.icl b/old/7gui/test.icl similarity index 100% rename from 7gui/test.icl rename to old/7gui/test.icl diff --git a/TimeGraph.zip b/old/TimeGraph.zip similarity index 100% rename from TimeGraph.zip rename to old/TimeGraph.zip diff --git a/abc/test.icl b/old/abc/test.icl similarity index 100% rename from abc/test.icl rename to old/abc/test.icl diff --git a/abstract-newtypes/nt.dcl b/old/abstract-newtypes/nt.dcl similarity index 100% rename from abstract-newtypes/nt.dcl rename to old/abstract-newtypes/nt.dcl diff --git a/abstract-newtypes/nt.icl b/old/abstract-newtypes/nt.icl similarity index 100% rename from abstract-newtypes/nt.icl rename to old/abstract-newtypes/nt.icl diff --git a/afp/a1/a.icl b/old/afp/a1/a.icl similarity index 100% rename from afp/a1/a.icl rename to old/afp/a1/a.icl diff --git a/old/afp/a10/a10 b/old/afp/a10/a10 new file mode 100755 index 0000000..3d39c53 Binary files /dev/null and b/old/afp/a10/a10 differ diff --git a/afp/a10/a10.icl b/old/afp/a10/a10.icl similarity index 100% rename from afp/a10/a10.icl rename to old/afp/a10/a10.icl diff --git a/afp/a10/setGADT.icl b/old/afp/a10/setGADT.icl similarity index 100% rename from afp/a10/setGADT.icl rename to old/afp/a10/setGADT.icl diff --git a/afp/a11/a11.icl b/old/afp/a11/a11.icl similarity index 100% rename from afp/a11/a11.icl rename to old/afp/a11/a11.icl diff --git a/afp/a12/cashModel.dcl b/old/afp/a12/cashModel.dcl similarity index 100% rename from afp/a12/cashModel.dcl rename to old/afp/a12/cashModel.dcl diff --git a/afp/a12/cashModel.icl b/old/afp/a12/cashModel.icl similarity index 100% rename from afp/a12/cashModel.icl rename to old/afp/a12/cashModel.icl diff --git a/afp/a12/gastyStart.dcl b/old/afp/a12/gastyStart.dcl similarity index 100% rename from afp/a12/gastyStart.dcl rename to old/afp/a12/gastyStart.dcl diff --git a/afp/a12/gastyStart.icl b/old/afp/a12/gastyStart.icl similarity index 100% rename from afp/a12/gastyStart.icl rename to old/afp/a12/gastyStart.icl diff --git a/afp/a12/testCash.icl b/old/afp/a12/testCash.icl similarity index 100% rename from afp/a12/testCash.icl rename to old/afp/a12/testCash.icl diff --git a/afp/a2/a2.icl b/old/afp/a2/a2.icl similarity index 100% rename from afp/a2/a2.icl rename to old/afp/a2/a2.icl diff --git a/afp/a2/a2a.icl b/old/afp/a2/a2a.icl similarity index 100% rename from afp/a2/a2a.icl rename to old/afp/a2/a2a.icl diff --git a/afp/a3/genericMap.icl b/old/afp/a3/genericMap.icl similarity index 100% rename from afp/a3/genericMap.icl rename to old/afp/a3/genericMap.icl diff --git a/afp/a3/serialize3Start.icl b/old/afp/a3/serialize3Start.icl similarity index 100% rename from afp/a3/serialize3Start.icl rename to old/afp/a3/serialize3Start.icl diff --git a/afp/a3/serializenative.icl b/old/afp/a3/serializenative.icl similarity index 100% rename from afp/a3/serializenative.icl rename to old/afp/a3/serializenative.icl diff --git a/afp/a4/skeleton4.icl b/old/afp/a4/skeleton4.icl similarity index 100% rename from afp/a4/skeleton4.icl rename to old/afp/a4/skeleton4.icl diff --git a/afp/a5/a5 b/old/afp/a5/a5 similarity index 100% rename from afp/a5/a5 rename to old/afp/a5/a5 diff --git a/afp/a5/a5.icl b/old/afp/a5/a5.icl similarity index 100% rename from afp/a5/a5.icl rename to old/afp/a5/a5.icl diff --git a/afp/a6/a7.icl b/old/afp/a6/a7.icl similarity index 100% rename from afp/a6/a7.icl rename to old/afp/a6/a7.icl diff --git a/afp/a7/a7.icl b/old/afp/a7/a7.icl similarity index 100% rename from afp/a7/a7.icl rename to old/afp/a7/a7.icl diff --git a/old/afp/a8/a8 b/old/afp/a8/a8 new file mode 100755 index 0000000..b74cd52 Binary files /dev/null and b/old/afp/a8/a8 differ diff --git a/afp/a8/a8.icl b/old/afp/a8/a8.icl similarity index 100% rename from afp/a8/a8.icl rename to old/afp/a8/a8.icl diff --git a/afp/a8/a8_old.icl b/old/afp/a8/a8_old.icl similarity index 100% rename from afp/a8/a8_old.icl rename to old/afp/a8/a8_old.icl diff --git a/old/afp/a9/a8 b/old/afp/a9/a8 new file mode 100755 index 0000000..b74cd52 Binary files /dev/null and b/old/afp/a9/a8 differ diff --git a/old/afp/a9/a9 b/old/afp/a9/a9 new file mode 100755 index 0000000..b9f77f5 Binary files /dev/null and b/old/afp/a9/a9 differ diff --git a/afp/a9/a9.icl b/old/afp/a9/a9.icl similarity index 100% rename from afp/a9/a9.icl rename to old/afp/a9/a9.icl diff --git a/alacarte/calc.icl b/old/alacarte/calc.icl similarity index 100% rename from alacarte/calc.icl rename to old/alacarte/calc.icl diff --git a/append-ed/Makefile b/old/append-ed/Makefile similarity index 100% rename from append-ed/Makefile rename to old/append-ed/Makefile diff --git a/append-ed/test.icl b/old/append-ed/test.icl similarity index 100% rename from append-ed/test.icl rename to old/append-ed/test.icl diff --git a/array_fun/test.icl b/old/array_fun/test.icl similarity index 100% rename from array_fun/test.icl rename to old/array_fun/test.icl diff --git a/array_itasks/Mul.dcl b/old/array_itasks/Mul.dcl similarity index 100% rename from array_itasks/Mul.dcl rename to old/array_itasks/Mul.dcl diff --git a/array_itasks/Sub.dcl b/old/array_itasks/Sub.dcl similarity index 100% rename from array_itasks/Sub.dcl rename to old/array_itasks/Sub.dcl diff --git a/array_itasks/T.dcl b/old/array_itasks/T.dcl similarity index 100% rename from array_itasks/T.dcl rename to old/array_itasks/T.dcl diff --git a/array_itasks/main.dcl b/old/array_itasks/main.dcl similarity index 100% rename from array_itasks/main.dcl rename to old/array_itasks/main.dcl diff --git a/array_itasks/test.icl b/old/array_itasks/test.icl similarity index 100% rename from array_itasks/test.icl rename to old/array_itasks/test.icl diff --git a/arrayfunctor/test.icl b/old/arrayfunctor/test.icl similarity index 100% rename from arrayfunctor/test.icl rename to old/arrayfunctor/test.icl diff --git a/base64/test.icl b/old/base64/test.icl similarity index 100% rename from base64/test.icl rename to old/base64/test.icl diff --git a/benchmark/test.icl b/old/benchmark/test.icl similarity index 100% rename from benchmark/test.icl rename to old/benchmark/test.icl diff --git a/benchmark/test.sh b/old/benchmark/test.sh similarity index 100% rename from benchmark/test.sh rename to old/benchmark/test.sh diff --git a/booking/Booking b/old/booking/Booking similarity index 100% rename from booking/Booking rename to old/booking/Booking diff --git a/booking/Booking.icl b/old/booking/Booking.icl similarity index 100% rename from booking/Booking.icl rename to old/booking/Booking.icl diff --git a/booking/test.icl b/old/booking/test.icl similarity index 100% rename from booking/test.icl rename to old/booking/test.icl diff --git a/bug/t.icl b/old/bug/t.icl similarity index 100% rename from bug/t.icl rename to old/bug/t.icl diff --git a/bugs/test.icl b/old/bugs/test.icl similarity index 100% rename from bugs/test.icl rename to old/bugs/test.icl diff --git a/choose/Makefile b/old/choose/Makefile similarity index 100% rename from choose/Makefile rename to old/choose/Makefile diff --git a/choose/test.icl b/old/choose/test.icl similarity index 100% rename from choose/test.icl rename to old/choose/test.icl diff --git a/cleanup/test.icl b/old/cleanup/test.icl similarity index 100% rename from cleanup/test.icl rename to old/cleanup/test.icl diff --git a/cli/test.icl b/old/cli/test.icl similarity index 100% rename from cli/test.icl rename to old/cli/test.icl diff --git a/codegenbug/Data/GenC.dcl b/old/codegenbug/Data/GenC.dcl similarity index 100% rename from codegenbug/Data/GenC.dcl rename to old/codegenbug/Data/GenC.dcl diff --git a/codegenbug/Data/GenC.icl b/old/codegenbug/Data/GenC.icl similarity index 100% rename from codegenbug/Data/GenC.icl rename to old/codegenbug/Data/GenC.icl diff --git a/codegenbug/test.icl b/old/codegenbug/test.icl similarity index 100% rename from codegenbug/test.icl rename to old/codegenbug/test.icl diff --git a/conj-semantics/Makefile b/old/conj-semantics/Makefile similarity index 100% rename from conj-semantics/Makefile rename to old/conj-semantics/Makefile diff --git a/conj-semantics/test.icl b/old/conj-semantics/test.icl similarity index 100% rename from conj-semantics/test.icl rename to old/conj-semantics/test.icl diff --git a/constructordynamic/test.icl b/old/constructordynamic/test.icl similarity index 100% rename from constructordynamic/test.icl rename to old/constructordynamic/test.icl diff --git a/contparse/test.icl b/old/contparse/test.icl similarity index 100% rename from contparse/test.icl rename to old/contparse/test.icl diff --git a/csg/p.icl b/old/csg/p.icl similarity index 100% rename from csg/p.icl rename to old/csg/p.icl diff --git a/deep-var/eval.dcl b/old/deep-var/eval.dcl similarity index 100% rename from deep-var/eval.dcl rename to old/deep-var/eval.dcl diff --git a/deep-var/eval.icl b/old/deep-var/eval.icl similarity index 100% rename from deep-var/eval.icl rename to old/deep-var/eval.icl diff --git a/deep-var/pprint b/old/deep-var/pprint similarity index 100% rename from deep-var/pprint rename to old/deep-var/pprint diff --git a/deep-var/pprint.dcl b/old/deep-var/pprint.dcl similarity index 100% rename from deep-var/pprint.dcl rename to old/deep-var/pprint.dcl diff --git a/deep-var/pprint.icl b/old/deep-var/pprint.icl similarity index 100% rename from deep-var/pprint.icl rename to old/deep-var/pprint.icl diff --git a/deep-var/test.dcl b/old/deep-var/test.dcl similarity index 100% rename from deep-var/test.dcl rename to old/deep-var/test.dcl diff --git a/deep-var/test.icl b/old/deep-var/test.icl similarity index 100% rename from deep-var/test.icl rename to old/deep-var/test.icl diff --git a/dep/test.icl b/old/dep/test.icl similarity index 100% rename from dep/test.icl rename to old/dep/test.icl diff --git a/documents/Makefile b/old/documents/Makefile similarity index 100% rename from documents/Makefile rename to old/documents/Makefile diff --git a/documents/test.icl b/old/documents/test.icl similarity index 100% rename from documents/test.icl rename to old/documents/test.icl diff --git a/doublylinked/test.icl b/old/doublylinked/test.icl similarity index 100% rename from doublylinked/test.icl rename to old/doublylinked/test.icl diff --git a/dropExtension/test.icl b/old/dropExtension/test.icl similarity index 100% rename from dropExtension/test.icl rename to old/dropExtension/test.icl diff --git a/dsl/dsl.icl b/old/dsl/dsl.icl similarity index 100% rename from dsl/dsl.icl rename to old/dsl/dsl.icl diff --git a/dupworld/test.icl b/old/dupworld/test.icl similarity index 100% rename from dupworld/test.icl rename to old/dupworld/test.icl diff --git a/dyn/Makefile b/old/dyn/Makefile similarity index 100% rename from dyn/Makefile rename to old/dyn/Makefile diff --git a/dyn/T.dcl b/old/dyn/T.dcl similarity index 100% rename from dyn/T.dcl rename to old/dyn/T.dcl diff --git a/dyn/T.icl b/old/dyn/T.icl similarity index 100% rename from dyn/T.icl rename to old/dyn/T.icl diff --git a/dyn/test.icl b/old/dyn/test.icl similarity index 100% rename from dyn/test.icl rename to old/dyn/test.icl diff --git a/dynamicclass/test.icl b/old/dynamicclass/test.icl similarity index 100% rename from dynamicclass/test.icl rename to old/dynamicclass/test.icl diff --git a/dyneditors/DynEditorExample.icl b/old/dyneditors/DynEditorExample.icl similarity index 100% rename from dyneditors/DynEditorExample.icl rename to old/dyneditors/DynEditorExample.icl diff --git a/dyneditors/DynamicEditor.dcl b/old/dyneditors/DynamicEditor.dcl similarity index 100% rename from dyneditors/DynamicEditor.dcl rename to old/dyneditors/DynamicEditor.dcl diff --git a/dyneditors/DynamicEditor.icl b/old/dyneditors/DynamicEditor.icl similarity index 100% rename from dyneditors/DynamicEditor.icl rename to old/dyneditors/DynamicEditor.icl diff --git a/eadt/Mul.dcl b/old/eadt/Mul.dcl similarity index 100% rename from eadt/Mul.dcl rename to old/eadt/Mul.dcl diff --git a/eadt/Mul.icl b/old/eadt/Mul.icl similarity index 100% rename from eadt/Mul.icl rename to old/eadt/Mul.icl diff --git a/eadt/Sub.dcl b/old/eadt/Sub.dcl similarity index 100% rename from eadt/Sub.dcl rename to old/eadt/Sub.dcl diff --git a/eadt/Sub.icl b/old/eadt/Sub.icl similarity index 100% rename from eadt/Sub.icl rename to old/eadt/Sub.icl diff --git a/eadt/T.dcl b/old/eadt/T.dcl similarity index 100% rename from eadt/T.dcl rename to old/eadt/T.dcl diff --git a/eadt/T.icl b/old/eadt/T.icl similarity index 100% rename from eadt/T.icl rename to old/eadt/T.icl diff --git a/eadt/export/B.dcl b/old/eadt/export/B.dcl similarity index 100% rename from eadt/export/B.dcl rename to old/eadt/export/B.dcl diff --git a/eadt/export/B.icl b/old/eadt/export/B.icl similarity index 100% rename from eadt/export/B.icl rename to old/eadt/export/B.icl diff --git a/eadt/export/C.dcl b/old/eadt/export/C.dcl similarity index 100% rename from eadt/export/C.dcl rename to old/eadt/export/C.dcl diff --git a/eadt/export/C.icl b/old/eadt/export/C.icl similarity index 100% rename from eadt/export/C.icl rename to old/eadt/export/C.icl diff --git a/eadt/export/main.dcl b/old/eadt/export/main.dcl similarity index 100% rename from eadt/export/main.dcl rename to old/eadt/export/main.dcl diff --git a/eadt/export/main.icl b/old/eadt/export/main.icl similarity index 100% rename from eadt/export/main.icl rename to old/eadt/export/main.icl diff --git a/eadt/main.dcl b/old/eadt/main.dcl similarity index 100% rename from eadt/main.dcl rename to old/eadt/main.dcl diff --git a/eadt/main.icl b/old/eadt/main.icl similarity index 100% rename from eadt/main.icl rename to old/eadt/main.icl diff --git a/eadt/test.icl b/old/eadt/test.icl similarity index 100% rename from eadt/test.icl rename to old/eadt/test.icl diff --git a/expr/class b/old/expr/class similarity index 100% rename from expr/class rename to old/expr/class diff --git a/expr/class.dcl b/old/expr/class.dcl similarity index 100% rename from expr/class.dcl rename to old/expr/class.dcl diff --git a/expr/class.icl b/old/expr/class.icl similarity index 100% rename from expr/class.icl rename to old/expr/class.icl diff --git a/expr/deep b/old/expr/deep similarity index 100% rename from expr/deep rename to old/expr/deep diff --git a/expr/deep.icl b/old/expr/deep.icl similarity index 100% rename from expr/deep.icl rename to old/expr/deep.icl diff --git a/expr/exist/exist b/old/expr/exist/exist similarity index 100% rename from expr/exist/exist rename to old/expr/exist/exist diff --git a/expr/exist/exist.dcl b/old/expr/exist/exist.dcl similarity index 100% rename from expr/exist/exist.dcl rename to old/expr/exist/exist.dcl diff --git a/expr/exist/exist.icl b/old/expr/exist/exist.icl similarity index 100% rename from expr/exist/exist.icl rename to old/expr/exist/exist.icl diff --git a/expr/exist/existFor.dcl b/old/expr/exist/existFor.dcl similarity index 100% rename from expr/exist/existFor.dcl rename to old/expr/exist/existFor.dcl diff --git a/expr/exist/existMult.dcl b/old/expr/exist/existMult.dcl similarity index 100% rename from expr/exist/existMult.dcl rename to old/expr/exist/existMult.dcl diff --git a/expr/exist/existMult.icl b/old/expr/exist/existMult.icl similarity index 100% rename from expr/exist/existMult.icl rename to old/expr/exist/existMult.icl diff --git a/expr/exist/while.dcl b/old/expr/exist/while.dcl similarity index 100% rename from expr/exist/while.dcl rename to old/expr/exist/while.dcl diff --git a/expr/exist/while.icl b/old/expr/exist/while.icl similarity index 100% rename from expr/exist/while.icl rename to old/expr/exist/while.icl diff --git a/expr/exist/whileMult.dcl b/old/expr/exist/whileMult.dcl similarity index 100% rename from expr/exist/whileMult.dcl rename to old/expr/exist/whileMult.dcl diff --git a/expr/exist/whileMult.icl b/old/expr/exist/whileMult.icl similarity index 100% rename from expr/exist/whileMult.icl rename to old/expr/exist/whileMult.icl diff --git a/expr/exist/whileRep.dcl b/old/expr/exist/whileRep.dcl similarity index 100% rename from expr/exist/whileRep.dcl rename to old/expr/exist/whileRep.dcl diff --git a/expr/exist/whileRep.icl b/old/expr/exist/whileRep.icl similarity index 100% rename from expr/exist/whileRep.icl rename to old/expr/exist/whileRep.icl diff --git a/expr/expr.md b/old/expr/expr.md similarity index 100% rename from expr/expr.md rename to old/expr/expr.md diff --git a/expr/gadt b/old/expr/gadt similarity index 100% rename from expr/gadt rename to old/expr/gadt diff --git a/expr/gadt.icl b/old/expr/gadt.icl similarity index 100% rename from expr/gadt.icl rename to old/expr/gadt.icl diff --git a/expr/shallow b/old/expr/shallow similarity index 100% rename from expr/shallow rename to old/expr/shallow diff --git a/expr/shallow.icl b/old/expr/shallow.icl similarity index 100% rename from expr/shallow.icl rename to old/expr/shallow.icl diff --git a/exprparse/test.icl b/old/exprparse/test.icl similarity index 100% rename from exprparse/test.icl rename to old/exprparse/test.icl diff --git a/expruniq/shallow.icl b/old/expruniq/shallow.icl similarity index 100% rename from expruniq/shallow.icl rename to old/expruniq/shallow.icl diff --git a/expruniq/uexpr.icl b/old/expruniq/uexpr.icl similarity index 100% rename from expruniq/uexpr.icl rename to old/expruniq/uexpr.icl diff --git a/ext/test.dcl b/old/ext/test.dcl similarity index 100% rename from ext/test.dcl rename to old/ext/test.dcl diff --git a/ext/test.icl b/old/ext/test.icl similarity index 100% rename from ext/test.icl rename to old/ext/test.icl diff --git a/filepicker/prj b/old/filepicker/prj similarity index 100% rename from filepicker/prj rename to old/filepicker/prj diff --git a/filepicker/test.icl b/old/filepicker/test.icl similarity index 100% rename from filepicker/test.icl rename to old/filepicker/test.icl diff --git a/filepickerbas/test.icl b/old/filepickerbas/test.icl similarity index 100% rename from filepickerbas/test.icl rename to old/filepickerbas/test.icl diff --git a/fixwidthstr/test.icl b/old/fixwidthstr/test.icl similarity index 100% rename from fixwidthstr/test.icl rename to old/fixwidthstr/test.icl diff --git a/foreign/Makefile b/old/foreign/Makefile similarity index 100% rename from foreign/Makefile rename to old/foreign/Makefile diff --git a/foreign/fac.dcl b/old/foreign/fac.dcl similarity index 100% rename from foreign/fac.dcl rename to old/foreign/fac.dcl diff --git a/foreign/fac.icl b/old/foreign/fac.icl similarity index 100% rename from foreign/fac.icl rename to old/foreign/fac.icl diff --git a/foreign/test.dcl b/old/foreign/test.dcl similarity index 100% rename from foreign/test.dcl rename to old/foreign/test.dcl diff --git a/foreign/test.icl b/old/foreign/test.icl similarity index 100% rename from foreign/test.icl rename to old/foreign/test.icl diff --git a/fullscreen/Makefile b/old/fullscreen/Makefile similarity index 100% rename from fullscreen/Makefile rename to old/fullscreen/Makefile diff --git a/fullscreen/test.icl b/old/fullscreen/test.icl similarity index 100% rename from fullscreen/test.icl rename to old/fullscreen/test.icl diff --git a/fun/test.icl b/old/fun/test.icl similarity index 100% rename from fun/test.icl rename to old/fun/test.icl diff --git a/funcdeps/test.icl b/old/funcdeps/test.icl similarity index 100% rename from funcdeps/test.icl rename to old/funcdeps/test.icl diff --git a/gast-der/test Time Profile.pcl b/old/gast-der/test Time Profile.pcl similarity index 100% rename from gast-der/test Time Profile.pcl rename to old/gast-der/test Time Profile.pcl diff --git a/gast-der/test.icl b/old/gast-der/test.icl similarity index 100% rename from gast-der/test.icl rename to old/gast-der/test.icl diff --git a/gast-der/testnf b/old/gast-der/testnf similarity index 100% rename from gast-der/testnf rename to old/gast-der/testnf diff --git a/gast-der/testnf Time Profile.pcl b/old/gast-der/testnf Time Profile.pcl similarity index 100% rename from gast-der/testnf Time Profile.pcl rename to old/gast-der/testnf Time Profile.pcl diff --git a/gast-itasks/test.icl b/old/gast-itasks/test.icl similarity index 100% rename from gast-itasks/test.icl rename to old/gast-itasks/test.icl diff --git a/geditor-arity/Makefile b/old/geditor-arity/Makefile similarity index 100% rename from geditor-arity/Makefile rename to old/geditor-arity/Makefile diff --git a/geditor-arity/test.icl b/old/geditor-arity/test.icl similarity index 100% rename from geditor-arity/test.icl rename to old/geditor-arity/test.icl diff --git a/gen/test.icl b/old/gen/test.icl similarity index 100% rename from gen/test.icl rename to old/gen/test.icl diff --git a/gencons/Makefile b/old/gencons/Makefile similarity index 100% rename from gencons/Makefile rename to old/gencons/Makefile diff --git a/gencons/test.icl b/old/gencons/test.icl similarity index 100% rename from gencons/test.icl rename to old/gencons/test.icl diff --git a/generic_classes/C.dcl b/old/generic_classes/C.dcl similarity index 100% rename from generic_classes/C.dcl rename to old/generic_classes/C.dcl diff --git a/generic_classes/C.icl b/old/generic_classes/C.icl similarity index 100% rename from generic_classes/C.icl rename to old/generic_classes/C.icl diff --git a/generic_classes/Makefile b/old/generic_classes/Makefile similarity index 100% rename from generic_classes/Makefile rename to old/generic_classes/Makefile diff --git a/generic_classes/test.icl b/old/generic_classes/test.icl similarity index 100% rename from generic_classes/test.icl rename to old/generic_classes/test.icl diff --git a/generic_constraints/test.icl b/old/generic_constraints/test.icl similarity index 100% rename from generic_constraints/test.icl rename to old/generic_constraints/test.icl diff --git a/gentests/test.icl b/old/gentests/test.icl similarity index 100% rename from gentests/test.icl rename to old/gentests/test.icl diff --git a/haye_test/test.icl b/old/haye_test/test.icl similarity index 100% rename from haye_test/test.icl rename to old/haye_test/test.icl diff --git a/hex/hex.icl b/old/hex/hex.icl similarity index 100% rename from hex/hex.icl rename to old/hex/hex.icl diff --git a/higher-order/test.icl b/old/higher-order/test.icl similarity index 100% rename from higher-order/test.icl rename to old/higher-order/test.icl diff --git a/iTasks-notifications/Makefile b/old/iTasks-notifications/Makefile similarity index 100% rename from iTasks-notifications/Makefile rename to old/iTasks-notifications/Makefile diff --git a/iTasks-notifications/test.icl b/old/iTasks-notifications/test.icl similarity index 100% rename from iTasks-notifications/test.icl rename to old/iTasks-notifications/test.icl diff --git a/if/Makefile b/old/if/Makefile similarity index 100% rename from if/Makefile rename to old/if/Makefile diff --git a/if/test.icl b/old/if/test.icl similarity index 100% rename from if/test.icl rename to old/if/test.icl diff --git a/inf-default/test.icl b/old/inf-default/test.icl similarity index 100% rename from inf-default/test.icl rename to old/inf-default/test.icl diff --git a/infdomain/test.icl b/old/infdomain/test.icl similarity index 100% rename from infdomain/test.icl rename to old/infdomain/test.icl diff --git a/iot/test.icl b/old/iot/test.icl similarity index 100% rename from iot/test.icl rename to old/iot/test.icl diff --git a/json-bigbytes/test.icl b/old/json-bigbytes/test.icl similarity index 100% rename from json-bigbytes/test.icl rename to old/json-bigbytes/test.icl diff --git a/json-eq-string/test.icl b/old/json-eq-string/test.icl similarity index 100% rename from json-eq-string/test.icl rename to old/json-eq-string/test.icl diff --git a/jsonmap/test.icl b/old/jsonmap/test.icl similarity index 100% rename from jsonmap/test.icl rename to old/jsonmap/test.icl diff --git a/lat/test.icl b/old/lat/test.icl similarity index 100% rename from lat/test.icl rename to old/lat/test.icl diff --git a/letrec/test.icl b/old/letrec/test.icl similarity index 100% rename from letrec/test.icl rename to old/letrec/test.icl diff --git a/library/test.icl b/old/library/test.icl similarity index 100% rename from library/test.icl rename to old/library/test.icl diff --git a/linker/test.icl b/old/linker/test.icl similarity index 100% rename from linker/test.icl rename to old/linker/test.icl diff --git a/list_types/test.icl b/old/list_types/test.icl similarity index 100% rename from list_types/test.icl rename to old/list_types/test.icl diff --git a/macros/test.icl b/old/macros/test.icl similarity index 100% rename from macros/test.icl rename to old/macros/test.icl diff --git a/macros/test.log b/old/macros/test.log similarity index 100% rename from macros/test.log rename to old/macros/test.log diff --git a/malfunctioning_dropdowns/Makefile b/old/malfunctioning_dropdowns/Makefile similarity index 100% rename from malfunctioning_dropdowns/Makefile rename to old/malfunctioning_dropdowns/Makefile diff --git a/malfunctioning_dropdowns/test.icl b/old/malfunctioning_dropdowns/test.icl similarity index 100% rename from malfunctioning_dropdowns/test.icl rename to old/malfunctioning_dropdowns/test.icl diff --git a/maybe-migration/Makefile b/old/maybe-migration/Makefile similarity index 100% rename from maybe-migration/Makefile rename to old/maybe-migration/Makefile diff --git a/maybe-migration/test.icl b/old/maybe-migration/test.icl similarity index 100% rename from maybe-migration/test.icl rename to old/maybe-migration/test.icl diff --git a/metaeditor/.gitignore b/old/metaeditor/.gitignore similarity index 100% rename from metaeditor/.gitignore rename to old/metaeditor/.gitignore diff --git a/metaeditor/EditorExt.dcl b/old/metaeditor/EditorExt.dcl similarity index 100% rename from metaeditor/EditorExt.dcl rename to old/metaeditor/EditorExt.dcl diff --git a/metaeditor/EditorExt.icl b/old/metaeditor/EditorExt.icl similarity index 100% rename from metaeditor/EditorExt.icl rename to old/metaeditor/EditorExt.icl diff --git a/metaeditor/MetaType.dcl b/old/metaeditor/MetaType.dcl similarity index 100% rename from metaeditor/MetaType.dcl rename to old/metaeditor/MetaType.dcl diff --git a/metaeditor/MetaType.icl b/old/metaeditor/MetaType.icl similarity index 100% rename from metaeditor/MetaType.icl rename to old/metaeditor/MetaType.icl diff --git a/metaeditor/ed.icl b/old/metaeditor/ed.icl similarity index 100% rename from metaeditor/ed.icl rename to old/metaeditor/ed.icl diff --git a/new-external/Makefile b/old/new-external/Makefile similarity index 100% rename from new-external/Makefile rename to old/new-external/Makefile diff --git a/new-external/test.icl b/old/new-external/test.icl similarity index 100% rename from new-external/test.icl rename to old/new-external/test.icl diff --git a/new-layouts/Makefile b/old/new-layouts/Makefile similarity index 100% rename from new-layouts/Makefile rename to old/new-layouts/Makefile diff --git a/new-layouts/test.icl b/old/new-layouts/test.icl similarity index 100% rename from new-layouts/test.icl rename to old/new-layouts/test.icl diff --git a/newtype-editor/Makefile b/old/newtype-editor/Makefile similarity index 100% rename from newtype-editor/Makefile rename to old/newtype-editor/Makefile diff --git a/newtype-editor/test.icl b/old/newtype-editor/test.icl similarity index 100% rename from newtype-editor/test.icl rename to old/newtype-editor/test.icl diff --git a/onclick/test.icl b/old/onclick/test.icl similarity index 100% rename from onclick/test.icl rename to old/onclick/test.icl diff --git a/overloading_tc/test.icl b/old/overloading_tc/test.icl similarity index 100% rename from overloading_tc/test.icl rename to old/overloading_tc/test.icl diff --git a/paard.icl b/old/paard.icl similarity index 100% rename from paard.icl rename to old/paard.icl diff --git a/parallel-action/Makefile b/old/parallel-action/Makefile similarity index 100% rename from parallel-action/Makefile rename to old/parallel-action/Makefile diff --git a/parallel-action/test.icl b/old/parallel-action/test.icl similarity index 100% rename from parallel-action/test.icl rename to old/parallel-action/test.icl diff --git a/parseclass/expr.icl b/old/parseclass/expr.icl similarity index 100% rename from parseclass/expr.icl rename to old/parseclass/expr.icl diff --git a/parseclass/pc.icl b/old/parseclass/pc.icl similarity index 100% rename from parseclass/pc.icl rename to old/parseclass/pc.icl diff --git a/parserParser/test.icl b/old/parserParser/test.icl similarity index 100% rename from parserParser/test.icl rename to old/parserParser/test.icl diff --git a/parserParser/testclass.icl b/old/parserParser/testclass.icl similarity index 100% rename from parserParser/testclass.icl rename to old/parserParser/testclass.icl diff --git a/polycurry/test.icl b/old/polycurry/test.icl similarity index 100% rename from polycurry/test.icl rename to old/polycurry/test.icl diff --git a/polymorph-eadt/ext.dcl b/old/polymorph-eadt/ext.dcl similarity index 100% rename from polymorph-eadt/ext.dcl rename to old/polymorph-eadt/ext.dcl diff --git a/polymorph-eadt/ext.icl b/old/polymorph-eadt/ext.icl similarity index 100% rename from polymorph-eadt/ext.icl rename to old/polymorph-eadt/ext.icl diff --git a/polymorph-eadt/main.dcl b/old/polymorph-eadt/main.dcl similarity index 100% rename from polymorph-eadt/main.dcl rename to old/polymorph-eadt/main.dcl diff --git a/polymorph-eadt/main.icl b/old/polymorph-eadt/main.icl similarity index 100% rename from polymorph-eadt/main.icl rename to old/polymorph-eadt/main.icl diff --git a/profile/a.out Time Profile.pcl b/old/profile/a.out Time Profile.pcl similarity index 100% rename from profile/a.out Time Profile.pcl rename to old/profile/a.out Time Profile.pcl diff --git a/profile/callgrind.out.32418 b/old/profile/callgrind.out.32418 similarity index 100% rename from profile/callgrind.out.32418 rename to old/profile/callgrind.out.32418 diff --git a/profile/test.icl b/old/profile/test.icl similarity index 100% rename from profile/test.icl rename to old/profile/test.icl diff --git a/qualified_hidden/test.icl b/old/qualified_hidden/test.icl similarity index 100% rename from qualified_hidden/test.icl rename to old/qualified_hidden/test.icl diff --git a/randdist/test.icl b/old/randdist/test.icl similarity index 100% rename from randdist/test.icl rename to old/randdist/test.icl diff --git a/randdist/testsk b/old/randdist/testsk similarity index 100% rename from randdist/testsk rename to old/randdist/testsk diff --git a/randdist/testsk.icl b/old/randdist/testsk.icl similarity index 100% rename from randdist/testsk.icl rename to old/randdist/testsk.icl diff --git a/randstring/test.icl b/old/randstring/test.icl similarity index 100% rename from randstring/test.icl rename to old/randstring/test.icl diff --git a/rank2/test.icl b/old/rank2/test.icl similarity index 100% rename from rank2/test.icl rename to old/rank2/test.icl diff --git a/real_conv/test.icl b/old/real_conv/test.icl similarity index 100% rename from real_conv/test.icl rename to old/real_conv/test.icl diff --git a/runtasks/test.dcl b/old/runtasks/test.dcl similarity index 100% rename from runtasks/test.dcl rename to old/runtasks/test.dcl diff --git a/runtasks/test.icl b/old/runtasks/test.icl similarity index 100% rename from runtasks/test.icl rename to old/runtasks/test.icl diff --git a/runtime-generic/test.icl b/old/runtime-generic/test.icl similarity index 100% rename from runtime-generic/test.icl rename to old/runtime-generic/test.icl diff --git a/select/Select.dcl b/old/select/Select.dcl similarity index 100% rename from select/Select.dcl rename to old/select/Select.dcl diff --git a/sequence_slow/Makefile b/old/sequence_slow/Makefile similarity index 100% rename from sequence_slow/Makefile rename to old/sequence_slow/Makefile diff --git a/sequence_slow/test.icl b/old/sequence_slow/test.icl similarity index 100% rename from sequence_slow/test.icl rename to old/sequence_slow/test.icl diff --git a/shared_selection/test.icl b/old/shared_selection/test.icl similarity index 100% rename from shared_selection/test.icl rename to old/shared_selection/test.icl diff --git a/sharestore/test.icl b/old/sharestore/test.icl similarity index 100% rename from sharestore/test.icl rename to old/sharestore/test.icl diff --git a/signal/prj b/old/signal/prj similarity index 100% rename from signal/prj rename to old/signal/prj diff --git a/signal/test.icl b/old/signal/test.icl similarity index 100% rename from signal/test.icl rename to old/signal/test.icl diff --git a/stampedShare/test.icl b/old/stampedShare/test.icl similarity index 100% rename from stampedShare/test.icl rename to old/stampedShare/test.icl diff --git a/stepparallel/test.icl b/old/stepparallel/test.icl similarity index 100% rename from stepparallel/test.icl rename to old/stepparallel/test.icl diff --git a/stimer/Makefile b/old/stimer/Makefile similarity index 100% rename from stimer/Makefile rename to old/stimer/Makefile diff --git a/stimer/test.icl b/old/stimer/test.icl similarity index 100% rename from stimer/test.icl rename to old/stimer/test.icl diff --git a/strictlet/test.icl b/old/strictlet/test.icl similarity index 100% rename from strictlet/test.icl rename to old/strictlet/test.icl diff --git a/tabbar/test.icl b/old/tabbar/test.icl similarity index 100% rename from tabbar/test.icl rename to old/tabbar/test.icl diff --git a/tcp/test.icl b/old/tcp/test.icl similarity index 100% rename from tcp/test.icl rename to old/tcp/test.icl diff --git a/te/test.icl b/old/te/test.icl similarity index 100% rename from te/test.icl rename to old/te/test.icl diff --git a/test.prt b/old/test.prt similarity index 100% rename from test.prt rename to old/test.prt diff --git a/test.txt b/old/test.txt similarity index 100% rename from test.txt rename to old/test.txt diff --git a/test2.icl b/old/test2.icl similarity index 100% rename from test2.icl rename to old/test2.icl diff --git a/test3.icl b/old/test3.icl similarity index 100% rename from test3.icl rename to old/test3.icl diff --git a/threadpool/test.icl b/old/threadpool/test.icl similarity index 100% rename from threadpool/test.icl rename to old/threadpool/test.icl diff --git a/timegraph/TimeGraph/TimeGraph.dcl b/old/timegraph/TimeGraph/TimeGraph.dcl similarity index 100% rename from timegraph/TimeGraph/TimeGraph.dcl rename to old/timegraph/TimeGraph/TimeGraph.dcl diff --git a/timegraph/TimeGraph/TimeGraph.icl b/old/timegraph/TimeGraph/TimeGraph.icl similarity index 100% rename from timegraph/TimeGraph/TimeGraph.icl rename to old/timegraph/TimeGraph/TimeGraph.icl diff --git a/type-restrictions/test.icl b/old/type-restrictions/test.icl similarity index 100% rename from type-restrictions/test.icl rename to old/type-restrictions/test.icl diff --git a/shallow.icl b/shallow.icl new file mode 100644 index 0000000..aeffa23 --- /dev/null +++ b/shallow.icl @@ -0,0 +1,8 @@ +module shallow + +import StdEnv + +:: DSL = DSL a + +lit :: a -> DSL a +lit a = ... diff --git a/struct/struct.icl b/struct/struct.icl deleted file mode 100644 index f5cb346..0000000 --- a/struct/struct.icl +++ /dev/null @@ -1,131 +0,0 @@ -module struct - -import StdEnv -import StdGeneric -import StdDebug - -import Text - -import Data.Functor -import Control.Applicative - -toEnumValue :: GenericConsDescriptor -> String -toEnumValue gcd = gcd.gcd_type_def.gtd_name +++ "_" +++ gcd.gcd_name - -toEnumType :: GenericTypeDefDescriptor -> String -toEnumType gtd = "enum cleanc_" +++ gtd.gtd_name - -class gGenerateC a | gToCType{|*|}, gToCValue{|*|}, gToCEnums{|*|} a - -:: CInfo a = {header :: String , toValue :: a -> String} - -generateCInfo :: CInfo a | gGenerateC a -generateCInfo = - let - (CEnums enums) = cast res gToCEnums{|*|} - (SM types) = cast res gToCType{|*|} - res = - { header = concat - [ join "\n" (removeDup (sort enums)) - , "\n\n" - , concat (types {fresh=0,inRecord=False,indent=0} []) - , ";" - ] - , toValue = \a->concat (gToCValue{|*|} a []) - } - in res -where - cast :: (v a) -> ((w a) -> w a) - cast _ = id - -generic gToCType a :: Structmaker a -:: Structmaker a = SM (SData [String] -> [String]) | StructMakerOnzin a -:: SData = {indent :: Int, fresh :: Int, inRecord :: Bool} -indent s c = [createArray s.indent '\t':c] -show str s c = indent s [str:c] - -gToCType{|Int|} = SM (show "uint64_t") -gToCType{|Real|} = SM (show "double") -gToCType{|Bool|} = SM (show "bool") -gToCType{|UNIT|} = SM \_->id -gToCType{|EITHER|} (SM fl) (SM fr) = SM \s->fl s o fr s -gToCType{|PAIR|} (SM fl) (SM fr) - = SM \s c - | s.inRecord = fl s (fr s c) - = fl s [" f", toString s.fresh, ";\n":fr {s & fresh=s.fresh+1} c] -gToCType{|OBJECT of gtd|} (SM f) - //Newtype - | gtd.gtd_num_conses == 0 = SM f - = SM \s c - //Enumeration (no data) - | and [gcd.gcd_arity == 0\\gcd<-gtd.gtd_conses] = indent s [toEnumType gtd:c] - //Regular ADTs - # s` = {s & indent = s.indent + 1} - = indent s ["struct clean_", gtd.gtd_name, " {\n": - indent s` [toEnumType gtd, " cons;\n": - indent s` ["union {\n": - f {s` & indent=s`.indent+1, inRecord=False} (indent s` ["} data;\n": - indent s ["}":c]])]]] -gToCType{|CONS of gcd|} (SM f) - //No data field - | gcd.gcd_arity == 0 = SM \_->id - //Only one data field - | gcd.gcd_arity == 1 = SM \s c->f s [" ", gcd.gcd_name, ";\n":c] - = SM \s c->indent s ["struct {\n":f {s & indent=s.indent+1} [" f", toString (gcd.gcd_arity - 1), ";\n":indent s ["} ", gcd.gcd_name, ";\n":c]]] -gToCType{|RECORD of grd|} (SM f) - = SM \s c->indent s ["struct clean_", grd.grd_name, " {\n": f {s & indent=s.indent+1, inRecord=True} (indent s ["}":c])] -gToCType{|FIELD of gfd|} (SM f) = SM \s c->f s [" ", gfd.gfd_name,";\n":c] - -:: CEnums a = CEnums [String] | CEnumsOnzin a -generic gToCEnums a :: CEnums a -gToCEnums{|a|} = CEnums [] -gToCEnums{|UNIT|} = CEnums [] -gToCEnums{|EITHER|} (CEnums fl) (CEnums fr) = CEnums (fl ++ fr) -gToCEnums{|PAIR|} (CEnums fl) (CEnums fr) = CEnums (fl ++ fr) -gToCEnums{|OBJECT of gtd|} (CEnums f) = CEnums [concat [toEnumType gtd, " {", join ", " (map toEnumValue gtd.gtd_conses), "};"]:f] -gToCEnums{|CONS|} (CEnums f) = CEnums f -gToCEnums{|RECORD|} (CEnums f) = CEnums f -gToCEnums{|FIELD|} (CEnums f) = CEnums f - -generic gToCValue a :: a [String] -> [String] -gToCValue{|Int|} i c = [toString i:c] -gToCValue{|Real|} r c = [toString r:c] -gToCValue{|Bool|} b c = [if b "true" "false":c] -gToCValue{|UNIT|} _ _ = [] -gToCValue{|EITHER|} fl _ (LEFT l) c = fl l c -gToCValue{|EITHER|} _ fr (RIGHT l) c = fr l c -gToCValue{|PAIR|} fl fr (PAIR l r) c = fl l [", ":fr r c] -gToCValue{|OBJECT of gtd|} f (OBJECT a) c - //Newtype - | gtd.gtd_num_conses == 0 = f a c - | and [gcd.gcd_arity == 0\\gcd<-gtd.gtd_conses] = f a c - = ["{":f a ["}":c]] -gToCValue{|CONS of gcd|} f (CONS a) c - //No data field - | gcd.gcd_arity == 0 = [toEnumValue gcd:c] - | gcd.gcd_arity == 1 = [" .cons=",toEnumValue gcd,", .data.",gcd.gcd_name,"=":f a c] - = [" .cons=",toEnumValue gcd,", .data.",gcd.gcd_name,"={":f a ["} ":c]] -gToCValue{|RECORD|} f (RECORD a) c = ["{":f a ["}":c]] -gToCValue{|FIELD of gfd|} f (FIELD a) c = [" .", gfd.gfd_name, "=": f a c] - -:: DHTDetails - = DHT Int Bool - | SHT Addr - | XXX Int Int Int - | XXY Int Int DHTType - -:: Addr =: Addr Int - -:: DHTType = DHT11 | DHT12 | DHT22 - -derive class gGenerateC DHTDetails, DHTType, Addr, Record - -Start :: CInfo Record -Start = generateCInfo - -:: Record = - { field1 :: Int - , field2 :: Bool - , field3 :: DHTType - , field4 :: DHTDetails - } diff --git a/test.icl b/test.icl index 2350a9a..822f41d 100644 --- a/test.icl +++ b/test.icl @@ -1,52 +1,38 @@ module test -import StdEnv, StdGeneric -import Data.Array - -Start :: [{!Int}] -Start = - [ appendArr {!1,2,3} {!4,5,6,7} - , appendArr {!} {!} - , appendArr {!} {!1,2,3} - , appendArr {!1,2,3} {!} - ] -/* -derive bimap Box - -:: Box b a =: Box b - -unBox (Box b) :== b -box b :== Box b - -generic gPotentialInf a :: [String] -> Box Bool a - -gPotentialInf{|World|} _ = box False -gPotentialInf{|File|} _ = box False -gPotentialInf{|Bool|} _ = box False -gPotentialInf{|Char|} _ = box False -gPotentialInf{|Real|} _ = box False -gPotentialInf{|Int|} _ = box False -gPotentialInf{|Dynamic|} _ = box False -gPotentialInf{|(->)|} _ _ _ = box False -gPotentialInf{|{}|} a m = box (unBox (a m)) -gPotentialInf{|{!}|} a m = box (unBox (a m)) -gPotentialInf{|{#}|} a m = box (unBox (a m)) -gPotentialInf{|UNIT|} _ = box False -gPotentialInf{|EITHER|} l r m = box (unBox (l m) || unBox (r m)) -gPotentialInf{|PAIR|} l r m = box (unBox (l m) || unBox (r m)) -gPotentialInf{|CONS|} x m = box (unBox (x m)) -gPotentialInf{|FIELD|} x m = box (unBox (x m)) -gPotentialInf{|RECORD of {grd_name}|} x m - | isMember grd_name m = box True - = box (unBox (x [grd_name:m])) -gPotentialInf{|OBJECT of {gtd_name}|} x m - | isMember gtd_name m = box True - = box (unBox (x [gtd_name:m])) - -//derive gPotentialInf Int,Bool,Char,Real,String,File,World,Dynamic -derive gPotentialInf (),(,),(,,),(,,,),(,,,,),(,,,,,),(,,,,,,),(,,,,,,,),(,,,,,,,,),(,,,,,,,,,),(,,,,,,,,,,),(,,,,,,,,,,,),(,,,,,,,,,,,,),(,,,,,,,,,,,,,),(,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,),(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) -derive gPotentialInf {},{#},{!},[],[! ],[ !],[!!],[#],[#!] - -Start :: Box Bool *File -Start = gPotentialInf{|*|} [] -*/ +import StdEnv +import Data.Maybe +import Data.Functor +import Control.Monad +import Control.Applicative + +class expr v where + lit :: i -> v i | toString i + (+.) infixl 6 :: (v i) (v i) -> v i | + i + +instance + (v a) | expr v & + a where + + l r = l +. r + +eval :: (Maybe a) -> Maybe a +eval x = x +instance expr Maybe where + lit i = Just i + +. x y = (+) <$> x <*> y + +:: Print a =: Print String +print :: (Print a) -> String +print (Print a) = a +instance expr Print where + lit i = Print (toString i) + +. (Print l) (Print r) = Print (l +++ "+" +++ r) + +printEval :: (A.v: v a | expr v) -> (Maybe a, String) +//printEval f = (f, let (Print p) = f in p) +printEval f = (eval f, print f) + +//Mag niet +//Start :: (Maybe Int, String) +//Start = printEval (lit 4 + lit 38) + +//Mag wel +Start = let (Print f) = lit 4 + lit 38 in f