Re:Pointfree style in Python
by jerf on Monday November 14, 2011 @03:03PM
(#3235445)
I don't think a Haskeller should try to use point-free code. It's just that if you're refactoring your code and you get it down to the point that you've got
you might as well finish the job and take the x out. What's left should make sense to you if you follow this process and just let it happen. But I feel no shame when I can't go pointfree, especially when pointfree requires crazy hacks to simulate a simple pattern match.
[ Parent
| on HN ]
Sorry, but, aside from the obviously unimportant use of `in` (a reserved word), this gives a different type from what I think you meant:
x :: a
g :: a -> b -> c
in :: c -> d
th :: d -> e
thing :: a -> b -> e
and naïve eta-conversion will give you something that isn't well typed. Probably you meant thing x = th . in . g $ x