-- Leo's gemini proxy

-- Connecting to republic.circumlunar.space:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

My experience upgrading to Elm 0.19


Elm is unstable, so upgrading to the next version can be painful. Here's what I needed to do to upgrade from 0.18 to 0.19.


Replace elm-package.json and tests/elm-package.json with elm.json - e06f5a1728

Switch to the new elm-test - b964b7c7a

Re-arrange Main, and how we call it from JavaScript - 0c118c49f

Stop using eeue56/elm-all-dict (since it's not ported to 0.19 and porting it looked hard due to a lack of Debug.crash) - fe100f256

Replace toString with String.fromX or Debug.toString - 9e78163d0a3

Stop "shadowing" names by making new variables with the same name as another in the scope - 9688a621de

Adapt to the changed Html.style function - b991ab4f

Stop using Debug.crash - f98a70ad1

Adapt to the changes in the Regex module - 856762a4

Stop using tuples with more than 3 parts - 472c0bb7


e06f5a1728

the new elm-test

b964b7c7a

0c118c49f

eeue56/elm-all-dict

fe100f256

9e78163d0a3

9688a621de

b991ab4f

f98a70ad1

856762a4

472c0bb7


The lack of Debug.crash is really, really painful, especially for a library like eeue56/elm-all-dict that has lots of invariants that are hard or impossible to enforce via the type system. On the other hand, if Elm can give a hard guarantee that there will be no runtime errors, this seems pretty cool. The problem is that some code may well have to return the wrong answer silently, instead of crashing, which could be much worse than crashing in some use-cases.


I was annoyed by the lack of more-than-3-part tuples, but even as I did the work to change my code, I saw it get better, so it's hard to argue with.


eeue56/elm-all-dict


The hardest part to work out was how to run the tests. Fortunately the tests themselves needed almost no changes. I just needed to do this:


rm -r tests/elm-stuff
rm tests/elm-package.json
sudo npm install -g elm-test@0.19.0-beta8
elm-test install
elm-test


My next job is to check out the --optimize compiler flag, and the advice on making the code smaller and faster.


Originally posted at 2018-09-12 00:45:28+00:00. Automatically generated from the original post : apologies for the errors introduced.


advice on making the code smaller and faster

original post

-- Response ended

-- Page fetched on Sun May 19 04:23:43 2024