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

Plan A Website Revamp For 2019

Lower Subordinate

Building and controlling a smart connected Home using Telegram and NodeMCU ESP32 .

DBook Platform | Second IDO on CrossPad

Flutter TODO APP With GetX

Generating Code from Xcode Configurations

Agile, An Answer For Everchanging Industry

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

The power of JavaScript’s Intl.NumberFormat

Supercharge your app with runtime type-checking using ZOD

Micro Frontend Architecture: What It Is, Why It Matters, and What are the Benefits?

Micro Frontend Architecture: What It Is, Why It Matters, and What are the Benefits?

“Flat” Promises for Reactive Code