2025/05/12

Newest at the top

2025-05-12 06:15:09 +0200jmcantrell(~weechat@user/jmcantrell) (Ping timeout: 252 seconds)
2025-05-12 06:14:33 +0200 <ski> (percent-encoded in this case. however, <https://en.wikipedia.org/wiki/Curry's_paradox> also works)
2025-05-12 06:13:55 +0200 <ski> "o" with diaresis
2025-05-12 06:13:47 +0200 <ski> it's an "รถ"
2025-05-12 06:13:31 +0200 <EvanR> what is the character between L and b my client exploded
2025-05-12 06:13:06 +0200 <ski> using type-level recursion, rather than value-level recursion, yes
2025-05-12 06:12:51 +0200ski. o O ( <https://en.wikipedia.org/wiki/L%C3%B6b's_paradox> )
2025-05-12 06:12:27 +0200 <EvanR> oh it's the Y combinator smuggled into haskell
2025-05-12 06:11:57 +0200 <ski> by-name
2025-05-12 06:11:30 +0200 <EvanR> is this by value santa
2025-05-12 06:11:11 +0200 <ski> er, s/t = Santa/t = MkSanta/
2025-05-12 06:10:41 +0200 <ski> t = Santa (\t -> f (t `runSanta` t))
2025-05-12 06:10:25 +0200 <ski> where
2025-05-12 06:10:20 +0200 <ski> fix f = t `runSanta` t
2025-05-12 06:10:06 +0200 <ski> fix :: (a -> a) -> a
2025-05-12 06:09:49 +0200 <ski> newtype Santa a = MkSanta {runSanta :: Santa a -> a}
2025-05-12 06:07:40 +0200 <EvanR> it's turtles all the way down
2025-05-12 06:06:51 +0200 <ski> indeed
2025-05-12 06:06:04 +0200 <EvanR> ...) -> a) -> a) -> a) -> a
2025-05-12 06:04:51 +0200 <ski> `omega :: o where o = o -> a' in Haskellish terms
2025-05-12 06:03:57 +0200 <ski> ^ shorter way to express the same type
2025-05-12 06:03:47 +0200 <ski> val omega : 'b -> 'a as 'b = <fun>
2025-05-12 06:03:44 +0200 <ski> # let omega : 'o -> 'a as 'o = fun x -> x x;;
2025-05-12 06:01:09 +0200 <ski> (this is useful for "binary methods" and "clone methods / functional update". see <https://ocaml.org/manual/5.3/objectexamples.html#s:functional-objects> and <https://ocaml.org/manual/5.3/objectexamples.html#s:binary-methods>)
2025-05-12 05:58:15 +0200 <ski> without `-rectypes', it only allows such cycles, if they go through at least one object type
2025-05-12 05:58:04 +0200 <monochrom> OK that's deep magic.
2025-05-12 05:57:50 +0200 <ski> `ocaml -rectypes' does, yes
2025-05-12 05:57:41 +0200 <monochrom> Oh God it does equi-recursive types?!
2025-05-12 05:57:33 +0200 <EvanR> it's an infinite type
2025-05-12 05:57:10 +0200 <ski> val omega : ('a -> 'b as 'a) -> 'b = <fun>
2025-05-12 05:57:08 +0200 <ski> # let omega x = x x;;
2025-05-12 05:57:06 +0200 <EvanR> this is some fun t business
2025-05-12 05:56:29 +0200 <monochrom> Wait, how does that accept that "t t" is typeable?
2025-05-12 05:56:11 +0200 <EvanR> alright let me think
2025-05-12 05:54:46 +0200 <ski> - : int = 144
2025-05-12 05:54:43 +0200 <ski> # fix (fun fib n -> match n with 0 -> 0 | 1 -> 1 | n -> fib (n - 1) + fib (n - 2)) 12;;
2025-05-12 05:54:33 +0200 <ski> val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b = <fun>
2025-05-12 05:54:28 +0200 <ski> # let fix f = (fun t -> t t) (fun t x -> f (t t) x);;
2025-05-12 05:53:53 +0200 <EvanR> uhg
2025-05-12 05:53:41 +0200 <monochrom> No, it's designed to be compatible with by-value evaluation.
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 +0200michalz(~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. :)