News for hackers. Stuff that matters.
Re:The Y Combinator in Go with generics by dataangel on Sunday June 12, 2022 @10:27AM (#31714743)
Static types doesn't seem sufficient? Typed languages have no problem expressing passing functions as parameters. Where does it break when you apply static types?
Re:The Y Combinator in Go with generics by saghm on Sunday June 12, 2022 @10:40AM (#31714850)
I think it's because the y-combinator needs to be passed to itself as an argument, and it's hard to come up with a static type for a function where one of the parameters is the type itself.
Re:The Y Combinator in Go with generics by octachron on Sunday June 12, 2022 @11:04AM (#31715016)
The Y-combinator require (equi)recursive types for the intermediary step `x x` where `x` has type `('a -> 'b as 'a) -> 'b` using OCaml notation.