summaryrefslogtreecommitdiffstats
path: root/src/Hack
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hack')
-rw-r--r--src/Hack/Buffer/Extra.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Hack/Buffer/Extra.hs b/src/Hack/Buffer/Extra.hs
new file mode 100644
index 0000000..999703c
--- /dev/null
+++ b/src/Hack/Buffer/Extra.hs
@@ -0,0 +1,10 @@
+module Hack.Buffer.Extra where
+
+import Hack.Buffer (Buffer)
+
+
+length :: Buffer -> Int
+length (ls, rs) = Prelude.length ls + Prelude.length rs
+
+insertChar :: Char -> Buffer -> Buffer
+insertChar c (ls, rs) = (ls <> [c], rs)