gleam-lang / language-tour

👩🏽‍💻 Learn Gleam in your browser
https://tour.gleam.run/
73 stars 55 forks source link

factorial(0) = 1 case added #83

Closed 0riginaln0 closed 2 months ago

0riginaln0 commented 2 months ago

Executing a factorial from zero is expected to return one, not "RangeError: Maximum call stack size exceeded". Additionally, 0 | 1 is quite clear and easy to understand.

0riginaln0 commented 2 months ago

Well, since alternative patterns lesson will be after the added ones, it makes sense to change 0 | to a separate case 0 -> 1