Skip to content

Instantly share code, notes, and snippets.

@laserpants
Created February 1, 2018 10:14
Show Gist options
  • Save laserpants/4e9eb0f0ea09608c767631aacd4f366d to your computer and use it in GitHub Desktop.
Save laserpants/4e9eb0f0ea09608c767631aacd4f366d to your computer and use it in GitHub Desktop.
Haskell category
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UnicodeSyntax #-}
module Category where
class Category (c :: k -> k -> *) where
id :: c x x
(.) :: c y z -> c x y -> c x z
instance Category (->) where
id = Prelude.id
f . g = f Prelude.. g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment