summaryrefslogtreecommitdiff
path: root/assignment-13/uFPL/Util.dcl
diff options
context:
space:
mode:
authorCamil Staps2018-01-03 09:24:21 +0100
committerCamil Staps2018-01-03 09:24:21 +0100
commit33db1946d2a09898761b7d397fe4028725f2215b (patch)
tree1f68cb8b276b7a20f42f325c76e6d4853ea8e68f /assignment-13/uFPL/Util.dcl
parentCleanup (diff)
Rename & restructure
Diffstat (limited to 'assignment-13/uFPL/Util.dcl')
-rw-r--r--assignment-13/uFPL/Util.dcl20
1 files changed, 20 insertions, 0 deletions
diff --git a/assignment-13/uFPL/Util.dcl b/assignment-13/uFPL/Util.dcl
new file mode 100644
index 0000000..0370fc9
--- /dev/null
+++ b/assignment-13/uFPL/Util.dcl
@@ -0,0 +1,20 @@
+definition module uFPL.Util
+
+:: PrState =
+ { indent :: Int
+ , output :: [String]
+ }
+
+class print a :: a -> PrState -> PrState
+
+printToString :: a -> String | print a
+
+instance print (PrState -> PrState)
+instance print String
+instance print Int
+
+nl :: PrState -> PrState
+indent :: PrState -> PrState
+unindent :: PrState -> PrState
+
+prsperse :: a [b] -> PrState -> PrState | print a & print b