1. Thijs Alkemade
  2. haskell-unittyped

Commits

Thijs Alkemade  committed 97298ed

Added months.

  • Participants
  • Parent commits c0b1391
  • Branches default

Comments (0)

Files changed (1)

File src/UnitTyped/SI/Derived.hs

View file
  • Ignore whitespace
 	factor _ = 365.2425 * 24 * 60 * 60
 	showunit _ _ = "yr"
 
+data Month
+type Months = (Fractional f) => Value f TimeUnit Month
+
+instance Convertable TimeUnit Month where
+	factor _ = (365.2425 * 24 * 60 * 60) / 12
+	showunit _ _ = "month"
+
 data JulianYear
 type JulianYears = (Fractional f) => Value f TimeUnit JulianYear
 
 julianyear :: (Fractional f) => Value f TimeUnit JulianYear
 julianyear = one
 
+month :: (Fractional f) => Value f TimeUnit Month
+month = one
+
 herz :: (Fractional f) => Value f (UnitCons Time (Neg One) UnitNil) Herz
 herz = one