
10 Oct
2007
10 Oct
'07
8 a.m.
Michael Vanier wrote:
Is there an implementation of a symbol type in Haskell i.e. a string which has a constant-time comparison operation?
Stefan O'Rear wrote:
Yes, I beleive GHC uses one (utils/FastString.lhs iirs)
In some cases where you would need that in other languages, you would use an algebraic data type in Haskell, e.g.: data Color = Red | Orange | Yellow | Green | Blue | Purple deriving (Eq, Show) -Yitz