Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/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:  What is the Best   Haskell IDE in Windows? (Gregory Guthrie)
   2.  will GHC optimize pattern-matching on integers?
      (Patrick Pelletier)
   3. Re:  will GHC optimize pattern-matching on        integers?
      (Rahul Muttineni)


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

Message: 1
Date: Wed, 12 Apr 2017 09:02:48 -0500
From: Gregory Guthrie <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [Haskell-beginners] What is the Best   Haskell IDE in
        Windows?
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="utf-8"

I like the HEAT simple IDE for small one-file programs, which are common in 
introductory classes. (We made a few local changes and additions - happy to 
share.)

I also like using IntelliJ IDEA with Haskell plugin, and that is probably the 
most polished and best actual IDE. (The eclipse plugin is abandoned and 
depreciated.)

For larger projects, Leksah is good, although the documentation is sparse 
(IMHO), and it has a bit of a learning/setup curve.

----------------------------------------------------------------
-----Original Message-----
Sent: Wednesday, April 12, 2017 7:00 AM

Subject: Beginners Digest, Vol 106, Issue 4

   1.  What is the Best   Haskell IDE in Windows? (Frank Lugala)

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

Message: 2
Date: Wed, 12 Apr 2017 15:25:10 -0700
From: Patrick Pelletier <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] will GHC optimize pattern-matching on
        integers?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Suppose I am doing a pattern match on a large number of consecutive (or 
mostly-consecutive) integers:

foo 0 = something
foo 1 = somethingElse
...
foo 1000 = anotherThing

Will GHC optimize this to a table lookup, or is it going to test each 
integer in turn?  Am I better off using a Vector or Map instead of 
pattern matching?

Thanks,

--Patrick



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

Message: 3
Date: Thu, 13 Apr 2017 14:11:31 +0530
From: Rahul Muttineni <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] will GHC optimize pattern-matching on
        integers?
Message-ID:
        <canij+es1-5tu6qfecmwxudp-bpk9b4rqsw+-pqqlz6qo_np...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Patrick,

Yes, this will optimise to "a nice balanced tree of decisions with dense
jump tables in the leafs" [1]. You can check out the comments in [1] for
more details.

[1] https://github.com/ghc/ghc/blob/master/compiler/cmm/CmmSwitch.hs#L37

Hope that helps,
Rahul

On Thu, Apr 13, 2017 at 3:55 AM, Patrick Pelletier <[email protected]
> wrote:

> Suppose I am doing a pattern match on a large number of consecutive (or
> mostly-consecutive) integers:
>
> foo 0 = something
> foo 1 = somethingElse
> ...
> foo 1000 = anotherThing
>
> Will GHC optimize this to a table lookup, or is it going to test each
> integer in turn?  Am I better off using a Vector or Map instead of pattern
> matching?
>
> Thanks,
>
> --Patrick
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>



-- 
Rahul Muttineni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20170413/88ed1ac3/attachment-0001.html>

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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 106, Issue 5
*****************************************

Reply via email to