On Sun, Sep 19, 2010 at 5:01 PM, Henrique Becker
henriquebecke...@gmail.com wrote:
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
On Mon, Sep 20, 2010 at 5:11 PM, Luke Palmer lrpal...@gmail.com wrote:
On Sun, Sep 19, 2010 at 5:01 PM, Henrique Becker
henriquebecke...@gmail.com wrote:
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' =
Thanks, It's my first post.
If you not import Prelude is more clear (N. is horrible):
import Prelude ((-), Integral)
import Data.Number.Nat (drop, length, toNat)
lastN :: Integral b = b - [a] - [a]
lastN n xs = drop (length xs - n') xs
where n' = toNat n
P.S.: You benchmarked? I
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
Not import Prelude maybe make more clear.
[]'s
Henrique Becker
___
Haskell-Cafe mailing list
On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote:
Hello Haskell Community -
I am a professional programmer with 11 years experience, yet I just do
not seem to be able to get the hang of even simple things in Haskell.
I am trying to write a function that takes a list and returns
Translation: Look at Data.Sequence sometime.
On 9/18/10 11:15 AM, Maciej Piechotka wrote:
On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote:
Hello Haskell Community -
I am a professional programmer with 11 years experience, yet I just do
not seem to be able to get the hang of even
Translation: Look at Data.Sequence sometime.
On 9/18/10 11:15 AM, Maciej Piechotka wrote:
On Sat, 2010-09-18 at 03:51 -0400, Christopher Tauss wrote:
Hello Haskell Community -
I am a professional programmer with 11 years experience, yet I just do
not seem to be able to get the hang of even