Created
November 9, 2012 01:40
-
-
Save khibino/4043177 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 #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Prelude hiding (id, (.)) | |
import Control.Category (Category(..)) | |
import Data.Monoid (Monoid(..)) | |
newtype F a b = F (a -> b) deriving Category | |
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