
20 Sep
2010
20 Sep
'10
7:11 p.m.
On Sun, Sep 19, 2010 at 5:01 PM, Henrique Becker
Why not?
import Data.Number.Nat as N
lastN :: Integral b => b -> [a] -> [a] lastN n xs = N.drop (N.length xs - n') xs where n' = N.toNat n
Wow. That is gorgeous! I think it's basically the same idea as my "zipWith" implementation, but it is so much clearer here. Thanks :-) Luke