[Haskell-beginners] the first argument of take is an Int and not Integral..

David McBride dmcbride at neondsl.com
Wed Aug 10 16:20:47 CEST 2011


To require an Integer implies you have a list of 2 billion+ elements
and that's pretty huge for a list.  Take is used a lot, and using an
Int instead of Integer for something that gets called so often is just
common sense.


On Wed, Aug 10, 2011 at 10:14 AM, Sunil S Nandihalli
<sunil.nandihalli at gmail.com> wrote:
> Hi everybody,
>  I feel forcing the first argument of take to be an Int is unnecessarily
> restrictive .. Is there a rationale behind not making it just (Integral a) ?
> right now it is
> take::Int->[a]->[a]
> I was thinking may be
> take::(Integral b)=>b->[a]->[a]
> would be better...
> Thanks,
> Sunil.
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>



More information about the Beginners mailing list