functor

Frank Atanassow franka@cs.uu.nl
Tue, 30 Oct 2001 09:25:23 +0100


Wolfgang Jeltsch wrote (on 29-10-01 23:43 +0100):
> you cannot use sections with types and (->). Furthermore the variable must 
> begin with a lowercase letter. So you have to write
>     instance Functor (->) a where.

Actually, you have to write:

  instance Functor ((->) a) where

since class Functor has arity *. This works because

  (->) a = (a ->)

The outer parentheses are only there to ensure that the expression gets parsed
as one argument, and not two.

-- 
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379