aboutsummaryrefslogtreecommitdiff
path: root/Misc.icl
diff options
context:
space:
mode:
authorCamil Staps2016-07-01 09:11:02 +0200
committerCamil Staps2016-07-01 09:11:02 +0200
commit55e6cadc298beda9d079d99147b3cb0f50ce25ec (patch)
treedd28e78845843d2dff7d2b3daa2b60f5520e8b7e /Misc.icl
parentFixes (diff)
Printing
Diffstat (limited to 'Misc.icl')
-rw-r--r--Misc.icl11
1 files changed, 11 insertions, 0 deletions
diff --git a/Misc.icl b/Misc.icl
index 034ce9d..15e5b9d 100644
--- a/Misc.icl
+++ b/Misc.icl
@@ -4,3 +4,14 @@ 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)