- Types are declared with
:
and not::
, and the consing operator conversely is::
instead of:
- No
where
clauses, onlylet/in
- The standard style is different, check http://elm-lang.org/docs/style-guide for reference
- Multiline strings are a thing with
"""
- Haskell's
data
corresponds totype
in Elm, and also, Haskell'stype
corresponds to Elm'stype alias
($)
is(<|)
, but you don't use it all that much – Elm people like the flipped operator(|>)
which lets you build something that reads like a pipeline- Related: Backticks will likely die soon in favour of functions that have an argument order that lends itself to pipelining with
(|>)
- Also,
(.)
is(<<)
, and a flipped version(>>)
exists, but I don't see it used that much either (>>=)
is not an available operator and would not be polymorphic (no typeclasses, see below), and is instead commonly namedSomeType.andThen
– e.g.Maybe.andThen : Maybe a -> (a -> Maybe b) -> Maybe b
- Records are nicer and more powerful, and also extensible at the type level, see http://elm-lang.org/docs/records
- No guards and no pattern matching over multiple function definitions
- No typeclasses and higher-kinded types
- It's a strict language and e.g. infinite lists are not supported in
Core
Last active
April 2, 2022 09:19
-
-
Save cobalamin/c1b83f5626df1409b512ce2faf05cf84 to your computer and use it in GitHub Desktop.
Elm (0.17) syntax and functionality differences for Haskell programmers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment