Skip to content

Instantly share code, notes, and snippets.

Last active Dec 29, 2015
What would you like to do?
ConstraintKinds, Functor, Set
-- |
{-# LANGUAGE ConstraintKinds, TypeFamilies #-}
import Prelude hiding (Functor(..))
import Data.Set (Set)
import qualified Data.Set as Set
import GHC.Exts (Constraint)
class Functor f where
type Object f a :: Constraint
type Object f a = ()
fmap :: (Object f a, Object f b) => (a -> b) -> f a -> f b
instance Functor Set where
type Object Set a = Ord a
fmap =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment