There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.
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
const first = new Promise(resolve => { | |
console.log("First finished."); | |
resolve(); | |
}); | |
const secondWithError = new Promise((resolve, reject) => reject("Second failed")); | |
const third = new Promise(resolve => { | |
setTimeout((() => { | |
console.log("Third finished"); |
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
brew update | |
brew cask install java | |
brew cask install jce-unlimited-strength-policy | |
export JAVA_HOME=`/usr/libexec/java_home -v 1.8` |
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
/* VT100 terminal reset (<ESC>c) */ | |
console.log('\033c'); | |
/* numbers comparations */ | |
> '2' == 2 | |
true | |
> '2' === 2 |
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
module Main exposing (..) | |
import Html exposing (Html, div, text) | |
import Html.App as App | |
import Keyboard exposing (KeyCode, presses) | |
type Msg | |
= KeyPressed KeyCode |
Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !
myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
let
(a,b,c) = myTuple