Newest at the top
2025-05-12 05:53:03 +0200 | <EvanR> | does the by value version need a different evaluation strategy |
2025-05-12 05:52:27 +0200 | <EvanR> | ok but the point of a fix construct is so you don't have to munge these nuts combinators, and so they can have a type |
2025-05-12 05:50:41 +0200 | <monochrom> | It is correct. :) |
2025-05-12 05:50:26 +0200 | <EvanR> | I probably messed up |
2025-05-12 05:50:16 +0200 | <EvanR> | \f -> (\t -> t t) (\x -> f (\v -> (x x v))) |
2025-05-12 05:49:03 +0200 | <ski> | yea, i prefer adding in `(\t -> t t)' for the first part, no need to repeat something longer |
2025-05-12 05:48:04 +0200 | <EvanR> | but yours is more explainable |
2025-05-12 05:47:42 +0200 | <EvanR> | I found this on some page Z = \f -> (\x -> (f (\v -> (x x v)))) (\x -> (f (\v -> (x x v)))) |
2025-05-12 05:47:33 +0200 | michalz | (~michalz@185.246.207.203) |
2025-05-12 05:47:01 +0200 | <monochrom> | So it is missing out on fix (0 :) = 0 : 0 : ... but it's OK, call-by-value languages don't have lazy lists in the first place. :) |
2025-05-12 05:45:43 +0200 | <monochrom> | Y is (\t -> t t) (\t -> f (t t)). For call-by-value languages we eta expand to (\t x -> f (t t) x) so one more argument is needed for evaluation so there is the delay I said we need. |
2025-05-12 05:44:51 +0200 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
2025-05-12 05:44:20 +0200 | <ski> | (note the eta-expansion) |
2025-05-12 05:43:00 +0200 | <EvanR> | I see |
2025-05-12 05:42:06 +0200 | <ski> | it's the by-value fixed point combinator |
2025-05-12 05:41:48 +0200 | <EvanR> | is that the Z combinator ski |
2025-05-12 05:41:15 +0200 | <monochrom> | So you cannot make "fix (0 :) = 0 : 0 : ..." like in Haskell, but you can still make "fix (\f -> \n -> ... fibonacci ...)" |
2025-05-12 05:39:40 +0200 | <ski> | fix f = (\t -> t t) (\t x -> f (t t) x) |
2025-05-12 05:39:36 +0200 | <monochrom> | Even in call-by-value languages, lambdas are lazy in bodies, or at least delayed, i.e., "\x -> undefined" does not cause that undefined to be evaluated, only application "(\x -> undefined) 5" does. That little delay is leveraged to make fixed point combinators and emulation of laziness. |
2025-05-12 05:39:33 +0200 | <ski> | fix :: ((a -> b) -> (a -> b)) -> (a -> b) |
2025-05-12 05:38:16 +0200 | <EvanR> | how do all these languages get recursion without lazy evaluation |
2025-05-12 05:36:21 +0200 | <monochrom> | True. |
2025-05-12 05:28:34 +0200 | <EvanR> | or else evaluating fix f necessarily freezes |
2025-05-12 05:28:03 +0200 | <EvanR> | true or false, to have a working fixed point construct for recursion, you need some kind of lazy evaluation |
2025-05-12 05:27:43 +0200 | weary-traveler | (~user@user/user363627) user363627 |
2025-05-12 05:27:18 +0200 | weary-traveler | (~user@user/user363627) (Remote host closed the connection) |
2025-05-12 05:22:59 +0200 | <monochrom> | :) |
2025-05-12 05:18:32 +0200 | weary-traveler | (~user@user/user363627) user363627 |
2025-05-12 05:02:25 +0200 | hughjfchen | (~hughjfche@vmi2417424.contaboserver.net) hughjfchen |
2025-05-12 05:01:10 +0200 | Taneb | (~Taneb@2001:41c8:51:10d:aaaa:0:aaaa:0) Taneb |
2025-05-12 05:00:54 +0200 | hughjfchen | (~hughjfche@vmi2417424.contaboserver.net) (Quit: WeeChat 4.4.3) |
2025-05-12 05:00:00 +0200 | Taneb0 | (~Taneb@2001:41c8:51:10d:aaaa:0:aaaa:0) (Quit: I seem to have stopped.) |
2025-05-12 04:56:24 +0200 | Frostillicus | (~Frostilli@pool-71-174-119-56.bstnma.fios.verizon.net) |
2025-05-12 04:40:15 +0200 | aditya_an1l | (~aditya_an@user/aditya-an1l:63825) aditya_an1l |
2025-05-12 04:37:54 +0200 | peterbecich | (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds) |
2025-05-12 04:20:45 +0200 | td_ | (~td@i53870921.versanet.de) td_ |
2025-05-12 04:19:23 +0200 | tavare | (~tavare@user/tavare) (Remote host closed the connection) |
2025-05-12 04:19:18 +0200 | td_ | (~td@i53870935.versanet.de) (Ping timeout: 272 seconds) |
2025-05-12 04:16:37 +0200 | tavare | (~tavare@user/tavare) tavare |
2025-05-12 04:16:37 +0200 | tavare | (~tavare@150.129.88.189) (Changing host) |
2025-05-12 04:16:37 +0200 | tavare | (~tavare@150.129.88.189) tavare |
2025-05-12 04:13:24 +0200 | califax | (~califax@user/califx) califx |
2025-05-12 04:13:00 +0200 | califax | (~califax@user/califx) (Remote host closed the connection) |
2025-05-12 04:07:53 +0200 | xff0x | (~xff0x@fsb6a9491c.tkyc517.ap.nuro.jp) |
2025-05-12 03:56:40 +0200 | j1n37 | (~j1n37@user/j1n37) (Ping timeout: 276 seconds) |
2025-05-12 03:54:49 +0200 | j1n37- | (~j1n37@user/j1n37) j1n37 |
2025-05-12 03:53:23 +0200 | <EvanR> | I'm wrong, since the environment would have first class functions with their own environment in a closure |
2025-05-12 03:50:26 +0200 | j1n37 | (~j1n37@user/j1n37) j1n37 |
2025-05-12 03:49:41 +0200 | j1n37- | (~j1n37@user/j1n37) (Ping timeout: 248 seconds) |
2025-05-12 03:49:14 +0200 | hughjfchen | (~hughjfche@vmi2417424.contaboserver.net) hughjfchen |