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. Re:  Lang extension (almost solved) (David McBride)
   2. Re:  Lang extension (almost solved) (David McBride)
   3. Re:  Lang extension (almost solved) (Luca Ciciriello)
   4. Re:  Lang extension (almost solved) (Brandon Allbery)
   5. Re:  the first argument of take is an Int and     not Integral..
      (Sunil S Nandihalli)
   6. Re:  the first argument of take is an Int and     not Integral..
      (Daniel Fischer)
   7. Re:  the first argument of take is an Int and     not Integral..
      (David Virebayre)


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

Message: 1
Date: Wed, 10 Aug 2011 11:46:14 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Luca Ciciriello <[email protected]>
Cc: [email protected], Colin Adams <[email protected]>
Message-ID:
        <can+tr42fbkdgjodcqzt7m4xukt04op-8jqajhhx6tpa99va...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

import GHC.PArr as the other guy said.  That is where all the
functions are located.  It is part of base, and every haskell
installation already has base in it.

If you need to find out where functions are, go to hackage and click
on hayoo and look them up.

On Wed, Aug 10, 2011 at 11:42 AM, Luca Ciciriello
<[email protected]> wrote:
> 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
>>
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>



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

Message: 2
Date: Wed, 10 Aug 2011 11:48:40 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Luca Ciciriello <[email protected]>
Cc: [email protected], Colin Adams <[email protected]>
Message-ID:
        <can+tr40xtm1nsvzznczdvn4foozpkaezqzbn3jazlzq1xmy...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I'm sorry, disregard.  I have no idea what that new version of ghc
requires.  If there is a dph package I don't see it on hackage.

On Wed, Aug 10, 2011 at 11:46 AM, David McBride <[email protected]> wrote:
> import GHC.PArr as the other guy said. ?That is where all the
> functions are located. ?It is part of base, and every haskell
> installation already has base in it.
>
> If you need to find out where functions are, go to hackage and click
> on hayoo and look them up.
>
> On Wed, Aug 10, 2011 at 11:42 AM, Luca Ciciriello
> <[email protected]> wrote:
>> 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
>>>
>>
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>



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

Message: 3
Date: Wed, 10 Aug 2011 17:53:44 +0200
From: Luca Ciciriello <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: David McBride <[email protected]>
Cc: [email protected], Colin Adams <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

I've imported GHC.PArr, but the compiler is unable to find foldP and elemP.
The only solution I see is to return on GHC 7.0.4

Luca.


On Aug 10, 2011, at 5:46 PM, David McBride wrote:

> import GHC.PArr as the other guy said.  That is where all the
> functions are located.  It is part of base, and every haskell
> installation already has base in it.
> 
> If you need to find out where functions are, go to hackage and click
> on hayoo and look them up.
> 
> On Wed, Aug 10, 2011 at 11:42 AM, Luca Ciciriello
> <[email protected]> wrote:
>> 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
>>> 
>> 
>> 
>> 
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>> 
>> 
> 




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

Message: 4
Date: Wed, 10 Aug 2011 12:47:26 -0400
From: Brandon Allbery <[email protected]>
Subject: Re: [Haskell-beginners] Lang extension (almost solved)
To: Luca Ciciriello <[email protected]>
Cc: [email protected]
Message-ID:
        <CAKFCL4Vz31uK=5SsrB2MO12-MnBAxfA2K=xkzzp-fonzxx-...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Wed, Aug 10, 2011 at 11: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?
>

Looks like you don't; the DPH wiki page says

The interfaces of the various components of the DPH library are in the library
documentation <http://hackage.haskell.org/package/dph> on Hackage (which
will be uploaded with the GHC 7.2 DPH release).

It hasn't been uploaded yet, apparently.

-- 
brandon s allbery                                      [email protected]
wandering unix systems administrator (available)     (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110810/d4d1a230/attachment-0001.htm>

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

Message: 5
Date: Thu, 11 Aug 2011 00:12:05 +0530
From: Sunil S Nandihalli <[email protected]>
Subject: Re: [Haskell-beginners] the first argument of take is an Int
        and     not Integral..
To: Ertugrul Soeylemez <[email protected]>
Cc: [email protected]
Message-ID:
        <CAP0FD73FJmD+ukHugYoz0iPrc=JcgH0=xkc-4ylslm_1ea2...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

hmm.. I do agree that taking elements larger than say 2-billion is insane ..
however, I have no intention of doing that. But the thing is the value I am
getting is of type Integer but it actually very small and I am unable to
pass it as is. So is there a way to convert a value of type Integer to Int ?
This might be obvious.. But I am a newbie to the whole Haskell thing ...

Thanks,
Sunil.

On Wed, Aug 10, 2011 at 8:05 PM, Ertugrul Soeylemez <[email protected]> wrote:

> 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/
>
>
>
> _______________________________________________
> 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/20110811/6f834991/attachment-0001.htm>

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

Message: 6
Date: Wed, 10 Aug 2011 20:52:31 +0200
From: Daniel Fischer <[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="utf-8"

On Wednesday 10 August 2011, 20:42:05, Sunil S Nandihalli wrote:
> hmm.. I do agree that taking elements larger than say 2-billion is
> insane .. however, I have no intention of doing that. But the thing is
> the value I am getting is of type Integer but it actually very small
> and I am unable to pass it as is. So is there a way to convert a value
> of type Integer to Int ? This might be obvious.. But I am a newbie to
> the whole Haskell thing ...

Use fromInteger or fromIntegral

> 
> Thanks,
> Sunil.



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

Message: 7
Date: Wed, 10 Aug 2011 20:58:37 +0200
From: David Virebayre <[email protected]>
Subject: Re: [Haskell-beginners] the first argument of take is an Int
        and     not Integral..
To: Daniel Fischer <[email protected]>
Cc: Neil Mitchell <[email protected]>, [email protected]
Message-ID:
        <CAM_wFVuZLBSo5XeOnGc9RLKNopcrUOa4WtemSZsr=ytc0av...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

2011/8/10 Daniel Fischer <[email protected]>:
> Use fromInteger or fromIntegral

Wouldn't it be cool if Hoogle came up with fromInteger as the first
result for "Integer -> Int" ?

As it is now, you have to search for "Integer -> Int -syb -containers
-time -deepseq"

Don't know if it's easy though.

David.



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

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


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

Reply via email to