Open
Description
allow for multiple entries of the same function with pattern matching the parameters, like a case statement.
The following implementation of Fibonacci Sequence:
fib : Int -> Int
fib x =
case x of
0 ->
1
1 ->
1
_ ->
fib (x - 1) + fib (x - 2)
Could be converted into:
fib : Int -> Int
fib 0 = 1
fib 1 = 1
fib x = fib (x - 1) + fib (x - 2)
The second example should probably be converted back to the original version with the use of the case statement, by using a tuple for the arguments (this might need #70).
Metadata
Metadata
Assignees
Labels
No labels