aboutsummaryrefslogtreecommitdiff
path: root/src/Indicator.purs
blob: 536133dcab8badb8fa7ea0163299349c0ca15c83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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