
Since operators are allowed in type and class names, I think it would make sense if the section notation was also allowed. In particular the Reader monad would be a little bit nicer:
instance Monad (e ->) where ... And maybe type level programming can benefit as well.
Twan

On Mon, Dec 11, 2006 at 12:40:33AM +0100, Twan van Laarhoven wrote:
Since operators are allowed in type and class names, I think it would make sense if the section notation was also allowed. In particular the Reader monad would be a little bit nicer:
instance Monad (e ->) where ... And maybe type level programming can benefit as well.
I wonder about (-> e) - by analogy to expression sections it could be desugared to a type-level lambda. AFAIU, type-level lambdas are avoided when you want terminating type-checking. IIUC, you have an equivalent power if you turn on certain GHC's extensions. Perhaps with those extensions we could have type-level lambdas too? Or we have them already, somehow disguised? Please tell me, if I am talking nonsense. Best regards Tomasz

I wonder about (-> e) - by analogy to expression sections it could be desugared to a type-level lambda. AFAIU, type-level lambdas are avoided when you want terminating type-checking. IIUC, you have an equivalent power if you turn on certain GHC's extensions. Perhaps with those extensions we could have type-level lambdas too? Or we have them already, somehow disguised?
You're right. Type sections are problematic, because if partially applied, they'd require type-level lambda. Type lambda is definitely not going to be in Haskell', and I'm not in favour of adding some crippled form of type sections that must always be fully applied. Cheers, Andres
participants (3)
-
Andres Loeh
-
Tomasz Zielonka
-
Twan van Laarhoven