
20 Jun
2017
20 Jun
'17
1:38 a.m.
On 19/06/2017, at 9:28 PM, Oleg
wrote: Richard A. O'Keefe wrote:
Let Pi be the pattern (i,_) | (_,i) In SML, fun f P1 ... Pn (0,0) = true | f _ ... _ _ = false
fun g () = f (1,1) (2,2) ... (n,n) (1,1)
(So far it has taken 3 minutes on a fast machine to not finish compiling these 3 lines of code... I fear the worst.)
I can't speak for SML, but I was curious to try your example in OCaml, which also supports OR patterns.
My test case went up to ((20,_)|(_,20)). Your example goes up only to ((8,_)|(0,8)). Your version worked fast in F#. I'm currently trying a full scale example. F# ground away for a couple of minutes and then ran out of memory. ocamlc compiled it too fast to measure accurately.