[ create a new paste ] login | about

Link: http://codepad.org/VdGgAakp    [ raw code | fork ]

Haskell, pasted on Feb 20:
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE ConstraintKinds, TypeFamilies #-}

import qualified Data.Set as S
import GHC.Exts

class RFunctor f where
    type RFunctorCtx f a :: Constraint
    type RFunctorCtx f a = ()
    rfmap :: (RFunctorCtx f a, RFunctorCtx f b) => (a -> b) -> f a -> f b

instance RFunctor S.Set where
    type RFunctorCtx S.Set a = Ord a
    rfmap = S.map


Create a new paste based on this one


Comments: