I have:
data Color = Blue | Green | Red | White | Yellow deriving (Eq,Ord)
And then
data Term = Color | ...
data Bag = Bag {
color :: Color
...
}
Now I want to be able to pattern match to make sure that the term given is a Color and if so check it's "value" (Blue/Green...). Something like this:
func :: Term -> Bag -> Bool
func (c :: Color) bag = (color bag) == c
But (c :: Color) does not seem to work.