Family Day update

This commit is contained in:
Ingy döt Net 2020-02-17 23:21:07 -08:00
parent aac6731f2c
commit 9ad63ea473
2442 changed files with 39761 additions and 8255 deletions

View file

@ -68,7 +68,8 @@ public program()
try
{
ambOperator
.for(new {"the","that","a"},new {"frog", "elephant", "thing"},new {"walked", "treaded", "grows"}, new {"slowly", "quickly"})
.for(new::("the","that","a"),new::("frog", "elephant", "thing"),new::("walked", "treaded", "grows"),
new::("slowly", "quickly"))
.seek:(a,b,c,d => joinable(a,b) && joinable(b,c) && joinable(c,d) )
.do:(a,b,c,d) { console.printLine(a," ",b," ",c," ",d) }
}

View file

@ -9,7 +9,7 @@ example = do
w2 <- amb ["frog", "elephant", "thing"]
w3 <- amb ["walked", "treaded", "grows"]
w4 <- amb ["slowly", "quickly"]
unless (joins w1 w2) (amb [])
unless (joins w2 w3) (amb [])
unless (joins w3 w4) (amb [])
return (unwords [w1, w2, w3, w4])
guard (w1 `joins` w2)
guard (w2 `joins` w3)
guard (w3 `joins` w4)
pure $ unwords [w1, w2, w3, w4]