the constant functor

Koen Claessen koen@cs.chalmers.se
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:koen@cs.chalmers.se
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden