func-level DCE | func-level DCE(kernel) | rename record/constructor | rename all | unwrap constructor | minify | |
---|---|---|---|---|---|---|
default | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
--optimize | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
--optimize + uglifyjs | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
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
const fs = require("fs"); | |
const fetch = require("node-fetch"); | |
const readline = require("readline"); | |
run().catch(err => { | |
console.error(err.message); | |
process.exit(1); | |
}); | |
async function run() { |
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 = |