From b242f02f23270695ce472708ec5cca5c4e3fb6bc Mon Sep 17 00:00:00 2001 From: "Malcolm.Wallace@cs.york.ac.uk" Date: Fri, 9 Oct 2009 13:48:21 +0000 Subject: [PATCH] Make Data.Functor compatible with non-GHC compilers. --- Data/Functor.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Data/Functor.hs b/Data/Functor.hs index c3e36fd..e5b8166 100644 --- a/Data/Functor.hs +++ b/Data/Functor.hs @@ -13,12 +13,16 @@ module Data.Functor ( - Functor(fmap, (<$)), + Functor(fmap), + (<$), (<$>), ) where #ifdef __GLASGOW_HASKELL__ import GHC.Base (Functor(..)) +#else +(<$) :: Functor f => a -> f b -> f a +(<$) = fmap . const #endif infixl 4 <$> -- 1.7.10.4