Tinkering with new technologies or ideas is a fun & efficient way to become a better software engineer. At comSysto we acknowledge this by providing lab days.
Harvest is a tool we use for hour tracking & invoice creation. It’s tedious to calculate your overtime hours but luckily for us harvest offers an API and we happen to be programmers.
Currently harvest-overtime runs in “production” on a github-page and can be accessed by anyone with a comSysto account. You can check the overtime hours for the last four years and customize your weekly working hours.
SO, WHY ELM?
If you’ve already read about Elm you have probably heard some praising about its error messages; to sum it up, everything is true. I’ve never seen better ones. I hope that other languages, libraries and frameworks get inspired to improve their errors, too. Just have a look at these two examples:
But it does not stop there. Elm’s Type system catches a lot of bugs before your program even starts. You’ll get an easy introduction to functional programming without mentioning any complex functional abstraction (looking at you Monad), while profiting of all the good things e.g. immutability, predictability and composability.
LIBRARY CREATION HARVEST-API
Being good OSS citizens we have separated a harvest-api library from our main harvest-overtime project and published it to elm-package. The library wraps the harvest REST API and removes the need for decoding if you want to built something on top of harvest.
Publishing Elm packages is not really complicated. You can find all instructions here. Please read it but the most important takeaways are:
- Have a proper README.md
- Create decent docs for your library as described in elm-package documentation. You can preview the docs with this nice tool
- Tag your library (e.g. git tag -a 1.0.0 -m "release notes" and git push --tags) and make sure that the version in elm-package.json matches the label. When this is done the only thing left is to publish the library with elm-package publish. That would be it ;-)
FUTURE WORK & REPO
If this blog post got your interest on Elm, we’re looking forward to your issues and pull requests for harvest-overtime and harvest-api. Or maybe you decide to work with us as a new employee or customer.
We’d like to thank the harvest team for their help creating harvest-api and their attributions to us on their page.