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-language
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
brokenix (brokenix@emacs.ch)'s status on Monday, 04-Mar-2024 23:57:07 JSTbrokenix