Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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 <maydw...@gmail.com>
Subject: [Haskell-beginners] Integer by default.
To: Biginners Haskell Mailinglist <beginners@haskell.org>
Message-ID:
        <aanlktilxkeu9swgb9itov3oeou00bncxvvrxn0rcn...@mail.gmail.com>
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 <e...@ertes.de>
Subject: [Haskell-beginners] Re: Integer by default.
To: beginners@haskell.org
Message-ID: <20100623155232.7d414...@tritium.streitmacht.eu>
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 <maydw...@gmail.com> 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 <maydw...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Ertugrul Soeylemez <e...@ertes.de>
Cc: beginners@haskell.org
Message-ID:
        <aanlktiluqdp4cunxjqxrtifjxoc3vnco7lavkfzqd...@mail.gmail.com>
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 <edwards.b...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Ertugrul Soeylemez <e...@ertes.de>
Cc: beginners@haskell.org
Message-ID:
        <aanlktin2uvlgwlz-ufigbbfq1tmypdx7gelji5xex...@mail.gmail.com>
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 <e...@ertes.de> 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 <maydw...@gmail.com> 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
> Beginners@haskell.org
> 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 <maydw...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Integer by default.
To: Benjamin Edwards <edwards.b...@gmail.com>
Cc: beginners@haskell.org, Ertugrul Soeylemez <e...@ertes.de>
Message-ID:
        <aanlktimd2howfk7qathdjlmqyjm7jo5gmhcms6o25...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Ah, sweet!


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

Message: 6
Date: Wed, 23 Jun 2010 11:51:12 -0300
From: Felipe Lessa <felipe.le...@gmail.com>
Subject: Re: [Haskell-beginners] Integer by default.
To: Lyndon Maydwell <maydw...@gmail.com>
Cc: Biginners Haskell Mailinglist <beginners@haskell.org>
Message-ID: <20100623145112.ga8...@kira.casa>
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 <co...@colina.demon.co.uk>
Subject: [Haskell-beginners] Signatures
To: Ertugrul Soeylemez <e...@ertes.de>
Cc: beginners@haskell.org
Message-ID: <m3vd99n34d.fsf...@colina.demon.co.uk>
Content-Type: text/plain; charset=us-ascii

>>>>> "Ertugrul" == Ertugrul Soeylemez <e...@ertes.de> 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 <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] Signatures
To: beginners@haskell.org
Message-ID: <201006231814.58749.daniel.is.fisc...@web.de>
Content-Type: text/plain;  charset="iso-8859-1"

On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
> >>>>> "Ertugrul" == Ertugrul Soeylemez <e...@ertes.de> 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 <co...@colina.demon.co.uk>
Subject: Re: [Haskell-beginners] Signatures
To: Daniel Fischer <daniel.is.fisc...@web.de>
Cc: beginners@haskell.org
Message-ID: <m3r5jxn2kf....@colina.demon.co.uk>
Content-Type: text/plain; charset=us-ascii

>>>>> "Daniel" == Daniel Fischer <daniel.is.fisc...@web.de> writes:

    Daniel> On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
    >> >>>>> "Ertugrul" == Ertugrul Soeylemez <e...@ertes.de> 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 <felipe.le...@gmail.com>
Subject: Re: [Haskell-beginners] Signatures
To: Colin Paul Adams <co...@colina.demon.co.uk>
Cc: beginners@haskell.org
Message-ID: <20100623162344.ga28...@kira.casa>
Content-Type: text/plain; charset=us-ascii

On Wed, Jun 23, 2010 at 05:20:16PM +0100, Colin Paul Adams wrote:
> >>>>> "Daniel" == Daniel Fischer <daniel.is.fisc...@web.de> writes:
>
>     Daniel> On Wednesday 23 June 2010 18:08:18, Colin Paul Adams wrote:
>     >> >>>>> "Ertugrul" == Ertugrul Soeylemez <e...@ertes.de> 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
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


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

Reply via email to