diff options
Diffstat (limited to 'src/Blessings.hs')
| -rw-r--r-- | src/Blessings.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Blessings.hs b/src/Blessings.hs index 9602bf4..ebf14e2 100644 --- a/src/Blessings.hs +++ b/src/Blessings.hs @@ -433,6 +433,20 @@ instance (Eq a, Blessable a) => Blessable (Blessings a) where Empty -> (Empty, Empty) + break p = \case + Append t1 t2 -> + both normalizeHead $ + case Bless.break p t1 of + (t1l, t1r) + | t1r == mempty -> first (t1l<>) $ Bless.break p t2 + | otherwise -> (t1l, t1r <> t2) + Plain s -> + both (normalizeHead . Plain) $ Bless.break p s + SGR pm t -> + both (normalizeHead . SGR pm) $ Bless.break p t + Empty -> + (Empty, Empty) + intercalate i = \case [] -> mempty [t] -> t |
