- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Html exposing (..) | |
import Keyboard | |
import Window exposing (Size) | |
import AnimationFrame | |
import Task | |
import Html.App as App | |
import Collage exposing (..) | |
import Element exposing (..) |
What you need to do to install SDL is:
#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;
#install sdl image - if you want to display images
sudo apt install libjpeg-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;
#install sdl mixer - if you want sound
OlderNewer