yif042 / mistwave.github.io

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

Programming in Haskell Chapter4 Exercises Solutions | Yifu's Blog #15

Open yif042 opened 4 years ago

yif042 commented 4 years ago

https://duanyifu.com/2016/08/26/PIHex4/

Programming in Haskell是一本入门Haskell的好书,介绍页面以及配套的slides, vedios, codes都在这里。 定义 halve 12halve :: [a] -> ([a], [a])halve a = let n = (length a) div 2 in (take n a, drop n a) 用三种方式定义safetail 12345678