News for hackers. Stuff that matters.
Re:Löb and möb: strange loops in Haskell by whateveracct on Monday January 30, 2023 @11:04AM (#34581535)
Stacking dollar signs is elegant to me

    f
  $ g
  $ h
  $ some expression etc
Re:Löb and möb: strange loops in Haskell by bmacho on Monday January 30, 2023 @12:39PM (#34583406)
If I'm not mistaken, it reads from bottom to top. I hated the function application direction my whole life, even in math (I read and write from left to right, so f applied to x should be x f), but it is ridiculously bad in Haskell.
Re:Löb and möb: strange loops in Haskell by whateveracct on Monday January 30, 2023 @01:04PM (#34583802)
I prefer it, personally. Especially when pointfree. Way easier for me to read at a glance.
Re:Löb and möb: strange loops in Haskell by azurelake on Monday January 30, 2023 @03:49PM (#34586175)
You can use `>>>` from `Control.Arrow` to switch the order if you don't mind make your code more esoteric.
Re:Löb and möb: strange loops in Haskell by whateveracct on Monday January 30, 2023 @03:56PM (#34586260)
Control.Arrow is in base at least :)
Re:Löb and möb: strange loops in Haskell by nimih on Monday January 30, 2023 @05:10PM (#34587174)
The & operator in Data.Function--which is just flipped $ with slightly higher, but still very low, operator precedence--at least gives you a way to deal with this in base; it's unfortunate it isn't more widely used in tutorials and example code (at least from what I've seen).