Make MdToken a Semigroup and a Monoid, so that I can use 'mempty' for
it.
This commit is contained in:
@@ -60,6 +60,12 @@ instance Show MdToken where
|
|||||||
show (Strikethrough token) = "<s>" ++ show token ++ "</s>"
|
show (Strikethrough token) = "<s>" ++ show token ++ "</s>"
|
||||||
show (Unit unit) = printf "%s" unit
|
show (Unit unit) = printf "%s" unit
|
||||||
|
|
||||||
|
instance Semigroup MdToken where
|
||||||
|
a <> b = Document [a, b]
|
||||||
|
|
||||||
|
instance Monoid MdToken where
|
||||||
|
mempty = Unit ""
|
||||||
|
|
||||||
-- ---------------
|
-- ---------------
|
||||||
-- Helpers
|
-- Helpers
|
||||||
leftmostLongest :: (Foldable t) => [(a, t b)] -> (a, t b)
|
leftmostLongest :: (Foldable t) => [(a, t b)] -> (a, t b)
|
||||||
|
Reference in New Issue
Block a user