X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;ds=sidebyside;f=test.icl;h=dddfbe1a6c9d7473d65aa7aee81aef0e21f935c6;hb=dd851e8574c37cad729a3ba3b4e64a548bb4422e;hp=2350a9a721c08da33bea0b08cc4bd588bcfd0bab;hpb=8ff537028a2955ede52506d13628c2d3faede6ed;p=clean-tests.git diff --git a/test.icl b/test.icl index 2350a9a..dddfbe1 100644 --- a/test.icl +++ b/test.icl @@ -1,52 +1,20 @@ module test -import StdEnv, StdGeneric -import Data.Array +import StdEnv -Start :: [{!Int}] -Start = - [ appendArr {!1,2,3} {!4,5,6,7} - , appendArr {!} {!} - , appendArr {!} {!1,2,3} - , appendArr {!1,2,3} {!} - ] -/* -derive bimap Box +import graph_copy_with_names, symbols_in_program +import System.CommandLine -:: Box b a =: Box b +test :: !{#Symbol} a -> a +test symbols a + # (a, b, c) = copy_to_string_with_names a + # (a, r) = copy_from_string_with_names a b c symbols + = a -unBox (Box b) :== b -box b :== Box b +polyid :: (A.a: a -> a) -> (Int, Bool) +polyid f = (f 42, f True) -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{|*|} [] -*/ +Start w + # ([argv0:_], w) = getCommandLine w + # (symbols, w) = accFiles (read_symbols argv0) w + = test symbols (polyid id)