module Indicator ( Indicator(..) , className , fromGlycemicLoad ) where import Prelude data Indicator = Good | Medium | Bad className :: Indicator -> String className Good = "good" className Medium = "medium" className Bad = "bad" fromGlycemicLoad :: Number -> Indicator fromGlycemicLoad n | n <= 8.0 = Good | n <= 20.0 = Medium | otherwise = Bad