Nutri-0.1: A little library to calculate nutrition values of food items.

Safe HaskellSafe-Inferred

Data.Nutrition.Macros

Synopsis

Documentation

data Macros Source

The macro nutrients are Protein, Carbohydrate and Fat. They are stored within a triple that is called Macros.

Constructors

Macros (Protein, Carb, Fat) 

prot :: Macros -> PercentSource

prot, carb and fat are functions that return the percent of that macro nutrient. They are basically getters of the Macros data.

carb :: Macros -> PercentSource

prot, carb and fat are functions that return the percent of that macro nutrient. They are basically getters of the Macros data.

fat :: Macros -> PercentSource

prot, carb and fat are functions that return the percent of that macro nutrient. They are basically getters of the Macros data.

newMacros :: (Protein, Carb, Fat) -> MacrosSource

newMacros is a smart constructor to Macros. It checks, whether the sum of the percentages is equal or below 100%. Otherwise it does not construct a Macros value.