1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-15 03:06:16 +02:00

Merge pull request #1007 from geoffliu/haskell-minor

[Haskell/en] Make the two fib functions consistent
This commit is contained in:
ven
2015-03-16 21:21:47 +01:00

View File

@@ -148,7 +148,7 @@ add 1 2 -- 3
-- Guards: an easy way to do branching in functions
fib x
| x < 2 = x
| x < 2 = 1
| otherwise = fib (x - 1) + fib (x - 2)
-- Pattern matching is similar. Here we have given three different