[Haskell-cafe] Type Directed Name Resolution

Dan Doel dan.doel at gmail.com
Wed Nov 10 17:12:22 EST 2010

On Wednesday 10 November 2010 1:37:41 pm Stephen Tetley wrote:
> Is it just me or does this bit in the proposal:
>   m .lookup key
>     .snd
>     .reverse
> Which translates to this:
>  reverse . snd . (\m -> lookup m key) $ m
> make no sense and refuse to type check - i.e lookup is producing a
> Maybe not a pair for second?

I think it is intended to be parsed as follows:

  ((m .(lookup key)) .snd) .reverse

So you get:

  reverse . snd . lookup key $ m

The intention is, I assume, strictly to be able to resolve names like lookup 
on arguments other than the first. But I suppose it potentially raises 
questions about what all expressions are allowed to be resolved in this way. 

  m .(\m' -> lookup key m')

valid? Or:

  m .(lookup key2 &&& lookup key2)

where we resolve two overloaded functions (the same one twice, here)?

The simplest answer is obviously, "no; only partially applied identifiers."

-- Dan

More information about the Haskell-Cafe mailing list