@brokenix No need for Y Combinator. Indeed.
Conversation
Notices
-
Embed this notice
see shy jo (joeyh@hachyderm.io)'s status on Monday, 04-Mar-2024 23:57:05 JST see shy jo - Haelwenn /элвэн/ :triskell: likes this.
-
Embed this notice
brokenix (brokenix@emacs.ch)'s status on Monday, 04-Mar-2024 23:57:07 JST brokenix fixpoint combinators like Y can't be well-typed in #Haskell. Specifically, something of the form x x requires x to have two conflicting types simultaneously. In dynamic languages, this doesn't matter because you just don't care what the type is, only that you can use the value in some way. But a Haskell compiler does care. However there's no need for such combinators, because Haskell's solution fix f = let x = f x in x is more elegant anyway, and has no typing difficulties (but does require lazy evaluation).
#javascript is perhaps not the best launchpad to haskell , to their credit they make good fp presentations
https://stackoverflow.com/questions/68975627/translating-a-fixed-point-operator-to-haskell-languageHaelwenn /элвэн/ :triskell: repeated this.