Created
November 9, 2012 01:58
-
-
Save khibino/4043248 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
{-# LANGUAGE FlexibleInstances #-} | |
import Prelude hiding (id, (.)) | |
import qualified Prelude | |
import Control.Category (Category(..)) | |
import Data.Monoid (Monoid(..)) | |
newtype F a b = F (a -> b) | |
instance Category F where | |
id = F Prelude.id | |
F f . F g = F (f Prelude.. g) | |
instance Monoid (F a a) where | |
mempty = id | |
mappend = (.) | |
type Endo a = F a a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment