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: How best to do this? (Michael Peternell)
----------------------------------------------------------------------
Message: 1
Date: Thu, 2 May 2013 19:32:26 +0200
From: Michael Peternell <[email protected]>
Subject: Re: [Haskell-beginners] How best to do this?
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
Ok, I filed a feature request at
http://hackage.haskell.org/trac/ghc/ticket/7881
-Michael
Am 01.05.2013 um 13:33 schrieb Brent Yorgey:
> Ah, yes, a warning for literals like [5..2] sounds like an excellent
> idea. Why don't you file a feature request at
>
> http://hackage.haskell.org/trac/ghc/
>
> ?
>
> -Brent
>
> On Wed, May 01, 2013 at 12:35:36PM +0200, Michael Peternell wrote:
>> @Brent:
>> By reading your mails I got an idea...
>>
>> how about generating a compiler warning when someone types a literal like
>> [5..2].
>>
>> "Foo.hs:32: Warning: Literal list [5..2] evaluates to [] because 5 > 2 and
>> the default step size is +1. Replace the literal with the empty list or with
>> [5,4..2] to suppress this warning."
>>
>> That would be a really beginner-friendly warning.
>>
>> But I also think that we shouldn't catch this kind of mistake at runtime,
>> because it may be the expected behavior in many cases.
>>
>> Michael
>>
>> Am 29.04.2013 um 23:54 schrieb Brent Yorgey:
>>
>>> Oh, yes, I suppose it could.
>>>
>>> In any case, I am still in favor of the existing semantics -- it is
>>> simple and consistent (and sometimes even useful). "Do what I
>>> mean"-style semantics with special cases end up generating more pain
>>> than they solve.
>>>
>>> -Brent
>>>
>>> On Mon, Apr 29, 2013 at 02:29:43PM -0400, David McBride wrote:
>>>> Couldn't it just use fromEnum and compare the integers you get and
>>>> figure out which is bigger?
>>>>
>>>> On Mon, Apr 29, 2013 at 2:17 PM, Brent Yorgey <[email protected]>
>>>> wrote:
>>>>> But then \x y -> [x .. y] would have to have the type
>>>>>
>>>>> (Ord a, Enum a) => [a]
>>>>>
>>>>> whereas now it just has the Enum constraint. Either that or else the
>>>>> notation would work differently for literals vs. expressions but that
>>>>> would be just awful.
>>>>>
>>>>> -Brent
>>
>>
>> _______________________________________________
>> 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
End of Beginners Digest, Vol 59, Issue 4
****************************************