the constant functor

Koen Claessen [email protected]
Tue, 27 Mar 2001 11:42:15 +0200 (MET DST)


(moved reply to haskell-cafe)

Hi Tobias,

 |   data ConstInt a = Const Int
 |
 | Any ideas how to make 'ConstInt' an instance of class
 | Functor?

What is wrong with:

  class Functor ConstInt where
    map f (Const n) = Const n

?

/Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424      mailto:[email protected]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden