[Haskell-cafe] Some thoughts on Type-Directed Name Resolution

wren ng thornton wren at freegeek.org
Fri Feb 3 21:56:46 CET 2012


On 2/3/12 6:13 AM, Gábor Lehel wrote:
> The first problem is that mixing prefix and postfix function
> application within the same line makes it harder to read. When you
> read code to try to understand what it does, the direction you like to
> go in is "here's some object, first do this to it, then do that to it,
> then do this other thing to it, then this fourth thing to produce the
> final result". In Haskell code with prefix application, this is easy:
> you read it from right to left. In OO-style code using dots, it's even
> easier: you read it from left to right. But if you mix the two, it's
> much harder than either: you first have to figure out where the
> sentence even begins, which is going to be somewhere in the middle,
> and then every time the expression switches between prefix and
> postfix, you have to figure out where to continue reading. The
> algorithm your brain needs to follow is a lot branchier, so to speak.

It's just as easy as reading function pointers in C :)

-- 
Live well,
~wren







More information about the Haskell-Cafe mailing list