This file contains hidden or 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
-- Main.elm -> добавляем "port" | |
port module Main exposing (main) | |
-- ... | |
-- добавляем команду | |
port sendDataToJs : String -> Cmd msg | |
-- update функция | |
case msg of |
This file contains hidden or 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 Asset exposing (Image, src, waterfall) | |
import Html exposing (Attribute) | |
import Html.Attributes as Attr | |
type Image | |
= Image String | |
This file contains hidden or 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
-- Question модуль | |
module Question exposing ( History(..) ) | |
type History = | |
History | |
{ previous : List Question | |
, current : Question | |
, remaining : List Question | |
} | |
This file contains hidden or 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
-- zip list структура | |
-- обернутая в custom type с одним вариантом | |
type History = | |
History | |
{ previous : List Question | |
, current : Question | |
, remaining : List Question | |
} | |
-- следовательно, для работы придется использовать case |
This file contains hidden or 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
-- было | |
type alias Stylesheet = | |
{ declarations: List Declaration } | |
-- стало | |
type alias Stylesheet = | |
{ charset : Maybe String | |
, imports : List Import | |
, namespaces : List Namespace | |
, declarations : List Declaration |
This file contains hidden or 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
navLink : Page -> String -> String -> Html msg |
This file contains hidden or 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
abc : number1 -> number2 -> numberWtf |
This file contains hidden or 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
testSlider : String -> (Int -> Msg) -> (Model -> Int) -> Test | |
-- То что вернули `Test` - условие примера. | |
-- SlidNoise = (Int -> Msg), | |
-- так как SlidNoise **кастомный тип** | |
-- и в тоже время **функция-контруктор**, | |
-- которая принимает Int и возвращает Msg). | |
-- .noise = ( Model -> Int ), |
This file contains hidden or 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
Result.map : (a -> b) -> Result x a -> Result x b |
This file contains hidden or 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
List.map : (a -> b) -> List a -> List b |