ushalow
[clean-tests.git] / test.icl
index 600f4d6..2350a9a 100644 (file)
--- a/test.icl
+++ b/test.icl
@@ -1,57 +1,52 @@
 module test
-//
-//import Data.Func, StdFunctions, iTasks
-//
-//derive gDefault ChoiceNode
-//
-//Start w = flip doTasks w $
-//     withShared 5 \sharedInt->
-//     withShared [] \sharedSel->
-//     (editSharedSelectionWithShared 
-//             [SelectInTree
-//                     (\l->[{defaultValue & id=i,label=toString i}\\i<-[0..l]])
-//                     (\_ s->s)
-//             ] sharedInt sharedSel <<@ Title "Selection" <<@ multipleAttr False)
-//     -|| (updateSharedInformation [] sharedInt <<@ Title "Number of items")
-//     -|| (updateSharedInformation [] sharedSel <<@ Title "Current selection")
-//     >&> \sh->(viewSharedInformation [] (mapRead toSingleLineText sh) <<@ Title "Current task value" )
-//
-//from Data.Map import singleton
-//import Data.Map.GenJSON
-//import iTasks
-//
-//Start w = doTasks t w
-//
-//t :: Task [(Int, TaskValue Int)]
-//t = parallel
-//     [(Embedded, \stl->
-//             appendTask Embedded (\_->viewInformation [] 42) stl
-//             >>! \i->set (singleton "focus" (JSONBool True)) (sdsFocus i (taskListEntryMeta stl))
-//             >>~ \_->viewSharedInformation []
-//                     (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeProgress=True,includeAttributes=True} stl)
-//             @! 42
-//     )] []
-
-//import iTasks
-//Start w = doTasks t w
-//where
-//     t = viewInformation [ViewUsing id progressBar] (Just 80, Just long) <<@ Title "bork"
-//     long = "borkueaohutenhuaostuehasunethuaosnuhtesuhaotsuehtausneohtusoauhtesauhtesnuhtasuhetauhosunehtoauesnhtaueshautesnhutaonsuhetaonsuhetansuhetansuhetaosnuehtaosnuhetaosunhaoetsunehatounsoehtasunhteunaoshuteoasnuhteaosuhnaoetsnuheotasunehotasunhetusnahotueaou"
-
-
-import iTasks
-
-:: R = { x :: !String, y :: !String }
-derive class iTask R
-
-Start w = doTasks (t -&&- u) w
-
-t = updateSharedInformation
-       [ UpdateSharedAs
-               (\r -> r.x)
-               (\r x -> {r & x=x})
-               const
-       ] s
-u = updateSharedInformation [] s
-
-s = sharedStore "x" {x="",y=""}
+
+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{|*|} []
+*/