aboutsummaryrefslogtreecommitdiff
path: root/src/Indicator.purs
blob: 39a98cab4b2742601b57c3a3770edfedfe577bf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Indicator
  ( Indicator(..)
  , fromGlycemicLoad
  ) where

import Prelude

data Indicator = Good | Medium | Bad

instance showIndicator :: Show Indicator where
  show Good = "Good"
  show Medium = "Medium"
  show Bad = "Bad"

fromGlycemicLoad :: Number -> Indicator
fromGlycemicLoad n
  | n <= 10.0 = Good
  | n < 20.0 = Medium
  | otherwise = Bad