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. Integer by default. (Lyndon Maydwell)
2. Re: Integer by default. (Ertugrul Soeylemez)
3. Re: Re: Integer by default. (Lyndon Maydwell)
4. Re: Re: Integer by default. (Benjamin Edwards)
5. Re: Re: Integer by default. (Lyndon Maydwell)
6. Re: Integer by default. (Felipe Lessa)
7. Signatures (Colin Paul Adams)
8. Re: Signatures (Daniel Fischer)
9. Re: Signatures (Colin Paul Adams)
10. Re: Signatures (Felipe Lessa)
----------------------------------------------------------------------
Message: 1
Date: Wed, 23 Jun 2010 21:38:24 +0800
From: Lyndon Maydwell <[email protected]>
Subject: [Haskell-beginners] Integer by default.
To: Biginners Haskell Mailinglist <[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi beginners.
Is there a way to get the prelude functions to use Integer by default
rather than Int?
I often have issues with Ints silently overflowing silently, but don't
often have speed issues.
Somehow I don't think that this is possible, but... Maybe?
------------------------------
Message: 2
Date: Wed, 23 Jun 2010 15:52:32 +0200
From: Ertugrul Soeylemez <[email protected]>
Subject: [Haskell-beginners] Re: Integer by default.
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII
Hello Lyndon,
it seems to me that Integer /is/ the default. Probably you're unifying
with some Int, for example when using functions like 'take' or 'length':
length :: [a] -> Int
take :: Int -> [a] -> [a]
Greets,
Ertugrul
Lyndon Maydwell <[email protected]> wrote:
> Hi beginners.
>
> Is there a way to get the prelude functions to use Integer by default
> rather than Int?
>
> I often have issues with Ints silently overflowing silently, but don't
> often have speed issues.
>
> Somehow I don't think that this is possible, but... Maybe?
--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://blog.ertes.de/
------------------------------
Message: 3
Date: Wed, 23 Jun 2010 21:57:33 +0800
From: Lyndon Maydwell <[email protected]>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Ertugrul Soeylemez <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Ah, that's probably it.
I suppose there's no way of making the overflow throw an exception
without sacrificing significant performance.
------------------------------
Message: 4
Date: Wed, 23 Jun 2010 15:54:56 +0200
From: Benjamin Edwards <[email protected]>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Ertugrul Soeylemez <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
And for those functions there are often generic counterparts defined in the
List module eg genericLength that take Integral types.
On 23 June 2010 15:52, Ertugrul Soeylemez <[email protected]> wrote:
> Hello Lyndon,
>
> it seems to me that Integer /is/ the default. Probably you're unifying
> with some Int, for example when using functions like 'take' or 'length':
>
> length :: [a] -> Int
> take :: Int -> [a] -> [a]
>
>
> Greets,
> Ertugrul
>
>
> Lyndon Maydwell <[email protected]> wrote:
>
> > Hi beginners.
> >
> > Is there a way to get the prelude functions to use Integer by default
> > rather than Int?
> >
> > I often have issues with Ints silently overflowing silently, but don't
> > often have speed issues.
> >
> > Somehow I don't think that this is possible, but... Maybe?
>
>
>
> --
> nightmare = unsafePerformIO (getWrongWife >>= sex)
> http://blog.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/20100623/fc8c7d34/attachment-0001.html
------------------------------
Message: 5
Date: Wed, 23 Jun 2010 22:06:32 +0800
From: Lyndon Maydwell <[email protected]>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Benjamin Edwards <[email protected]>
Cc: [email protected], Ertugrul Soeylemez <[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Ah, sweet!
------------------------------
Message: 6
Date: Wed, 23 Jun 2010 11:51:12 -0300
From: Felipe Lessa <[email protected]>
Subject: Re: [Haskell-beginners] Integer by default.
To: Lyndon Maydwell <[email protected]>
Cc: Biginners Haskell Mailinglist <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Wed, Jun 23, 2010 at 09:38:24PM +0800, Lyndon Maydwell wrote:
> Is there a way to get the prelude functions to use Integer by default
> rather than Int?
In general, I think it is cleaner to use explicit type signatures
instead of defaulting. Running GHC with -Wall will warn you
whenever you default to something.
Cheers,
--
Felipe.
------------------------------
Message: 7
Date: Wed, 23 Jun 2010 17:08:18 +0100
From: Colin Paul Adams <[email protected]>
Subject: [Haskell-beginners] Signatures
To: Ertugrul Soeylemez <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
>>>>> "Ertugrul" == Ertugrul Soeylemez <[email protected]> writes:
Ertugrul> -- nightmare = unsafePerformIO (getWrongWife >>= sex)
I can't work out the signature for nightmare (in your signature).
:-)
--
Colin Adams
Preston Lancashire
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
------------------------------
Message: 8
Date: Wed, 23 Jun 2010 18:14:58 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Signatures
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
> >>>>> "Ertugrul" == Ertugrul Soeylemez <[email protected]> writes:
>
> Ertugrul> -- nightmare = unsafePerformIO (getWrongWife >>= sex)
>
> I can't work out the signature for nightmare (in your signature).
>
> :-)
My guess:
getWrongWife :: IO Partner
sex :: Partner -> IO Offspring
------------------------------
Message: 9
Date: Wed, 23 Jun 2010 17:20:16 +0100
From: Colin Paul Adams <[email protected]>
Subject: Re: [Haskell-beginners] Signatures
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
>>>>> "Daniel" == Daniel Fischer <[email protected]> writes:
Daniel> On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
>> >>>>> "Ertugrul" == Ertugrul Soeylemez <[email protected]> writes:
>>
Ertugrul> -- nightmare = unsafePerformIO (getWrongWife >>= sex)
>>
>> I can't work out the signature for nightmare (in your signature).
>>
>> :-)
Daniel> My guess:
Daniel> getWrongWife :: IO Partner sex :: Partner -> IO Offspring
So
nightmare :: Offspring ?
--
Colin Adams
Preston Lancashire
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
------------------------------
Message: 10
Date: Wed, 23 Jun 2010 13:23:44 -0300
From: Felipe Lessa <[email protected]>
Subject: Re: [Haskell-beginners] Signatures
To: Colin Paul Adams <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Wed, Jun 23, 2010 at 05:20:16PM +0100, Colin Paul Adams wrote:
> >>>>> "Daniel" == Daniel Fischer <[email protected]> writes:
>
> Daniel> On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
> >> >>>>> "Ertugrul" == Ertugrul Soeylemez <[email protected]> writes:
> >>
> Ertugrul> -- nightmare = unsafePerformIO (getWrongWife >>= sex)
> >>
> >> I can't work out the signature for nightmare (in your signature).
> >>
> >> :-)
>
> Daniel> My guess:
>
> Daniel> getWrongWife :: IO Partner sex :: Partner -> IO Offspring
>
>
> So
>
> nightmare :: Offspring ?
I guess it would be better to have
sex :: Partner -> IO (Maybe Offspring)
or, if you are lucky/unlucky:
sex :: Partner -> IO [Offspring]
--
Felipe.
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 24, Issue 29
*****************************************