From 121788445628bb99079c65a622137f1d6b92e1bd Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 28 Dec 2014 04:41:52 +0100 Subject: replace tabs by spaces in Trammel String --- src/Trammel.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 -- cgit v1.2.3