Lukasz Gsior ELM no runtime exceptions technology ukasz
- Slides: 35
Lukasz Gąsior ELM - "no runtime exceptions technology"
Łukasz Gąsior • gasior. net. pl • @lukaszgasior • JSUpskill
Agenda • Język • Ekosystem • The Elm Architecture • Demo
elm • Język funkcyjny kompilowany do Java. Script • + framework • 2012 by Evan Czaplicki • Aktualna wersja 0. 18 • Instalujemy przez npm • http: //elm-lang. org
elm • Strong static types • No runtime errors • No nulls • No undefined is not a function • Immutability • Friendly error messages
funkcje is. Negative n = n<0 is. Negative 4
funkcje is. Negative n = n<0 is. Negative 4 is. Negative (-3 * -4(
currying add x y z = x+y+z add 1 2 3 6 : number
currying add x y z = x+y+z add 1 2
currying add x y z = x+y+z add 1 2 <function> : number -> number
currying double n = n*2 double. Numbers list = List. map double lists
currying double n = n*2 double. Number list = List. map double lists double. Number = List. map double
piping add 1 (multiply 2 3) sum (filter (is. Over 100) (map get. Cost records))
piping add 1 (multiply 2 3) 3 3 |> multiply 2 |> add 1 |> multiply 2 3 |> add 1 (multiply 2 3)
piping sum (filter (is. Over 100) (map get. Cost records)) records |> map get. Cost |> filter (is. Over 100) |> sum records |> map get. Cost records |> filter (is. Over 100) (map get. Cost records) |> sum (filter (is. Over 100) (map get. Cost records))
typy add : Int -> Int add x y z = x+y+z is. True : Bool is. True = True map : (a -> b) -> List a -> List b List. map
tuples val 1 = (1, 2) val 2 = , 1)True, 'a([], ' Tuple. first val 1
records point = { x = 3, y = 4 } type alias Point = { x : Int , y : Int } func 1: Point -> Bool
records user= { name = “Lukasz”, is. Active= True } type alias User = { name : String , is. Active : Bool } . name user Users |> List. map. name
records - immutable user= { name = “Lukasz”, is. Active= True } disable user = {user | is. Active = False}
union types type List = Empty | Node Int List
Maybe type Maybe a = Just a | Nothing
Maybe divide : number -> Maybe Float divide x y = if y == 0 then Nothing else Just (x / y)
Maybe case divide 6 3 of Just n -> “Result is ” ++ (to. String n) Nothing -> “No Result”
Maybe case divide 6 3 of Just n -> “Result is ” ++ (to. String n) ERROR!!!
Ekosystem • elm-make • elm-repl • elm-package • elm-reactor
elm-make
elm-make
elm-make
elm-make
elm-package
The Elm Architecture
DEMO
Dziękuję za uwagę! Łukasz Gąsior @lukaszgasior http: //gasior. net. pl
- Gsior
- Ethan blanton ub
- Daria lukasz
- Attitudes examples
- Evan elm
- Cucm enhanced license
- Elm model
- Elm
- Elm consumer behavior
- Elm consumer behavior
- Elaboration likelihood model
- Qqalot
- Elm pollen color
- Elm theory
- Elm tükənməz xəzinədir haqqında inşa
- Elm programming language
- Octet rule exceptions
- Cave of unreported exceptions
- Exception handler php
- Imparfait exceptions
- Shouldn't question tag
- Stark law exceptions
- Apa itu robustness
- Differential diagnosis of jaundice in pediatrics
- Comparative and superlative of bad
- Superlatives exceptions
- Xnxn horse
- Exception of koch postulates
- Mendel's law exceptions
- Berry amendment
- Present continuous exceptions
- Non predefined exceptions in oracle
- Stark law exceptions
- Custom exceptions in java
- Fajans rule pronunciation
- What is microbiology