2 ms·
The first two C# solutions come closer to actually implementing Amb, though. The Purebasic solution depends on the operands being strings, and the F# solution
by rpeden 7y ago
The first two C# solutions come closer to actually implementing Amb, though.
The Purebasic solution depends on the operands being strings, and the F# solution depends on them being sequences. And the way that the 'Ambassert' works in both of them is hardcoded, too.
Since the problem was 'create an Amb implementation and demonstrate it using the data below' and not 'create an Amb-like thing that can only solve for cases where the operands are strings/sequence and the last item in operand 1 must match the first item in operand 2', I believe that the C# solutions actually solve the problem, while the Purebasic and F# solutions do not.
- tigershark 7y agoThe C# classes solutions are doing the same thing as the F# solution, but in a more complicated way. You don’t really need the Amb operator to solve that problem using the list monad or list comprehension or doing a join. I’ve never seen anyone complain that you should have an Amb operator in SQL when you are doing a JOIN.