This will calculate todays times of sunrise and sunset for a given location.
It currently uses hard coded location, but it is easy to change in the source and rebuild using "cabal build".
I have just used this exercise to learn Haskell. Might make it more generic later on.
sunrise-equation.cws is a Cantor/Octave worksheet I used to learn the algorithm before implementing in Haskell.
The sources of the algorithms I used:
Sunrise equation http://users.electromagnetic.net/bu/astro/sunrise-set.php
Julian days calculation https://en.wikipedia.org/wiki/Julian_day#Converting_Julian_or_Gregorian_calendar_date_to_Julian_Day_Number