I made these custom data types:
data BakedGoods = Muffin
| Croissant
| Cookie
deriving (Eq, Show)
data Muffin = Blueberry
| SaltedCaramel
| Cheesecake
then I tried to use them in a function that returns the price of the BakedGoods:
price :: BakedGoods -> Int
price a
| a == Blueberry = 2
[...]
and I keep getting this error:
Couldn't match expected type ‘BakedGoods’ with actual type ‘Muffin’
I get the point but unfortunately I have no idea how to fix it, do you have any ideas? :)