RWH

3章の章末練習問題。1だけ。型シグネチャもつけたから2もだけど。

myLength :: [a] -> Int
myLength [] = 0
myLength (_:xs) = 1 + myLength xs