moduleNextHappyYearTestexposing(suite)importExpectexposing(equal)importNextHappyYearexposing(nextHappyYear)importTestexposing(Test,describe,test)suite:Testsuite=describe"Next happy year"[test"It should return 7712 when passing 7801"<|\_->equal7801<|nextHappyYear7712,test"It should return 1001 when passing 1023"<|\_->equal1023<|nextHappyYear1001,test"It should return 2019 when passing 2018"<|\_->equal2019<|nextHappyYear2018]
Edit
Just realized there is a native Set module in Elm by looking at the comments made in JavaScript which is awesome, but I'll keep this as is for the record. I'm edgy anyway!
Edit2
Turns out, after an interesting talk with the folks at the Elm Slack, and some experimentations, there is no way to to Set that keeps the order of the List due to the Haskell implementation behind, preventing to have an easy solution. So this means either use an extra library (which I tend to avoid since I wanted to show a native Elm solution) or use a combination just like I did!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Elm
Tests
Edit
Just realized there is a native Set module in Elm by looking at the comments made in JavaScript which is awesome, but I'll keep this as is for the record. I'm edgy anyway!
Edit2
Turns out, after an interesting talk with the folks at the Elm Slack, and some experimentations, there is no way to to
Set
that keeps the order of theList
due to the Haskell implementation behind, preventing to have an easy solution. So this means either use an extra library (which I tend to avoid since I wanted to show a native Elm solution) or use a combination just like I did!