Program | .html | .js | embed | flags | port | file |
---|---|---|---|---|---|---|
Html.node | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
Browser.sandbox | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
Browser.element | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Browser.document | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
Browser.application | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ |
Platform.worker | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
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 Return exposing | |
( Return | |
, map | |
, return | |
, toTuple | |
, withCommand | |
, withTask | |
) | |
import Http |
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
json = """{ "name": "tom", "age": 42 }""" | |
decodeString (maybe (field "age" int )) json -- Ok (Just 42) | |
decodeString (maybe (field "name" int )) json -- Ok Nothing | |
decodeString (maybe (field "height" float)) json -- Ok Nothing | |
decodeString (maybe (field "height" float)) "null" -- Ok Nothing | |
decodeString (maybe (field "height" float)) "\"hello\"" -- Ok Nothing | |
decodeString (maybe (field "height" float)) "" -- Err ... | |
decodeString (field "age" (maybe int )) json -- Ok (Just 42) |
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 Tuple3 exposing (..) | |
get1and2 : ( a, b, c ) -> ( a, b ) | |
get1and2 ( a, b, c ) = | |
( a, b ) | |
get2and3 : ( a, b, c ) -> ( b, c ) | |
get2and3 ( a, b, c ) = |
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
# make sure every time only one file is re-compiled | |
echo "time\t\tlines\timports\tfile" | |
for f in `find src -name *.elm` | |
do | |
elm-make $f --output=/dev/null > /dev/null | |
sleep 1 | |
touch $f | |
a=`wc -l $f | awk '{print $1}'` |
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 Util.HttpUtil exposing (..) | |
import Task exposing (..) | |
import Http exposing (..) | |
import Json.Decode as D exposing (Decoder) | |
import Json.Encode as E | |
encodeHeaders : List ( String, String ) -> E.Value | |
encodeHeaders headers = |
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"description": "A representation of a person, company, organization, or place", | |
"type": "object", | |
"required": ["familyName", "givenName"], | |
"properties": { | |
"fn": { | |
"description": "Formatted Name", | |
"type": "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
module JsxParser | |
exposing | |
( JSXElement | |
, JSXAttribute | |
, JSXAttributeValue(..) | |
, JSXChild(..) | |
, run | |
) | |
{- JSX Parser |