yif042 / mistwave.github.io

My personal blog
http://duanyifu.com
0 stars 0 forks source link

Programming in Haskell Chapter6 Exercises Solutions | Yifu's Blog #12

Open yif042 opened 4 years ago

yif042 commented 4 years ago

https://duanyifu.com/2016/08/28/PIHex6/

Programming in Haskell是一本入门Haskell的好书,介绍页面以及配套的slides, vedios, codes都在这里。 这一章节就是在讲递归,所以下面的定义都是默认用递归定义。 定义幂函数 12345678910mypow :: Int -> Int -> Intmypow _ 0 = 1mypow x n = x mypow x (n-1)-- M