Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  the first argument of take is an Int and not     Integral..
      (Sunil S Nandihalli)
   2. Re:  the first argument of take is an Int and     not Integral..
      (David McBride)
   3. Re:  the first argument of take is an Int and     not Integral..
      (Ertugrul Soeylemez)
   4.  Lang extension (Luca Ciciriello)
   5. Re:  Lang extension (almost solved) (Luca Ciciriello)
   6. Re:  Lang extension (almost solved) (Daniel Seidel)
   7. Re:  Lang extension (almost solved) (Luca Ciciriello)
   8. Re:  Lang extension (almost solved) (Luca Ciciriello)


----------------------------------------------------------------------

Message: 1
Date: Wed, 10 Aug 2011 19:44:36 +0530
From: Sunil S Nandihalli <[email protected]>
Subject: [Haskell-beginners] the first argument of take is an Int and
        not     Integral..
To: [email protected]
Message-ID:
        <CAP0FD73a7vSXk_bqm6DMDVqm+c6hutEoTJFWJhf35k2LLs=h...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110810/ed710ba7/attachment-0001.htm>

------------------------------

Message: 2
Date: Wed, 10 Aug 2011 10:20:47 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] the first argument of take is an Int
        and     not Integral..
To: Sunil S Nandihalli <[email protected]>
Cc: [email protected]
Message-ID:
        <can+tr4189j74o_usgaftggkc4dabazhfoc-pomm4ipjx6e+...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

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
<[email protected]> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>



------------------------------

Message: 3
Date: Wed, 10 Aug 2011 16:35:08 +0200
From: Ertugrul Soeylemez <[email protected]>
Subject: Re: [Haskell-beginners] the first argument of take is an Int
        and     not Integral..
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Sunil S Nandihalli <[email protected]> wrote:

>  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) ?

This would be an overgeneralization and you would pay for it with a
performance loss.  There is no reason to generalize here, because most
indexing and counting functions use an Int.

If you feel that you might exhaust Int (which is very unlikely on 32 bit
and practically impossible on 64 bit), you can use genericTake from
Data.List.

    Data.List.genericTake :: Integral i => i -> [a] -> [a]


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





------------------------------

Message: 4
Date: Wed, 10 Aug 2011 17:04:58 +0200
From: Luca Ciciriello <[email protected]>
Subject: [Haskell-beginners] Lang extension
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi All. 
I've just installed GHC 7.2.1 And I've some problems with my old code.

To use the parallel List [: :] in my code I use {-# LANGUAGE PArr #-}. Now the 
new compiler tells me the the extension PArr is unsupported. If I remove {-# 
LANGUAGE PArr #-} the sinter [: compiled by GHC. Wich extension I've to use in 
order to built my code?

Thanks in Advance for any answer (I've installed GHC 7.2.1 on MacOS X Lion, 
Xcode 4.1)

Luca.




------------------------------

Message: 5
Date: Wed, 10 Aug 2011 17:12:53 +0200
From: Luca Ciciriello <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Luca Ciciriello <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Ok, I've replaced {-# LANGUAGE PArr #-} with {-# LANGUAGE ParallelArrays #-}.
now my problem is that the compiler is unable to find "elemP" and "foldP"
Wich package have I to import?

Luca.

On Aug 10, 2011, at 5:04 PM, Luca Ciciriello wrote:

> Hi All. 
> I've just installed GHC 7.2.1 And I've some problems with my old code.
> 
> To use the parallel List [: :] in my code I use {-# LANGUAGE PArr #-}. Now 
> the new compiler tells me the the extension PArr is unsupported. If I remove 
> {-# LANGUAGE PArr #-} the sinter [: compiled by GHC. Wich extension I've to 
> use in order to built my code?
> 
> Thanks in Advance for any answer (I've installed GHC 7.2.1 on MacOS X Lion, 
> Xcode 4.1)
> 
> Luca.
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
> 




------------------------------

Message: 6
Date: Wed, 10 Aug 2011 17:21:54 +0200
From: Daniel Seidel <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Luca Ciciriello <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain

On Wed, 2011-08-10 at 17:12 +0200, Luca Ciciriello wrote:
> Ok, I've replaced {-# LANGUAGE PArr #-} with {-# LANGUAGE ParallelArrays #-}.
> now my problem is that the compiler is unable to find "elemP" and "foldP"
> Wich package have I to import?

Hayoo (http://holumbus.fh-wedel.de/hayoo/) says:

GHC.PArr.elemP:: a -> [:a:] -> Bool

Cheers,

Daniel.

> 
> Luca.
> 
> On Aug 10, 2011, at 5:04 PM, Luca Ciciriello wrote:
> 
> > Hi All. 
> > I've just installed GHC 7.2.1 And I've some problems with my old code.
> > 
> > To use the parallel List [: :] in my code I use {-# LANGUAGE PArr #-}. Now 
> > the new compiler tells me the the extension PArr is unsupported. If I 
> > remove {-# LANGUAGE PArr #-} the sinter [: compiled by GHC. Wich extension 
> > I've to use in order to built my code?
> > 
> > Thanks in Advance for any answer (I've installed GHC 7.2.1 on MacOS X Lion, 
> > Xcode 4.1)
> > 
> > Luca.
> > 
> > 
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> > 
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners




------------------------------

Message: 7
Date: Wed, 10 Aug 2011 17:29:21 +0200
From: Luca Ciciriello <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Daniel Seidel <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Yes, but in the release note of GHC 7.2.1 there is this sentence:
Most of GHC.PArr has been moved into the dph package. Only the [::] datatype 
remains.

My question is which are the packages to import to use dph?

Luca

On Aug 10, 2011, at 5:21 PM, Daniel Seidel wrote:

> On Wed, 2011-08-10 at 17:12 +0200, Luca Ciciriello wrote:
>> Ok, I've replaced {-# LANGUAGE PArr #-} with {-# LANGUAGE ParallelArrays #-}.
>> now my problem is that the compiler is unable to find "elemP" and "foldP"
>> Wich package have I to import?
> 
> Hayoo (http://holumbus.fh-wedel.de/hayoo/) says:
> 
> GHC.PArr.elemP:: a -> [:a:] -> Bool
> 
> Cheers,
> 
> Daniel.
> 
>> 
>> Luca.
>> 
>> On Aug 10, 2011, at 5:04 PM, Luca Ciciriello wrote:
>> 
>>> Hi All. 
>>> I've just installed GHC 7.2.1 And I've some problems with my old code.
>>> 
>>> To use the parallel List [: :] in my code I use {-# LANGUAGE PArr #-}. Now 
>>> the new compiler tells me the the extension PArr is unsupported. If I 
>>> remove {-# LANGUAGE PArr #-} the sinter [: compiled by GHC. Wich extension 
>>> I've to use in order to built my code?
>>> 
>>> Thanks in Advance for any answer (I've installed GHC 7.2.1 on MacOS X Lion, 
>>> Xcode 4.1)
>>> 
>>> Luca.
>>> 
>>> 
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://www.haskell.org/mailman/listinfo/beginners
>>> 
>> 
>> 
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110810/e6f32676/attachment-0001.htm>

------------------------------

Message: 8
Date: Wed, 10 Aug 2011 17:42:02 +0200
From: Luca Ciciriello <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Colin Adams <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

You are right, my mistake, but this don't solve my problem :-)))

Luca
On Aug 10, 2011, at 5:37 PM, Colin Adams wrote:

> You don't import packages, you import modules.
> 
> On 10 August 2011 16:29, Luca Ciciriello <[email protected]> wrote:
> Yes, but in the release note of GHC 7.2.1 there is this sentence:
> Most of GHC.PArr has been moved into the dph package. Only the [::] datatype 
> remains.
> 
> My question is which are the packages to import to use dph?
> 
> Luca
> 
> On Aug 10, 2011, at 5:21 PM, Daniel Seidel wrote:
> 
>> On Wed, 2011-08-10 at 17:12 +0200, Luca Ciciriello wrote:
>>> Ok, I've replaced {-# LANGUAGE PArr #-} with {-# LANGUAGE ParallelArrays 
>>> #-}.
>>> now my problem is that the compiler is unable to find "elemP" and "foldP"
>>> Wich package have I to import?
>> 
>> Hayoo (http://holumbus.fh-wedel.de/hayoo/) says:
>> 
>> GHC.PArr.elemP:: a -> [:a:] -> Bool
>> 
>> Cheers,
>> 
>> Daniel.
>> 
>>> 
>>> Luca.
>>> 
>>> On Aug 10, 2011, at 5:04 PM, Luca Ciciriello wrote:
>>> 
>>>> Hi All. 
>>>> I've just installed GHC 7.2.1 And I've some problems with my old code.
>>>> 
>>>> To use the parallel List [: :] in my code I use {-# LANGUAGE PArr #-}. Now 
>>>> the new compiler tells me the the extension PArr is unsupported. If I 
>>>> remove {-# LANGUAGE PArr #-} the sinter [: compiled by GHC. Wich extension 
>>>> I've to use in order to built my code?
>>>> 
>>>> Thanks in Advance for any answer (I've installed GHC 7.2.1 on MacOS X 
>>>> Lion, Xcode 4.1)
>>>> 
>>>> Luca.
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Beginners mailing list
>>>> [email protected]
>>>> http://www.haskell.org/mailman/listinfo/beginners
>>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Beginners mailing list
>>> [email protected]
>>> http://www.haskell.org/mailman/listinfo/beginners
>> 
>> 
> 
> 
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110810/a514db54/attachment.htm>

------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 38, Issue 23
*****************************************

Reply via email to