I'm not sure if my terminology is correct or even if my question makes sense, but I can create "instances" of Maybe, List, IO, and Either. Prelude Data.Either> let m = Just 7 Prelude Data.Either> :t m m :: Maybe Integer Prelude Data.Either> let l = 2:[] Prelude Data.Either> :t l l :: [Integer] Prelude Data.Either> let g = getLine Prelude Data.Either> :t g g :: IO String Prelude Data.Either> let e = Right "abc" Prelude Data.Either> :t e e :: Either a [Char] All these instances are functors, each with its own version of fmap that can be applied to it. How can I similarly create an instance of (->) so I can apply (->)'s version of fmap instance Functor ((->) r) where fmap f g = (\x -> f (g x)) to it? Michael --- On Tue, 8/31/10, Vo Minh Thu <noteed@gmail.com> wrote:
|