module Indicator ( Indicator(..) , fromGlycemicIndex ) where import Prelude data Indicator = Good | Medium | Bad instance showIndicator :: Show Indicator where show Good = "Good" show Medium = "Medium" show Bad = "Bad" fromGlycemicIndex :: Int -> Indicator fromGlycemicIndex n | n < 40 = Good | n < 55 = Medium | otherwise = Bad