[Haskell] Mixing monadic and non-monadic functions

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Sat Sep 17 07:19:28 EDT 2005

Bjorn Lisper wrote:
> However, there is a way to resolve the ambiguity that can be claimed to be
> the most natural one, and that is to always choose the "least possible"
> lifting. In the example above, this would mean to interpret [[1]]++[[2]]
> precisely as [[1]]++[[2]] (lift 0 levels) rather than [[1]++[2]] (lift 1
> level).

It's not the mathematics I'm worried about, it's the people. Consider the 
"time flies like an arrow; fruit flies like a banana" example. What's 
interesting about it is not just the existence of more than one parse, but 
the fact that it's hard to even notice the other parses exist unless you're 
looking for them, because people are so good at unconsciously resolving this 
kind of ambiguity from context.

I'm afraid that once people get used to the idea that they can write
xs `op` ys and get implicit lifting, they will write xs ++ ys and never 
notice that it has an unlifted interpretation which will take precedence. 
This isn't the nastiest class of bug, but it's pretty nasty.

-- Ben

More information about the Haskell mailing list