[Ack, missed the reply-all button...]

This was part of my motivation behind the 'removing polymorphism from Functor' 
thing... to select a different parameter we'd essentially need type-level 
lambdas... I'll use 'Λ' (capital lambda) for it:

 instance Functor (Λ a. X a b) where
     fmap f (X a b) = X (f a) b

We don't have these [1], but we *do* have type families, which are kind of like 
type-level lambdas turned 'inside out' (at least to my eyes), so my idea was to 
separate this out:

 type family Point :: *
 type instance Point (X a b) = a

 class Functor f where
     fmap :: (Point f -> Point f) -> f -> f

Here I began to run into problems which are a bit irrelevant to this discussion 
:)

[1]: I'm not sure of the exact connection, but see, e.g. Oleg's construction of 
computation at the type level (http://okmij.org/ftp/Haskell/TypeLC.lhs), wherein he notes 
the "primary role of type application rather than that of abstraction".

- George

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to