Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sgreben
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
sgreben
11y ago
Purely mechanically. Just writing down the problem statement we get: \exists f,g: \forall a,b: (f(b)=a) | (g(a)=b) where f,g are the guesses and a,b are the flips. Each guess is a function of the information available to the respec
2.
▲
by
sgreben
11y ago
I'm not proposing this as a solution to the expression problem (which has actual solutions, as noted in the other comments [0] and elsewhere [1]). It is, however, an extremely simple way of implementing the table-style dispatch outline
3.
▲
by
sgreben
11y ago
Sum types + exhaustiveness checking already do this, right? For this example: type animal = Cat | Dog type action = Sound | Eat | Attack let cat_sound () = printf "meow" let cat_attack () = printf "scratch"