Time in Elm

Photo by Mitchell Hollander on Unsplash

Handling time in Elm seems to be a scaring thing for beginners.

In Elm is not possible to have a function that return the present time because that would not be a pure function and all functions must be pure.

Such a function is not pure because the output is different every time we call it while pure function need to always return the same output given the same arguments.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

HOW TO GET SSR HEROES AND SR HEROES WITH MINIMUM INVESTMENT ON NFT BOX.

Don’t assume simple features are going to be simple in development

Building an App: Maintenance

Google Cloud Platform (GCP) vs. Amazon Web Services (AWS) for the Hobbyist

Pigeonhole algorithm

SQL Server in the Google Cloud

CTO Niranjan Paranjape discusses GoJek, codifying complexity and what’s next for tech at Jiva

How to Find and Hire Fintech Developers: 3 common options

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lucamug

Lucamug

Bio

More from Medium

Breakdown: Fetch() Method

SIX SUPER-POWERS OF VITE

Taking local storage values from one HTML and retrieving it on another!

code snippet fetching our data from the response from API. Gives us carbon emissions and flight distance based on airport input

Bootstrap a frontend project with Primereact and Typescript