Sha256: a1b7f4518335e9a4578798c5852e0191a9e7faf3cfbffcc769fe9280b8eb5343
Contents?: true
Size: 652 Bytes
Versions: 396
Compression:
Stored size: 652 Bytes
Contents
module SpaceAge (Planet(..), ageOn) where data Planet = Mercury | Venus | Earth | Mars | Jupiter | Saturn | Uranus | Neptune type Seconds = Double type Years = Double ageOn :: Planet -> Seconds -> Years ageOn planet seconds = seconds / secondsPerYear planet secondsPerYear :: Planet -> Seconds secondsPerYear planet = earthYear * case planet of Mercury -> 0.2408467 Venus -> 0.61519726 Earth -> 1 Mars -> 1.8808158 Jupiter -> 11.862615 Saturn -> 29.447498 Uranus -> 84.016846 Neptune -> 164.79132 where earthYear = 365.25 * 24 * 60 * 60
Version data entries
396 entries across 396 versions & 1 rubygems