Merge pull request #44 from Profpatsch/semiring-doc
Add documentation to Num instances.
This commit is contained in:
commit
7a3caa3f0a
2 changed files with 2 additions and 0 deletions
|
@ -118,6 +118,7 @@ instance Monoid a => Monoid (Pattern a) where
|
|||
mempty = pure mempty
|
||||
mappend = liftA2 mappend
|
||||
|
||||
-- | Pattern forms a semiring, this is the closest approximation
|
||||
instance Monoid a => Num (Pattern a) where
|
||||
fromInteger n = Pattern (lift (replicate (fromInteger n) mempty))
|
||||
(+) = (<|>)
|
||||
|
|
|
@ -140,6 +140,7 @@ instance Monoid a => Monoid (Shell a) where
|
|||
mempty = pure mempty
|
||||
mappend = liftA2 mappend
|
||||
|
||||
-- | Shell forms a semiring, this is the closest approximation
|
||||
instance Monoid a => Num (Shell a) where
|
||||
fromInteger n = select (replicate (fromInteger n) mempty)
|
||||
|
||||
|
|
Loading…
Reference in a new issue