Elm 0.17
This page concerns questions that arose with Elm version 0.17.
For general questions see the main FAQ page.
Contents
Where are the official documents about Elm version 0.17?
- A Farewell to FRP: Evan’s blog announcement of Elm 0.17.
- Upgrading to 0.17: The official upgrade guide.
- Introduction to Elm: The official guide to the Elm 0.17 language and core packages.
Others have written about the conversion as well:
Why does elm-make complain “Cannot find module ‘Basics’”?
You need to install the elm-lang/core package.
This often arises when upgrading a package from 0.16 after removing all dependencies from elm-package.json.
Where is the evancz/elm-html package?
It’s now at elm-lang/html. See the upgrade guide about this and other core packages that moved.
Where is Effects.task
?
It’s gone. Task.perform
is used instead.
See some examples of how to convert to Task.perform.
Why am I getting “TypeError: Elm.embed is not a function”?
The JavaScript code for calling the Elm entry point must now look like this:
Elm.MyApp.embed(someElement);
It used to look like Elm.embed(Elm.MyApp, someElement)
.
It’s similar for the fullscreen
and worker
functions.
What happened to all the core modules?
Many core modules have been moved out into separate packages, usually under elm-lang
.
Graphics
is now inevancz/elm-graphics
Trampoline
is now inelm-lang/trampoline
and has some renamesTrampoline.trampoline
is nowTrampoline.evaluate
Trampoline.Done
is nowTrampoline.done
(function instead of constructor)Trampoline.Continue
is nowTrampoline.jump
(function instead of constructor)
Mouse
is now inelm-lang/mouse
Window
is now inelm-lang/window
Keyboard
is now inelm-lang/keyboard
Also:
maxsnew/lazy
is nowelm-lang/lazy
What is now in elm-community?
NoRedInk/elm-lazy-list
is nowelm-community/elm-lazy-list
NoRedInk/elm-random-extra
is nowelm-community/random-extra
Random.Bool
has been removed as it is now inelm-lang/core
’sRandom
Random.Function
has been removed entirely
deadfoxygrandpa/elm-test
is nowelm-community/elm-test
- It no longer depends on
laszlopandy/elm-console
. To run tests in node use:ElmTest.runSuite
elementRunner
is gone, userunSuiteHtml
instead
- It no longer depends on
Why am I getting “cannot find module” errors while upgrading a project from 0.16?
Cached or obsolete/renamed package versions may be getting in the way. To get a clean start, try these (from simplest to most drastic):
- Remove all of elm-stuff.
- Remove all the package names from the
dependencies
section of elm-package.json and install packages again as needed. You may have to explicitly install elm-lang/core again. - Remove all of ~/.elm (on linux or Mac OSX) or ~/AppData/Roaming/elm/package (on Windows).
Does hot-reloading work in elm-reactor now?
Not yet. Work is well underway to improve elm-reactor.
Why does the compiler complain about “I am looking for one of the following things: whitespace” near the beginning of the file?
The exposing
clause is now required at the beginning of each module.
For example, you now need module Foo exposing (..)
where prior to Elm 0.17 you could use module Foo where
.
Are static ports still available?
No. In Elm 0.17 you’ll have to pass any static data from JS to Elm via the “flags” argument to the embed()
, fullscreen()
, or worker()
functions.
Why does elm-make report “I cannot find module ‘Graphics.Collage’” even though evancz/elm-graphics is installed?
You now need to do import Collage
to get that module. It’s no longer namespaced under Graphics
.