New import syntax with keyword exposing.
- Move
Httptoelm-httppackage and totally redo API - Remove
WebSocketmodule - Add
Taskmodule
Graphics.Input now works with this API (from module Signal):
type alias Mailbox a = { address : Address a, signal : Signal a }
mailbox : a -> Mailbox aYou can then send messages to the Address with functions like Signal.send
and Signal.message, or create forwarding addresses with Signal.forwardTo.
Graphics.Collage now has two new functions:
text : Text -> Form
outlinedText : LineStyle -> Text -> FormThese functions render text with the canvas, making things quite a bit faster.
The underlying implementation of Text has also been improved dramatically.
- Change types of
head,tail,maximum,minimumby wrapping output inMaybe - Move
leftAligned,centered,rightAlignedfromTexttoGraphics.Element - Move
asTextfromTexttoGraphics.Element, renaming it toshowin the process - Remove
Text.plainText(can be replaced byGraphics.Element.leftAligned << Text.fromString) - Change type of
Keyboard.keysDownfromSignal (List KeyCode)toSignal (Set KeyCode) - Remove
Keyboard.directions - Rename
Keyboard.lastPressedtoKeyboard.presses
- Keyword
typebecomestype alias - Keyword
databecomestype - Remove special list syntax in types, so
[a]becomesList a
The set of default imports has been reduced to the following:
import Basics (..)
import Maybe ( Maybe( Just, Nothing ) )
import Result ( Result( Ok, Err ) )
import List ( List )
import Signal ( Signal )- Added
Json.DecodeandJson.Encodelibraries
-
Rename
String.showtoString.toString -
Replace
List.zipwithList.map2 (,) -
Replace
List.zipWith fwithList.map2 f -
Rename
Signal.liftNtoSignal.mapN -
Rename
Signal.mergestoSignal.mergeMany
- Revamp
Inputconcept asSignal.Channel - Remove
Signal.count - Remove
Signal.countIf - Remove
Signal.combine
- No longer signal-based
- Use a
Generatorto create random values
-
Add the following functions to
MaybewithDefault : a -> Maybe a -> a oneOf : List (Maybe a) -> Maybe a map : (a -> b) -> Maybe a -> Maybe b andThen : Maybe a -> (a -> Maybe b) -> Maybe b -
Remove
Maybe.maybesomaybe 0 sqrt NothingbecomeswithDefault 0 (map sqrt Nothing) -
Remove
Maybe.isJustandMaybe.isNothingin favor of pattern matching -
Add
Resultlibrary for proper error handling. This is for cases when you want a computation to succeed, but if there is a mistake, it should produce a nice error message. -
Remove
Eitherin favor ofResultor custom union types -
Revamp functions that result in a
Maybe.- Remove
Dict.getOrElseandDict.getOrFailin favor ofwithDefault 0 (Dict.get key dict) - Remove
Array.getOrElseandArray.getOrFailin favor ofwithDefault 0 (Array.get index array) - Change
String.toInt : String -> Maybe InttoString.toInt : String -> Result String Int - Change
String.toFloat : String -> Maybe FloattoString.toFloat : String -> Result String Float
- Remove
-
Add the following functions to
Text:empty : Text append : Text -> Text -> Text concat : [Text] -> Text join : Text -> [Text] -> Text -
Make the following changes in
List:- Replace
(++)withappend - Remove
join
- Replace
- Rename
Text.toTexttoText.fromString