A small cheatsheet to help you translate between Haskell and Elm style imports.
Elm | Haskell |
---|---|
import Foo.Bar |
import qualified Foo.Bar |
import Foo.Bar as Bar |
import qualified Foo.Bar as Bar |
import Foo.Bar exposing (foo) |
import Foo.Bar (foo) |
import Foo.Bar exposing (..) |
import Foo.Bar |
Elm does not have anything like hiding |
import Foo.Bar hiding (foo) |
You should generally avoid polluting the namespace of a module using exposing (..)
or the Haskell equivalent. When you have multiple imports of this style, it can make it harder to track down where certain symbols are coming from. Some common exceptions are making use of a specific DSL (like Html
or Css
in Elm), or using a different prelude in Haskell (like protolude
).