You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
allow for multiple entries of the same function with pattern matching the parameters, like a case statement.
The following implementation of Fibonacci Sequence:
Could be converted into:
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).
The text was updated successfully, but these errors were encountered: