-
-
Save dmjio/553bfca04ffb25efa893d4a4950ede6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SpaceAge | |
( Planet (..) | |
, ageOn | |
) where | |
data Planet | |
= Mercury | |
| Venus | |
| Earth | |
| Mars | |
| Jupiter | |
| Saturn | |
| Uranus | |
| Neptune | |
ageOn | |
:: Planet | |
-> Float | |
-> Float | |
ageOn Earth seconds = seconds / 31557600 | |
ageOn Venus seconds = ageOn Earth seconds / 0.61519726 | |
ageOn Mercury seconds = ageOn Earth seconds / 0.2408467 | |
ageOn Mars seconds = ageOn Earth seconds / 1.8808158 | |
ageOn Jupiter seconds = ageOn Earth seconds / 11.862615 | |
ageOn Saturn seconds = ageOn Earth seconds / 29.447498 | |
ageOn Uranus seconds = ageOn Earth seconds / 84.016846 | |
ageOn Neptune seconds = ageOn Earth seconds / 164.79132 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment