Hacker News new | ask | show | jobs
by giornogiovanna 2314 days ago
Hopefully this version's closer to the prompt.[0]

Anyway, the F# code, IIUC, lets you do exactly what you want it to do, although you'd have to replace the ifs with guards.

[0]: https://rosettacode.org/wiki/Amb#Monadic