Re:Amb
by Dylan16807 on Saturday February 22, 2020 @12:54PM
(#22392283)
The F# version isn't that limited. You can replace the 'if' with arbitrary logic, and that 'if' is outside of the amb 'implementation'. It can do lots of different computations with that structure. But there's no straightforward way to do things more complicated than a series of amb declarations followed by a series of amb asserts.
Re:Amb
by tigershark on Saturday February 22, 2020 @11:11PM
(#22395096)
It’s because you don’t actually need the Amb operator to solve that problem with list comprehension and the list monad. Adding it it’s just superfluous. The C# classes solution may meet the requirements but I still think that my csx solution (kind of similar to the Haskell, F# and python list comprehension) is more compact and readable.
If I'm reading the page correctly, the task is to create a general Amb implementation and merely demonstrate it using the data provided, and not to create a solution that only works on data similar to the sample data.
So I don't believe any of the PureBasic, Rust, or F# solutions meet the requirements. Though since it's a wiki, someone might have gone in and edited/added to the solutions after I wrote this. :)
In comparison, the class-based C# solutions are a lot more verbose but appear to actually solve the problem that was defined.