diff options
author | Camil Staps | 2016-07-01 19:37:38 +0200 |
---|---|---|
committer | Camil Staps | 2016-07-01 19:37:38 +0200 |
commit | b3f1e3ff0404a5182b6eed2d88014b4b4fbd69c2 (patch) | |
tree | c2dbd5b0a43fffc6119510bdc2f5324aa3a0e3b5 /ABC/Misc.icl | |
parent | Assembler (diff) |
Moved to directory, added test program
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) |