Skip to content

Instantly share code, notes, and snippets.

@Risto-Stevcev
Created March 13, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Risto-Stevcev/576bfe136498fb1f43a8e86839ce851e to your computer and use it in GitHub Desktop.
Save Risto-Stevcev/576bfe136498fb1f43a8e86839ce851e to your computer and use it in GitHub Desktop.
Is everything just a monoid in the category of something?
(.) :: (b -> c) -> (a -> b) -> (a -> c) -- functions
(.) :: cat b c -> cat a b -> cat a c -- categories
(++) :: String -> String -> String -- strings
(<>) :: a -> a -> a -- monoids
(<>) :: cat a a -> cat a a -> a a -- categories
(++) :: [a] -> [a] -> [a] -- lists
(<|>) :: f a -> f a -> f a -- alternatives
(<|>) :: cat a a -> cat a a -> a a -- categories
(<=<) :: (b -> m c) -> (a -> m b) -> (a -> m c) -- monads
(<=<) :: cat b c -> cat a b -> cat a c -- categories
-- applicatives???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment