> 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
Thanks Dirk, it has helped!