mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-07 23:37:32 +02:00
This commit is contained in:
@@ -152,7 +152,7 @@ fib x
|
||||
| otherwise = fib (x - 1) + fib (x - 2)
|
||||
|
||||
-- Pattern matching is similar. Here we have given three different
|
||||
-- equations for fib. Haskell will automatically use the first
|
||||
-- equations that define fib. Haskell will automatically use the first
|
||||
-- equation whose left hand side pattern matches the value.
|
||||
fib 1 = 1
|
||||
fib 2 = 2
|
||||
|
Reference in New Issue
Block a user