diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Blessings.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Blessings.hs b/src/Blessings.hs index 3c6b94f..21fe3d8 100644 --- a/src/Blessings.hs +++ b/src/Blessings.hs @@ -20,6 +20,14 @@ data Blessings a deriving (Eq, Show) +instance Foldable Blessings where + foldMap f = \case + Append t1 t2 -> foldMap f t1 <> foldMap f t2 + Plain s -> f s + SGR _ t -> foldMap f t + Empty -> mempty + + instance Functor Blessings where fmap f = \case Append t1 t2 -> Append (fmap f t1) (fmap f t2) |