Haskell Study Note Lesson 6 : Recursion
Haskell Study Note Lesson 6 : Recursion
There are two types of recursion :
- Nested Recursion
- Pattern Matching
A typical recursion is like :
1 | factorial :: Integer -> Integer |
The end of a recursion is called Base Case.
Practice :
Multiplication Table
1 | multipleLine :: Int -> Int -> String |
Note :
Intis a value, but[Int]is a list- If the parameter need operation, you should add
() - The connect of strings is
++, and list is+
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 zhangxixi的博客!
