Better HN
topnewbestaskshowjobs
Log inSign up

kawyut

5 karma · joined Nov 25, 2017 (9y ago) · 3 submissions

Submissions

comment 9y ago · link · parent

> In functional programming, though, this is not the case.

That's an artifact of the language, not inherent to functional programming.

(I had a longer response in mind, might write it up later when I get time.)

comment 9y ago · link · parent

I've read a fair bit about functional programming but the right-associative nesting of -> still bothers me.

(first precondition IMPLIES (second precondition IMPLIES (implication))

is inherently harder for me to understand than

(first precondition AND second precondition) IMPLIES implication

even though logically they are the same. The first version carries more mental overhead because it seems to indicate that there is some sort of hierarchy/assymetry to the two preconditions.

It's the same thing when I try to read a Haskell function type signature:

f :: a -> b -> c

f is a function taking a and returning (a function taking b and returning (c))

vs.

f is a function taking two parameters a and b and returning c

There is no hierarchy anyhow because the parameters can be swapped:

f' = \b a -> f a b

Curious to know if it's just me or there are others who experience the same.