Hello, I cannot compile this custom Read instance. Do you know how to fix this? I have tried to import “Text.Read”, but this does not fix the error.
data Fruit = APPLE | ORANGE | OTHER deriving (Eq, Show)
instance Read Fruit where
read "APPLE" = APPLE
read "ORANGE" = ORANGE
read _ = OTHER
Compilation Error is:
‘read’ is not a (visible) method of class ‘Read’