databrary-1: Databrary

Safe HaskellNone
LanguageHaskell2010

Model.Age

Synopsis

Documentation

newtype Age Source #

Constructors

Age 

Fields

  • ageDays :: Int

    Totals days constituting age. E.g. 1.5 years old = 548 days

Instances

Eq Age Source # 

Methods

(==) :: Age -> Age -> Bool #

(/=) :: Age -> Age -> Bool #

Ord Age Source # 

Methods

compare :: Age -> Age -> Ordering #

(<) :: Age -> Age -> Bool #

(<=) :: Age -> Age -> Bool #

(>) :: Age -> Age -> Bool #

(>=) :: Age -> Age -> Bool #

max :: Age -> Age -> Age #

min :: Age -> Age -> Age #

ToJSON Age Source # 

age :: Date -> Date -> Age Source #

subtract second date (usually current date) from first date (birthdate), convert difference into age

yearsAge :: Real a => a -> Age Source #

convert a fractional value of years into a count of days, building an Age object with that value

ageTime :: Age -> DiffTime Source #

convert total days spanning an Age value into the equivalent number of seconds (as a time interval)

ageLimit :: Age Source #

upper bound for allowed age values, intended for validation