exon-0.1.0.0: lib/Exon/Data/Result.hs
-- |Description: Internal
module Exon.Data.Result where
-- |The combined segments, either empty or a value.
data Result a =
Empty
|
Result a
deriving (Eq, Show, Foldable)
instance Semigroup a => Semigroup (Result a) where
(<>) Empty a = a
(<>) a Empty = a
(<>) (Result l) (Result r) = Result (l <> r)
instance Monoid a => Monoid (Result a) where
mempty =
Result mempty