Hi,

Using Show it is possible to establish a relationship between an enum type

data Color
    = Red
    | Blue
    | Green
    | Yellow
    | Orange
    | Brown
    | White
    | Black
    deriving (Show, Eq, Enum, Bounded)

and a String type to display it.

*Main> Red
Red
*Main> [Red,Green,Blue]
[Red,Green,Blue]
*Main>

which is

Red :: Color -> "Red" :: [Char]

Can one as easily establish a reverse relationship, i.e., convert a String type like "Red" back to its corresponding Color type?

So that

"Red" :: [Char] -> Red :: Color


Michael