If I want to use Platform.Sub.map, do I need to import it?
Platform.Sub
and are Platform.Cmd
imported by default like Sub
and Cmd
, so you need to omit Platform.
-part.
Also worth noting is that Platform
, Platform.Sub
and Platform.Cmd
- all the different modules, that is, if they were not imported by default, and you just imported Platform
, you still will not be able to access Sub
and Cmd
with a prefix Platform.
. This is more obvious if you look at the source for the main package (in particular Platform.elm
and Platform/
).
source to share