diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/src/Thermoprint/Printout.hs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/src/Thermoprint/Printout.hs b/spec/src/Thermoprint/Printout.hs index 23e950a..c96573e 100644 --- a/spec/src/Thermoprint/Printout.hs +++ b/spec/src/Thermoprint/Printout.hs | |||
@@ -83,8 +83,12 @@ instance Monoid Block where | |||
83 | | Seq.null xs = y | 83 | | Seq.null xs = y |
84 | | Seq.null ys = x | 84 | | Seq.null ys = x |
85 | | otherwise = NewlSep (xs <> ys) | 85 | | otherwise = NewlSep (xs <> ys) |
86 | (NewlSep xs) `mappend` y = NewlSep (xs |> y) | 86 | (NewlSep xs) `mappend` y |
87 | x `mappend` (NewlSep ys) = NewlSep (x <| ys) | 87 | | Seq.null xs = y |
88 | | otherwise = NewlSep (xs |> y) | ||
89 | x `mappend` (NewlSep ys) | ||
90 | | Seq.null ys = x | ||
91 | | otherwise = NewlSep (x <| ys) | ||
88 | x `mappend` y = NewlSep $ Seq.fromList [x, y] | 92 | x `mappend` y = NewlSep $ Seq.fromList [x, y] |
89 | 93 | ||
90 | instance Monoid Line where | 94 | instance Monoid Line where |
@@ -93,8 +97,12 @@ instance Monoid Line where | |||
93 | | Seq.null xs = y | 97 | | Seq.null xs = y |
94 | | Seq.null ys = x | 98 | | Seq.null ys = x |
95 | | otherwise = SpaceSep (xs <> ys) | 99 | | otherwise = SpaceSep (xs <> ys) |
96 | (SpaceSep xs) `mappend` y = SpaceSep (xs |> y) | 100 | (SpaceSep xs) `mappend` y |
97 | x `mappend` (SpaceSep ys) = SpaceSep (x <| ys) | 101 | | Seq.null xs = y |
102 | | otherwise = SpaceSep (xs |> y) | ||
103 | x `mappend` (SpaceSep ys) | ||
104 | | Seq.null ys = x | ||
105 | | otherwise = SpaceSep (x <| ys) | ||
98 | x `mappend` y = SpaceSep $ Seq.fromList [x, y] | 106 | x `mappend` y = SpaceSep $ Seq.fromList [x, y] |
99 | 107 | ||
100 | 108 | ||