4 ms·
Hmm, it may not be very helpful, but there's a replicate function[1] right in the Prelude. I always thought that being clever in Haskell is to be able to find a
by echaozh 10y ago
Hmm, it may not be very helpful, but there's a replicate function[1] right in the Prelude. I always thought that being clever in Haskell is to be able to find all the strange but powerful packages and functions and weave them in as tight a program as possible. Having to implement replicate by hand is definitely not clever from the start.
Hmm, it's also what drove me away from Haskell and kept me on and off with the language, as most of the powerful stuff are too powerful and so hard to tame...
[1] http://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude.html#v:replicate http://hackage.haskell.org/package/base-4.9.0.0/docs/Prelude...