From: Mart Lubbers Date: Fri, 13 Jul 2018 09:09:25 +0000 (+0200) Subject: bork X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=b2a4b7c5c620e9d85bda8afa1c5e804ee98ffd89;p=clean-tests.git bork --- diff --git a/eadt/export/B.dcl b/eadt/export/B.dcl new file mode 100644 index 0000000..54f201a --- /dev/null +++ b/eadt/export/B.dcl @@ -0,0 +1,6 @@ +definition module B + +import main + +B :: T +isB :: T -> Bool diff --git a/eadt/export/B.icl b/eadt/export/B.icl new file mode 100644 index 0000000..4884d2a --- /dev/null +++ b/eadt/export/B.icl @@ -0,0 +1,12 @@ +implementation module B + +import main + +:: T | E + +B :: T +B = E + +isB :: T -> Bool +isB E = True +isB _ = False diff --git a/eadt/export/C.dcl b/eadt/export/C.dcl new file mode 100644 index 0000000..63e907c --- /dev/null +++ b/eadt/export/C.dcl @@ -0,0 +1,6 @@ +definition module C + +import main + +C :: T +isC :: T -> Bool diff --git a/eadt/export/C.icl b/eadt/export/C.icl new file mode 100644 index 0000000..20d1891 --- /dev/null +++ b/eadt/export/C.icl @@ -0,0 +1,12 @@ +implementation module C + +import main + +:: T | E + +C :: T +C = E + +isC :: T -> Bool +isC E = True +isC _ = False diff --git a/eadt/export/main.dcl b/eadt/export/main.dcl new file mode 100644 index 0000000..399e7ad --- /dev/null +++ b/eadt/export/main.dcl @@ -0,0 +1,3 @@ +definition module main + +:: T = A | .. diff --git a/eadt/export/main.icl b/eadt/export/main.icl new file mode 100644 index 0000000..76f171c --- /dev/null +++ b/eadt/export/main.icl @@ -0,0 +1,5 @@ +implementation module main + +import B, C + +Start = isB C diff --git a/fun/test.icl b/fun/test.icl new file mode 100644 index 0000000..d2d97a7 --- /dev/null +++ b/fun/test.icl @@ -0,0 +1,21 @@ +module test + +import StdEnv + +Start = fun 42 [0, 1, 2, 42] + +(oo) infixr 9 :: ((a -> b) (c d -> a) c d -> b) +(oo) = (o) o (o) + +(ooo) infixr 9 :: ((a -> b) (c d e -> a) c d e -> b) +(ooo) = (o) o (o) o (o) + +(oooo) infixr 9 :: ((a -> b) (c d e -> a) c d e -> b) +(oooo) = (o) o (o) o (o) o (o) + +//(on) infixr 9// :: (a -> b) -> (c -> a) c -> b) +//(on) n = fold [(o) = (o) +//(on) n = (o) o ((on) (n-1)) + +//fun = fmap not isMember +fun = fmap (fmap not) isMember diff --git a/geditor-arity/Makefile b/geditor-arity/Makefile new file mode 100644 index 0000000..83f7745 --- /dev/null +++ b/geditor-arity/Makefile @@ -0,0 +1,4 @@ +all: + mkdir -p Clean\ System\ Files + gcc -c test.c -o test.o + clm -l test.o -dynamics -IL Dynamics test -o test diff --git a/geditor-arity/test.icl b/geditor-arity/test.icl new file mode 100644 index 0000000..fe49b18 --- /dev/null +++ b/geditor-arity/test.icl @@ -0,0 +1,16 @@ +module test + +import iTasks + +Start w = startEngine (treturn 42) w + +derive gEditor Set +derive gDefault Set + +t :: Editor (Set Int) +t = gEditor{|*->*|} + slider + gText{|*|} + gDefault{|*|} + JSONEncode{|*|} + JSONDecode{|*|} diff --git a/json-eq-string/test.icl b/json-eq-string/test.icl new file mode 100644 index 0000000..5028d34 --- /dev/null +++ b/json-eq-string/test.icl @@ -0,0 +1,11 @@ +module test + +from Text.GenJSON import generic JSONEncode, generic JSONDecode, :: JSONNode +from Data.Maybe import :: Maybe + +:: T = T String + +derive JSONEncode T +derive JSONDecode T + +Start = 42 diff --git a/macros/test.log b/macros/test.log new file mode 100644 index 0000000..5aad3dd --- /dev/null +++ b/macros/test.log @@ -0,0 +1,35 @@ +This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=pdflatex 2018.6.6) 10 JUL 2018 07:48 +entering extended mode + restricted \write18 enabled. + %&-line parsing enabled. +**test.icl +(./test.icl +LaTeX2e <2018-04-01> patch level 5 + +! LaTeX Error: Missing \begin{document}. + +See the LaTeX manual or LaTeX Companion for explanation. +Type H for immediate help. + ... + +l.1 m + odule test +? +! Emergency stop. + ... + +l.1 m + odule test +You're in trouble here. Try typing to proceed. +If that doesn't work, type X to quit. + + +Here is how much of TeX's memory you used: + 7 strings out of 494587 + 252 string characters out of 6177827 + 51857 words of memory out of 5000000 + 3741 multiletter control sequences out of 15000+600000 + 3640 words of font info for 14 fonts, out of 8000000 for 9000 + 14 hyphenation exceptions out of 8191 + 5i,0n,4p,22b,14s stack positions out of 5000i,500n,10000p,200000b,80000s +! ==> Fatal error occurred, no output PDF file produced! diff --git a/new-layouts/test.icl b/new-layouts/test.icl index 7718e4b..d1b288b 100644 --- a/new-layouts/test.icl +++ b/new-layouts/test.icl @@ -2,22 +2,12 @@ module test import iTasks -Start w = startEngine (t1 -|| t2 -|| t3 -|| t4) w +Start w = startEngine (viewInformation () [] v) w -:: Field = {field :: String} -:: Type1 = {fields :: [Field]} -:: Type2 = Type Int [Field] -:: Type3 :== [Field] -derive class iTask Field, Type1, Type2 +derive class iTask B, C -t1 :: Task Type1 -t1 = enterInformation () [] +v :: B +v = B2 C2 -t2 :: Task Type2 -t2 = enterInformation () [] - -t3 :: Task Type3 -t3 = enterInformation () [] - -t4 :: Task (Type2, Type3) -t4 = enterInformation () [] +:: B = B1 | B2 C +:: C = C1 Int | C2 diff --git a/newtype-editor/Makefile b/newtype-editor/Makefile new file mode 100644 index 0000000..83f7745 --- /dev/null +++ b/newtype-editor/Makefile @@ -0,0 +1,4 @@ +all: + mkdir -p Clean\ System\ Files + gcc -c test.c -o test.o + clm -l test.o -dynamics -IL Dynamics test -o test diff --git a/newtype-editor/test.icl b/newtype-editor/test.icl new file mode 100644 index 0000000..8208eb5 --- /dev/null +++ b/newtype-editor/test.icl @@ -0,0 +1,15 @@ +module test + +import iTasks + +derive class iTask T1 + +:: T1 = + { f1 :: Bool + , f2 :: Bool + } + +Start w = startEngine t w + +t :: Task (Maybe T1) +t = enterInformation () [] diff --git a/polycurry/test.icl b/polycurry/test.icl new file mode 100644 index 0000000..3069560 --- /dev/null +++ b/polycurry/test.icl @@ -0,0 +1,15 @@ +module test + +import StdMisc + +:: T a = T a + +class c a v :: a -> v Int +instance c a T where c a = T 42 + +//fun :: v Int | c a v +fun :: v Int | c Bool v +fun = c True + +Start :: T Int +Start = fun diff --git a/polymorph-eadt/ext.dcl b/polymorph-eadt/ext.dcl new file mode 100644 index 0000000..83f20f8 --- /dev/null +++ b/polymorph-eadt/ext.dcl @@ -0,0 +1,6 @@ +definition module ext + +import main + +:: Poly | Ext +//:: Poly a | Ext a diff --git a/polymorph-eadt/ext.icl b/polymorph-eadt/ext.icl new file mode 100644 index 0000000..51493f0 --- /dev/null +++ b/polymorph-eadt/ext.icl @@ -0,0 +1,3 @@ +implementation module ext + + diff --git a/polymorph-eadt/main.dcl b/polymorph-eadt/main.dcl new file mode 100644 index 0000000..3984958 --- /dev/null +++ b/polymorph-eadt/main.dcl @@ -0,0 +1,3 @@ +definition module main + +:: Poly a = Poly a | .. diff --git a/polymorph-eadt/main.icl b/polymorph-eadt/main.icl new file mode 100644 index 0000000..12cefd7 --- /dev/null +++ b/polymorph-eadt/main.icl @@ -0,0 +1,3 @@ +implementation module main + +Start = 42 diff --git a/qualified_hidden/test.icl b/qualified_hidden/test.icl new file mode 100644 index 0000000..dc17a18 --- /dev/null +++ b/qualified_hidden/test.icl @@ -0,0 +1,6 @@ +module test + +import Data.Maybe => qualified :: Maybe + +Start = 4 + diff --git a/stimer/Makefile b/stimer/Makefile new file mode 100644 index 0000000..83f7745 --- /dev/null +++ b/stimer/Makefile @@ -0,0 +1,4 @@ +all: + mkdir -p Clean\ System\ Files + gcc -c test.c -o test.o + clm -l test.o -dynamics -IL Dynamics test -o test diff --git a/stimer/test.icl b/stimer/test.icl new file mode 100644 index 0000000..3bc5d32 --- /dev/null +++ b/stimer/test.icl @@ -0,0 +1,29 @@ +module test + +import StdFunc => qualified return +import Data.Func +import System.Time +import iTasks +import iTasks.Internal.IWorld + +Start w = flip startEngine w + $ foreverSt 0 \i-> + waitForSTimer 0.1 + -|| viewInformation () [] (toString i +++ "th waitForSTimer") + >>| treturn (i+1) + +waitForSTimer :: Real -> Task () +waitForSTimer secondsToWait += get currentTimespec + >>= \ts->watch (sdsFocus {start=ts,interval=realToTs secondsToWait} iworldTimespec) + >>* [OnValue (ifValue (\t->t > ts+realToTs secondsToWait) \_->treturn ())] +where + realToTs :: Real -> Timespec + realToTs t = + {tv_sec = floor t + ,tv_nsec = toInt $ (t - toReal (floor t)) * 1E9 + } + floor :: Real -> Int + floor x + | toReal (toInt x) == x = (toInt x) + | otherwise = toInt (x - 0.5)