Merge pull request #44 from Profpatsch/semiring-doc

Add documentation to Num instances.
This commit is contained in:
Gabriel Gonzalez 2015-05-03 17:48:35 -07:00
commit 7a3caa3f0a
2 changed files with 2 additions and 0 deletions

View file

@ -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))
(+) = (<|>)

View file

@ -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)