Gmail Calendar Documents Web Reader more »
Recently Visited Groups | Help | Sign in
Google Groups Home
enumerations
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
LAca  
View profile  
 More options Feb 11, 9:19 am
Newsgroups: comp.lang.haskell
From: LAca <rizso...@gmail.com>
Date: Thu, 11 Feb 2010 06:19:54 -0800 (PST)
Local: Thurs, Feb 11 2010 9:19 am
Subject: enumerations
hello All,

i tried to tune up my little application, and have found this page:

  http://www.haskell.org/haskellwiki/Performance/Data_types#Enumerations

but the example does not even compile for me. anyone could give me a
hint how to write enumeration shortly?

thanks,
Laszlo


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ertugrul Söylemez  
View profile  
 More options Feb 11, 11:15 am
Newsgroups: comp.lang.haskell
From: Ertugrul Söylemez <e...@ertes.de>
Date: Thu, 11 Feb 2010 17:15:20 +0100
Local: Thurs, Feb 11 2010 11:15 am
Subject: Re: enumerations

LAca <rizso...@gmail.com> wrote:
> i tried to tune up my little application, and have found this page:

>   http://www.haskell.org/haskellwiki/Performance/Data_types#Enumerations

> but the example does not even compile for me. anyone could give me a
> hint how to write enumeration shortly?

The examples there seem to work fine.  But first you should consider
whether you need such a hacky optimization.  Perhaps serialization is
what you need.

Greets
Ertugrul

--
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://blog.ertes.de/


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dirk Thierbach  
View profile  
 More options Feb 11, 11:30 am
Newsgroups: comp.lang.haskell
From: Dirk Thierbach <dthierb...@usenet.arcornews.de>
Date: Thu, 11 Feb 2010 17:30:55 +0100
Local: Thurs, Feb 11 2010 11:30 am
Subject: Re: enumerations

LAca <rizso...@gmail.com> wrote:
> i tried to tune up my little application, and have found this page:

>  http://www.haskell.org/haskellwiki/Performance/Data_types#Enumerations

> but the example does not even compile for me.

You have to add a pragma:

  {-# LANGUAGE GeneralizedNewtypeDeriving #-}

  newtype Color = Color Int deriving (Eq,Ord,Enum)

  (red:blue:black:_) = [Color 1 ..]

*Main> :t red
red :: Color

But I doubt that this will increase the performance a lot. If you do
a bit of profiling, you'll probably find other places to optimize, with
better payoff.

- Dirk


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
LAca  
View profile  
 More options Feb 12, 4:54 am
Newsgroups: comp.lang.haskell
From: LAca <rizso...@gmail.com>
Date: Fri, 12 Feb 2010 01:54:39 -0800 (PST)
Local: Fri, Feb 12 2010 4:54 am
Subject: Re: enumerations
On Feb 11, 5:30 pm, Dirk Thierbach <dthierb...@usenet.arcornews.de>
wrote:

Thanks Dirk, it has helped!

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google