summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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