diff options
Diffstat (limited to 'ABC/Misc.icl')
-rw-r--r-- | ABC/Misc.icl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ABC/Misc.icl b/ABC/Misc.icl new file mode 100644 index 0000000..15e5b9d --- /dev/null +++ b/ABC/Misc.icl @@ -0,0 +1,17 @@ +implementation module ABC.Misc + +import StdEnv + +abortn :: String -> a +abortn s = abort (s +++ "\n") + +(<+) infixl 5 :: a b -> String | toString a & toString b +(<+) a b = toString a +++ toString b + +(<++) infixl 5 :: a (g, [b]) -> String | toString a & toString b & toString g +(<++) a (g,xs) = a <+ printersperse g xs + +printersperse :: a [b] -> String | toString a & toString b +printersperse g [] = "" +printersperse g [x] = toString x +printersperse g [x:xs] = x <+ g <++ (g, xs) |