Nondeterministic Functional Programming
Consider the C function
int f(int a, int b) {
int s = 4;
int x,y;
x = a * s;
s = s + 1;
y = b * s;
s = s + 1;
return x * y;
}
If we were to write it in Haskell, it would be
f :: Int -> Int -> Int
f a b
= let s = 4 in
type Choice a = [a]
choose :: [a] -> Choice a
choose xs = xs
1