----------------------------------------------------------------------------- -- -- Module : Main -- Copyright : -- License : AllRightsReserved -- -- Maintainer : clintonmead@gmail.com -- Stability : -- Portability : -- -- | -- ----------------------------------------------------------------------------- {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE CPP #-} module Main ( main ) where import Control.GeneralisedFunctor.Functor (fmap, exoMap) import Prelude hiding (fmap) import qualified Prelude import Control.Category () checkFunctorRule0 x y = ((Prelude.fmap x) . (Prelude.fmap y)) `asTypeOf` (Prelude.fmap (x . y)) #if __GLASGOW_HASKELL__ >= 712 checkFunctorRule1 x y = ((fmap x) . (fmap y)) `asTypeOf` (fmap (x . y)) #endif checkFunctorRule2 x y = ((exoMap x) . (exoMap y)) `asTypeOf` (exoMap (x . y)) main :: IO () #if __GLASGOW_HASKELL__ >= 712 main = print (fmap (*3) (1,2)) #else main = print (fmap (*3) (1::Integer,2::Integer)) #endif