Created
April 4, 2013 18:43
-
-
Save kmicinski/5313004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data MonO | |
-- This is the type of arrows for the category of monoids. Note that | |
-- for a monoid, regarded as a category, there is a single object | |
-- (called MonO here). Arrows are formed by members of the monoid's | |
-- carrier, m. | |
data MonC a b where | |
M :: Monoid c => c -> MonC MonO MonO | |
instance Monoid m => Category MonC where | |
dom (M (_ :: m)) = M (mempty :: m) | |
cod (M (_ :: m)) = M (mempty :: m) | |
(M a) ∘ (M b) = M ((mappend a b) :: m) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment