summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-12-28 04:41:52 +0100
committertv <tv@shackspace.de>2015-10-17 01:50:15 +0200
commit121788445628bb99079c65a622137f1d6b92e1bd (patch)
tree9085df93b492aff700835ad100b21c1bbfac395c
parent3c0ed789dfa6b67a7853da0f2ea744a70c528d3a (diff)
replace tabs by spaces in Trammel String
-rw-r--r--src/Trammel.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Trammel.hs b/src/Trammel.hs
index bd3cd32..d83b846 100644
--- a/src/Trammel.hs
+++ b/src/Trammel.hs
@@ -24,6 +24,14 @@ data Trammel a
deriving (Eq, Show)
+instance Functor Trammel where
+ fmap f = \case
+ Append t1 t2 -> Append (fmap f t1) (fmap f t2)
+ Plain s -> Plain (f s)
+ SGR pm t -> SGR pm (fmap f t)
+ Empty -> Empty
+
+
instance Monoid (Trammel a) where
mappend = Append
mempty = Empty