├── .gitignore ├── README.md ├── config ├── config.exs ├── dev.exs ├── prod.exs └── test.exs ├── elm-package.json ├── elm-stuff ├── build-artifacts │ └── 0.16.0 │ │ ├── elm-lang │ │ └── core │ │ │ └── 3.0.0 │ │ │ ├── Array.elmi │ │ │ ├── Array.elmo │ │ │ ├── Basics.elmi │ │ │ ├── Basics.elmo │ │ │ ├── Bitwise.elmi │ │ │ ├── Bitwise.elmo │ │ │ ├── Char.elmi │ │ │ ├── Char.elmo │ │ │ ├── Color.elmi │ │ │ ├── Color.elmo │ │ │ ├── Date.elmi │ │ │ ├── Date.elmo │ │ │ ├── Debug.elmi │ │ │ ├── Debug.elmo │ │ │ ├── Dict.elmi │ │ │ ├── Dict.elmo │ │ │ ├── Graphics-Collage.elmi │ │ │ ├── Graphics-Collage.elmo │ │ │ ├── Graphics-Element.elmi │ │ │ ├── Graphics-Element.elmo │ │ │ ├── Graphics-Input-Field.elmi │ │ │ ├── Graphics-Input-Field.elmo │ │ │ ├── Graphics-Input.elmi │ │ │ ├── Graphics-Input.elmo │ │ │ ├── Json-Decode.elmi │ │ │ ├── Json-Decode.elmo │ │ │ ├── Json-Encode.elmi │ │ │ ├── Json-Encode.elmo │ │ │ ├── Keyboard.elmi │ │ │ ├── Keyboard.elmo │ │ │ ├── List.elmi │ │ │ ├── List.elmo │ │ │ ├── Maybe.elmi │ │ │ ├── Maybe.elmo │ │ │ ├── Mouse.elmi │ │ │ ├── Mouse.elmo │ │ │ ├── Random.elmi │ │ │ ├── Random.elmo │ │ │ ├── Regex.elmi │ │ │ ├── Regex.elmo │ │ │ ├── Result.elmi │ │ │ ├── Result.elmo │ │ │ ├── Set.elmi │ │ │ ├── Set.elmo │ │ │ ├── Signal.elmi │ │ │ ├── Signal.elmo │ │ │ ├── String.elmi │ │ │ ├── String.elmo │ │ │ ├── Task.elmi │ │ │ ├── Task.elmo │ │ │ ├── Text.elmi │ │ │ ├── Text.elmo │ │ │ ├── Time.elmi │ │ │ ├── Time.elmo │ │ │ ├── Touch.elmi │ │ │ ├── Touch.elmo │ │ │ ├── Trampoline.elmi │ │ │ ├── Trampoline.elmo │ │ │ ├── Transform2D.elmi │ │ │ ├── Transform2D.elmo │ │ │ ├── Window.elmi │ │ │ ├── Window.elmo │ │ │ └── graph.dat │ │ ├── evancz │ │ ├── elm-html │ │ │ └── 4.0.2 │ │ │ │ ├── Html-Attributes.elmi │ │ │ │ ├── Html-Attributes.elmo │ │ │ │ ├── Html-Events.elmi │ │ │ │ ├── Html-Events.elmo │ │ │ │ ├── Html-Lazy.elmi │ │ │ │ ├── Html-Lazy.elmo │ │ │ │ ├── Html.elmi │ │ │ │ ├── Html.elmo │ │ │ │ └── graph.dat │ │ └── virtual-dom │ │ │ └── 2.1.0 │ │ │ ├── VirtualDom.elmi │ │ │ ├── VirtualDom.elmo │ │ │ └── graph.dat │ │ └── user │ │ └── project │ │ └── 1.0.0 │ │ ├── Todo.elmi │ │ └── Todo.elmo ├── exact-dependencies.json └── packages │ ├── elm-lang │ └── core │ │ └── 3.0.0 │ │ ├── .eslintrc │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── changelog.md │ │ ├── elm-package.json │ │ ├── src │ │ ├── Array.elm │ │ ├── Basics.elm │ │ ├── Bitwise.elm │ │ ├── Char.elm │ │ ├── Color.elm │ │ ├── Date.elm │ │ ├── Debug.elm │ │ ├── Dict.elm │ │ ├── Graphics │ │ │ ├── Collage.elm │ │ │ ├── Element.elm │ │ │ ├── Input.elm │ │ │ └── Input │ │ │ │ └── Field.elm │ │ ├── Json │ │ │ ├── Decode.elm │ │ │ └── Encode.elm │ │ ├── Keyboard.elm │ │ ├── List.elm │ │ ├── Maybe.elm │ │ ├── Mouse.elm │ │ ├── Native │ │ │ ├── Array.js │ │ │ ├── Basics.js │ │ │ ├── Bitwise.js │ │ │ ├── Char.js │ │ │ ├── Color.js │ │ │ ├── Date.js │ │ │ ├── Debug.js │ │ │ ├── Graphics │ │ │ │ ├── Collage.js │ │ │ │ ├── Element.js │ │ │ │ └── Input.js │ │ │ ├── Json.js │ │ │ ├── Keyboard.js │ │ │ ├── List.js │ │ │ ├── Mouse.js │ │ │ ├── Port.js │ │ │ ├── Regex.js │ │ │ ├── Runtime.js │ │ │ ├── Signal.js │ │ │ ├── String.js │ │ │ ├── Task.js │ │ │ ├── Text.js │ │ │ ├── Time.js │ │ │ ├── Touch.js │ │ │ ├── Transform2D.js │ │ │ ├── Utils.js │ │ │ └── Window.js │ │ ├── Random.elm │ │ ├── Regex.elm │ │ ├── Result.elm │ │ ├── Set.elm │ │ ├── Signal.elm │ │ ├── String.elm │ │ ├── Task.elm │ │ ├── Text.elm │ │ ├── Time.elm │ │ ├── Touch.elm │ │ ├── Trampoline.elm │ │ ├── Transform2D.elm │ │ └── Window.elm │ │ └── tests │ │ ├── Test.elm │ │ ├── Test │ │ ├── Array.elm │ │ ├── Basics.elm │ │ ├── Bitwise.elm │ │ ├── Char.elm │ │ ├── CodeGen.elm │ │ ├── Dict.elm │ │ ├── Equality.elm │ │ ├── Json.elm │ │ ├── List.elm │ │ ├── Regex.elm │ │ ├── Result.elm │ │ ├── Set.elm │ │ ├── String.elm │ │ └── Trampoline.elm │ │ ├── elm-io-ports.js │ │ ├── elm-package.json │ │ └── run-test.sh │ └── evancz │ ├── elm-html │ └── 4.0.2 │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── elm-package.json │ │ ├── examples │ │ ├── README.md │ │ ├── TextReverser.elm │ │ ├── Yogi.elm │ │ └── elm-package.json │ │ ├── src │ │ ├── Html.elm │ │ └── Html │ │ │ ├── Attributes.elm │ │ │ ├── Events.elm │ │ │ └── Lazy.elm │ │ └── todo.png │ └── virtual-dom │ └── 2.1.0 │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── elm-package.json │ ├── package.json │ ├── rebuild.sh │ ├── src │ ├── Native │ │ └── VirtualDom.js │ ├── VirtualDom.elm │ └── wrapper.js │ ├── tests │ ├── Native │ │ └── TestHelpers.js │ ├── TestCases │ │ └── Lazy.elm │ ├── TestHelpers.elm │ ├── TestMain.elm │ ├── elm-io-ports.js │ ├── elm-package.json │ └── run-tests.sh │ └── todo.png ├── lib ├── phoenix_elm.ex └── phoenix_elm │ ├── elm_io.ex │ ├── endpoint.ex │ └── repo.ex ├── mix.exs ├── mix.lock ├── package.json ├── priv ├── gettext │ ├── en │ │ └── LC_MESSAGES │ │ │ └── errors.po │ └── errors.pot ├── repo │ └── seeds.exs └── server │ └── js │ └── main.js ├── test ├── controllers │ └── page_controller_test.exs ├── support │ ├── channel_case.ex │ ├── conn_case.ex │ └── model_case.ex ├── test_helper.exs └── views │ ├── error_view_test.exs │ ├── layout_view_test.exs │ └── page_view_test.exs ├── web ├── channels │ └── user_socket.ex ├── controllers │ └── page_controller.ex ├── gettext.ex ├── router.ex ├── static │ ├── assets │ │ ├── favicon.ico │ │ ├── images │ │ │ ├── bg.png │ │ │ └── phoenix.png │ │ └── robots.txt │ ├── css │ │ └── app.css │ ├── elm │ │ └── Todo.elm │ └── js │ │ ├── app.js │ │ ├── server_render.js │ │ └── socket.js ├── templates │ ├── layout │ │ └── app.html.eex │ └── page │ │ ├── index.html.eex │ │ └── single_page.html.eex ├── views │ ├── error_helpers.ex │ ├── error_view.ex │ ├── layout_view.ex │ └── page_view.ex └── web.ex ├── webpack.config.js └── webpack.server.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # App artifacts 2 | /_build 3 | /db 4 | /deps 5 | /*.ez 6 | 7 | # Generate on crash by the VM 8 | erl_crash.dump 9 | 10 | # Static artifacts 11 | /node_modules 12 | 13 | # Since we are building assets from web/static, 14 | # we ignore priv/static. You may want to comment 15 | # this depending on your deployment strategy. 16 | /priv/static/ 17 | 18 | # The config/prod.secret.exs file by default contains sensitive 19 | # data and you should not commit it into version control. 20 | # 21 | # Alternatively, you may comment the line below and commit the 22 | # secrets file as long as you replace its contents by environment 23 | # variables. 24 | /config/prod.secret.exs 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PhoenixElm 2 | 3 | To start your Phoenix app: 4 | 5 | 1. Install dependencies with `mix deps.get` 6 | 2. Create and migrate your database with `mix ecto.create && mix ecto.migrate` 7 | 3. Install the node packages `npm install` 8 | 3. Start Phoenix endpoint with `mix phoenix.server` 9 | 10 | Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. 11 | 12 | -------------------------------------------------------------------------------- /config/config.exs: -------------------------------------------------------------------------------- 1 | # This file is responsible for configuring your application 2 | # and its dependencies with the aid of the Mix.Config module. 3 | # 4 | # This configuration file is loaded before any dependency and 5 | # is restricted to this project. 6 | use Mix.Config 7 | 8 | # Configures the endpoint 9 | config :phoenix_elm, PhoenixElm.Endpoint, 10 | url: [host: "localhost"], 11 | root: Path.dirname(__DIR__), 12 | secret_key_base: "8hjDCTIStz4YsdlB4pcj8MaeiKKFiMsoba9zpJacMA6NY27fpfF1G8RTE21XNxAo", 13 | render_errors: [accepts: ~w(html json)], 14 | pubsub: [name: PhoenixElm.PubSub, 15 | adapter: Phoenix.PubSub.PG2] 16 | 17 | # Configures Elixir's Logger 18 | config :logger, :console, 19 | format: "$time $metadata[$level] $message\n", 20 | metadata: [:request_id] 21 | 22 | # Import environment specific config. This must remain at the bottom 23 | # of this file so it overrides the configuration defined above. 24 | import_config "#{Mix.env}.exs" 25 | 26 | # Configure phoenix generators 27 | config :phoenix, :generators, 28 | migration: true, 29 | binary_id: false 30 | -------------------------------------------------------------------------------- /config/dev.exs: -------------------------------------------------------------------------------- 1 | use Mix.Config 2 | 3 | # For development, we disable any cache and enable 4 | # debugging and code reloading. 5 | # 6 | # The watchers configuration can be used to run external 7 | # watchers to your application. For example, we use it 8 | # with brunch.io to recompile .js and .css sources. 9 | config :phoenix_elm, PhoenixElm.Endpoint, 10 | http: [port: 4000], 11 | debug_errors: true, 12 | code_reloader: true, 13 | cache_static_lookup: false, 14 | check_origin: false, 15 | watchers: [ 16 | {"node", ["node_modules/webpack/bin/webpack.js", "--watch-stdin", "--progress", "--colors"]}, 17 | {"node", ["node_modules/webpack/bin/webpack.js", "--watch-stdin", "--progress", "--colors", "--config", "webpack.server.config.js"]}, 18 | ] 19 | 20 | # Watch static and templates for browser reloading. 21 | config :phoenix_elm, PhoenixElm.Endpoint, 22 | live_reload: [ 23 | patterns: [ 24 | ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, 25 | ~r{priv/gettext/.*(po)$}, 26 | ~r{web/views/.*(ex)$}, 27 | ~r{web/templates/.*(eex)$} 28 | ] 29 | ] 30 | 31 | # Do not include metadata nor timestamps in development logs 32 | config :logger, :console, format: "[$level] $message\n" 33 | 34 | # Set a higher stacktrace during development. 35 | # Do not configure such in production as keeping 36 | # and calculating stacktraces is usually expensive. 37 | config :phoenix, :stacktrace_depth, 20 38 | 39 | # Configure your database 40 | config :phoenix_elm, PhoenixElm.Repo, 41 | adapter: Ecto.Adapters.Postgres, 42 | username: "postgres", 43 | password: "postgres", 44 | database: "phoenix_elm_dev", 45 | hostname: "localhost", 46 | pool_size: 10 47 | -------------------------------------------------------------------------------- /config/prod.exs: -------------------------------------------------------------------------------- 1 | use Mix.Config 2 | 3 | # For production, we configure the host to read the PORT 4 | # from the system environment. Therefore, you will need 5 | # to set PORT=80 before running your server. 6 | # 7 | # You should also configure the url host to something 8 | # meaningful, we use this information when generating URLs. 9 | # 10 | # Finally, we also include the path to a manifest 11 | # containing the digested version of static files. This 12 | # manifest is generated by the mix phoenix.digest task 13 | # which you typically run after static files are built. 14 | config :phoenix_elm, PhoenixElm.Endpoint, 15 | http: [port: {:system, "PORT"}], 16 | url: [host: "example.com", port: 80], 17 | cache_static_manifest: "priv/static/manifest.json" 18 | 19 | # Do not print debug messages in production 20 | config :logger, level: :info 21 | 22 | # ## SSL Support 23 | # 24 | # To get SSL working, you will need to add the `https` key 25 | # to the previous section and set your `:url` port to 443: 26 | # 27 | # config :phoenix_elm, PhoenixElm.Endpoint, 28 | # ... 29 | # url: [host: "example.com", port: 443], 30 | # https: [port: 443, 31 | # keyfile: System.get_env("SOME_APP_SSL_KEY_PATH"), 32 | # certfile: System.get_env("SOME_APP_SSL_CERT_PATH")] 33 | # 34 | # Where those two env variables return an absolute path to 35 | # the key and cert in disk or a relative path inside priv, 36 | # for example "priv/ssl/server.key". 37 | # 38 | # We also recommend setting `force_ssl`, ensuring no data is 39 | # ever sent via http, always redirecting to https: 40 | # 41 | # config :phoenix_elm, PhoenixElm.Endpoint, 42 | # force_ssl: [hsts: true] 43 | # 44 | # Check `Plug.SSL` for all available options in `force_ssl`. 45 | 46 | # ## Using releases 47 | # 48 | # If you are doing OTP releases, you need to instruct Phoenix 49 | # to start the server for all endpoints: 50 | # 51 | # config :phoenix, :serve_endpoints, true 52 | # 53 | # Alternatively, you can configure exactly which server to 54 | # start per endpoint: 55 | # 56 | # config :phoenix_elm, PhoenixElm.Endpoint, server: true 57 | # 58 | # You will also need to set the application root to `.` in order 59 | # for the new static assets to be served after a hot upgrade: 60 | # 61 | # config :phoenix_elm, PhoenixElm.Endpoint, root: "." 62 | 63 | # Finally import the config/prod.secret.exs 64 | # which should be versioned separately. 65 | import_config "prod.secret.exs" 66 | -------------------------------------------------------------------------------- /config/test.exs: -------------------------------------------------------------------------------- 1 | use Mix.Config 2 | 3 | # We don't run a server during test. If one is required, 4 | # you can enable the server option below. 5 | config :phoenix_elm, PhoenixElm.Endpoint, 6 | http: [port: 4001], 7 | server: false 8 | 9 | # Print only warnings and errors during test 10 | config :logger, level: :warn 11 | 12 | # Configure your database 13 | config :phoenix_elm, PhoenixElm.Repo, 14 | adapter: Ecto.Adapters.Postgres, 15 | username: "postgres", 16 | password: "postgres", 17 | database: "phoenix_elm_test", 18 | hostname: "localhost", 19 | pool: Ecto.Adapters.SQL.Sandbox 20 | -------------------------------------------------------------------------------- /elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "summary": "helpful summary of your project, less than 80 characters", 4 | "repository": "https://github.com/user/project.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | "." 8 | ], 9 | "exposed-modules": [], 10 | "dependencies": { 11 | "elm-lang/core": "3.0.0 <= v < 4.0.0", 12 | "evancz/elm-html": "4.0.2 <= v < 5.0.0" 13 | }, 14 | "elm-version": "0.16.0 <= v < 0.17.0" 15 | } -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Array.elmi: -------------------------------------------------------------------------------- 1 | elm-langcoreemptyrepeat 2 | initializefromListisEmptylengthpushappendgetsetslicetoList toIndexedListmap 3 | indexedMapfilterfoldlfoldrArray::aListaListaArrayelm-langcoreArrayArrayaappendelm-langcoreArrayArrayaelm-langcoreArrayArrayaelm-langcoreArrayArrayaemptyelm-langcoreArrayArrayafilteraBoolelm-langcoreArrayArrayaelm-langcoreArrayArrayafoldlabbbelm-langcoreArrayArrayabfoldrabbbelm-langcoreArrayArrayabfromListListaelm-langcoreArrayArrayagetIntelm-langcoreArrayArrayaelm-langcoreMaybeMaybea 4 | indexedMapIntabelm-langcoreArrayArrayaelm-langcoreArrayArrayb 5 | initializeIntIntaelm-langcoreArrayArrayaisEmptyelm-langcoreArrayArrayaBoollengthelm-langcoreArrayArrayaIntmapabelm-langcoreArrayArrayaelm-langcoreArrayArraybpushaelm-langcoreArrayArrayaelm-langcoreArrayArrayarepeatIntaelm-langcoreArrayArrayasetIntaelm-langcoreArrayArrayaelm-langcoreArrayArrayasliceIntIntelm-langcoreArrayArrayaelm-langcoreArrayArraya toIndexedListelm-langcoreArrayArrayaList_Tuple2IntatoListelm-langcoreArrayArrayaListaBasicsListMaybeNativeArrayArrayaArray -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Array.elmo: -------------------------------------------------------------------------------- 1 | Elm.Array = Elm.Array || {}; 2 | Elm.Array.make = function (_elm) { 3 | "use strict"; 4 | _elm.Array = _elm.Array || {}; 5 | if (_elm.Array.values) return _elm.Array.values; 6 | var _U = Elm.Native.Utils.make(_elm), 7 | $Basics = Elm.Basics.make(_elm), 8 | $List = Elm.List.make(_elm), 9 | $Maybe = Elm.Maybe.make(_elm), 10 | $Native$Array = Elm.Native.Array.make(_elm); 11 | var _op = {}; 12 | var append = $Native$Array.append; 13 | var length = $Native$Array.length; 14 | var isEmpty = function (array) { return _U.eq(length(array),0);}; 15 | var slice = $Native$Array.slice; 16 | var set = $Native$Array.set; 17 | var get = F2(function (i,array) { 18 | return _U.cmp(0,i) < 1 && _U.cmp(i,$Native$Array.length(array)) < 0 ? $Maybe.Just(A2($Native$Array.get,i,array)) : $Maybe.Nothing; 19 | }); 20 | var push = $Native$Array.push; 21 | var empty = $Native$Array.empty; 22 | var filter = F2(function (isOkay,arr) { 23 | var update = F2(function (x,xs) { return isOkay(x) ? A2($Native$Array.push,x,xs) : xs;}); 24 | return A3($Native$Array.foldl,update,$Native$Array.empty,arr); 25 | }); 26 | var foldr = $Native$Array.foldr; 27 | var foldl = $Native$Array.foldl; 28 | var indexedMap = $Native$Array.indexedMap; 29 | var map = $Native$Array.map; 30 | var toIndexedList = function (array) { 31 | return A3($List.map2, 32 | F2(function (v0,v1) { return {ctor: "_Tuple2",_0: v0,_1: v1};}), 33 | _U.range(0,$Native$Array.length(array) - 1), 34 | $Native$Array.toList(array)); 35 | }; 36 | var toList = $Native$Array.toList; 37 | var fromList = $Native$Array.fromList; 38 | var initialize = $Native$Array.initialize; 39 | var repeat = F2(function (n,e) { return A2(initialize,n,$Basics.always(e));}); 40 | var Array = {ctor: "Array"}; 41 | return _elm.Array.values = {_op: _op 42 | ,empty: empty 43 | ,repeat: repeat 44 | ,initialize: initialize 45 | ,fromList: fromList 46 | ,isEmpty: isEmpty 47 | ,length: length 48 | ,push: push 49 | ,append: append 50 | ,get: get 51 | ,set: set 52 | ,slice: slice 53 | ,toList: toList 54 | ,toIndexedList: toIndexedList 55 | ,map: map 56 | ,indexedMap: indexedMap 57 | ,filter: filter 58 | ,foldl: foldl 59 | ,foldr: foldr}; 60 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Bitwise.elmi: -------------------------------------------------------------------------------- 1 | elm-langcoreandorxor 2 | complement shiftLeft 3 | shiftRightshiftRightLogical::aListaListaandIntIntInt 4 | complementIntIntorIntIntInt shiftLeftIntIntInt 5 | shiftRightIntIntIntshiftRightLogicalIntIntIntxorIntIntIntNativeBitwise -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Bitwise.elmo: -------------------------------------------------------------------------------- 1 | Elm.Bitwise = Elm.Bitwise || {}; 2 | Elm.Bitwise.make = function (_elm) { 3 | "use strict"; 4 | _elm.Bitwise = _elm.Bitwise || {}; 5 | if (_elm.Bitwise.values) return _elm.Bitwise.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Native$Bitwise = Elm.Native.Bitwise.make(_elm); 7 | var _op = {}; 8 | var shiftRightLogical = $Native$Bitwise.shiftRightLogical; 9 | var shiftRight = $Native$Bitwise.shiftRightArithmatic; 10 | var shiftLeft = $Native$Bitwise.shiftLeft; 11 | var complement = $Native$Bitwise.complement; 12 | var xor = $Native$Bitwise.xor; 13 | var or = $Native$Bitwise.or; 14 | var and = $Native$Bitwise.and; 15 | return _elm.Bitwise.values = {_op: _op 16 | ,and: and 17 | ,or: or 18 | ,xor: xor 19 | ,complement: complement 20 | ,shiftLeft: shiftLeft 21 | ,shiftRight: shiftRight 22 | ,shiftRightLogical: shiftRightLogical}; 23 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Char.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore isUpperisLowerisDigit 2 | isOctDigit 3 | isHexDigittoUppertoLower toLocaleUpper toLocaleLowertoCodefromCodeKeyCode ::aListaListafromCodeelm-langcoreCharKeyCodeIntChar isBetweenCharCharCharBoolisDigitCharBool 4 | isHexDigitCharBoolisLowerCharBool 5 | isOctDigitCharBoolisUpperCharBooltoCodeCharelm-langcoreCharKeyCodeInt toLocaleLowerCharChar toLocaleUpperCharChartoLowerCharChartoUpperCharCharBasicsNativeCharKeyCodeInt -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Char.elmo: -------------------------------------------------------------------------------- 1 | Elm.Char = Elm.Char || {}; 2 | Elm.Char.make = function (_elm) { 3 | "use strict"; 4 | _elm.Char = _elm.Char || {}; 5 | if (_elm.Char.values) return _elm.Char.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Basics = Elm.Basics.make(_elm),$Native$Char = Elm.Native.Char.make(_elm); 7 | var _op = {}; 8 | var fromCode = $Native$Char.fromCode; 9 | var toCode = $Native$Char.toCode; 10 | var toLocaleLower = $Native$Char.toLocaleLower; 11 | var toLocaleUpper = $Native$Char.toLocaleUpper; 12 | var toLower = $Native$Char.toLower; 13 | var toUpper = $Native$Char.toUpper; 14 | var isBetween = F3(function (low,high,$char) { var code = toCode($char);return _U.cmp(code,toCode(low)) > -1 && _U.cmp(code,toCode(high)) < 1;}); 15 | var isUpper = A2(isBetween,_U.chr("A"),_U.chr("Z")); 16 | var isLower = A2(isBetween,_U.chr("a"),_U.chr("z")); 17 | var isDigit = A2(isBetween,_U.chr("0"),_U.chr("9")); 18 | var isOctDigit = A2(isBetween,_U.chr("0"),_U.chr("7")); 19 | var isHexDigit = function ($char) { 20 | return isDigit($char) || (A3(isBetween,_U.chr("a"),_U.chr("f"),$char) || A3(isBetween,_U.chr("A"),_U.chr("F"),$char)); 21 | }; 22 | return _elm.Char.values = {_op: _op 23 | ,isUpper: isUpper 24 | ,isLower: isLower 25 | ,isDigit: isDigit 26 | ,isOctDigit: isOctDigit 27 | ,isHexDigit: isHexDigit 28 | ,toUpper: toUpper 29 | ,toLower: toLower 30 | ,toLocaleUpper: toLocaleUpper 31 | ,toLocaleLower: toLocaleLower 32 | ,toCode: toCode 33 | ,fromCode: fromCode}; 34 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Date.elmo: -------------------------------------------------------------------------------- 1 | Elm.Date = Elm.Date || {}; 2 | Elm.Date.make = function (_elm) { 3 | "use strict"; 4 | _elm.Date = _elm.Date || {}; 5 | if (_elm.Date.values) return _elm.Date.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Native$Date = Elm.Native.Date.make(_elm),$Result = Elm.Result.make(_elm),$Time = Elm.Time.make(_elm); 7 | var _op = {}; 8 | var millisecond = $Native$Date.millisecond; 9 | var second = $Native$Date.second; 10 | var minute = $Native$Date.minute; 11 | var hour = $Native$Date.hour; 12 | var dayOfWeek = $Native$Date.dayOfWeek; 13 | var day = $Native$Date.day; 14 | var month = $Native$Date.month; 15 | var year = $Native$Date.year; 16 | var fromTime = $Native$Date.fromTime; 17 | var toTime = $Native$Date.toTime; 18 | var fromString = $Native$Date.read; 19 | var Dec = {ctor: "Dec"}; 20 | var Nov = {ctor: "Nov"}; 21 | var Oct = {ctor: "Oct"}; 22 | var Sep = {ctor: "Sep"}; 23 | var Aug = {ctor: "Aug"}; 24 | var Jul = {ctor: "Jul"}; 25 | var Jun = {ctor: "Jun"}; 26 | var May = {ctor: "May"}; 27 | var Apr = {ctor: "Apr"}; 28 | var Mar = {ctor: "Mar"}; 29 | var Feb = {ctor: "Feb"}; 30 | var Jan = {ctor: "Jan"}; 31 | var Sun = {ctor: "Sun"}; 32 | var Sat = {ctor: "Sat"}; 33 | var Fri = {ctor: "Fri"}; 34 | var Thu = {ctor: "Thu"}; 35 | var Wed = {ctor: "Wed"}; 36 | var Tue = {ctor: "Tue"}; 37 | var Mon = {ctor: "Mon"}; 38 | var Date = {ctor: "Date"}; 39 | return _elm.Date.values = {_op: _op 40 | ,fromString: fromString 41 | ,toTime: toTime 42 | ,fromTime: fromTime 43 | ,year: year 44 | ,month: month 45 | ,day: day 46 | ,dayOfWeek: dayOfWeek 47 | ,hour: hour 48 | ,minute: minute 49 | ,second: second 50 | ,millisecond: millisecond 51 | ,Jan: Jan 52 | ,Feb: Feb 53 | ,Mar: Mar 54 | ,Apr: Apr 55 | ,May: May 56 | ,Jun: Jun 57 | ,Jul: Jul 58 | ,Aug: Aug 59 | ,Sep: Sep 60 | ,Oct: Oct 61 | ,Nov: Nov 62 | ,Dec: Dec 63 | ,Mon: Mon 64 | ,Tue: Tue 65 | ,Wed: Wed 66 | ,Thu: Thu 67 | ,Fri: Fri 68 | ,Sat: Sat 69 | ,Sun: Sun}; 70 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Debug.elmi: -------------------------------------------------------------------------------- 1 | elm-langcorelogcrashwatch watchSummarytrace::aListaListacrashStringalogStringaatraceStringelm-langcoreGraphicsCollageFormelm-langcoreGraphicsCollageFormwatchStringaa watchSummaryStringabaaGraphicsCollageNativeDebug -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Debug.elmo: -------------------------------------------------------------------------------- 1 | Elm.Debug = Elm.Debug || {}; 2 | Elm.Debug.make = function (_elm) { 3 | "use strict"; 4 | _elm.Debug = _elm.Debug || {}; 5 | if (_elm.Debug.values) return _elm.Debug.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Graphics$Collage = Elm.Graphics.Collage.make(_elm),$Native$Debug = Elm.Native.Debug.make(_elm); 7 | var _op = {}; 8 | var trace = $Native$Debug.tracePath; 9 | var watchSummary = $Native$Debug.watchSummary; 10 | var watch = $Native$Debug.watch; 11 | var crash = $Native$Debug.crash; 12 | var log = $Native$Debug.log; 13 | return _elm.Debug.values = {_op: _op,log: log,crash: crash,watch: watch,watchSummary: watchSummary,trace: trace}; 14 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Graphics-Input-Field.elmo: -------------------------------------------------------------------------------- 1 | Elm.Graphics = Elm.Graphics || {}; 2 | Elm.Graphics.Input = Elm.Graphics.Input || {}; 3 | Elm.Graphics.Input.Field = Elm.Graphics.Input.Field || {}; 4 | Elm.Graphics.Input.Field.make = function (_elm) { 5 | "use strict"; 6 | _elm.Graphics = _elm.Graphics || {}; 7 | _elm.Graphics.Input = _elm.Graphics.Input || {}; 8 | _elm.Graphics.Input.Field = _elm.Graphics.Input.Field || {}; 9 | if (_elm.Graphics.Input.Field.values) return _elm.Graphics.Input.Field.values; 10 | var _U = Elm.Native.Utils.make(_elm), 11 | $Color = Elm.Color.make(_elm), 12 | $Graphics$Element = Elm.Graphics.Element.make(_elm), 13 | $Native$Graphics$Input = Elm.Native.Graphics.Input.make(_elm), 14 | $Signal = Elm.Signal.make(_elm), 15 | $Text = Elm.Text.make(_elm); 16 | var _op = {}; 17 | var email = $Native$Graphics$Input.email; 18 | var password = $Native$Graphics$Input.password; 19 | var field = $Native$Graphics$Input.field; 20 | var Backward = {ctor: "Backward"}; 21 | var Forward = {ctor: "Forward"}; 22 | var Selection = F3(function (a,b,c) { return {start: a,end: b,direction: c};}); 23 | var Content = F2(function (a,b) { return {string: a,selection: b};}); 24 | var noContent = A2(Content,"",A3(Selection,0,0,Forward)); 25 | var Style = F4(function (a,b,c,d) { return {padding: a,outline: b,highlight: c,style: d};}); 26 | var Highlight = F2(function (a,b) { return {color: a,width: b};}); 27 | var noHighlight = A2(Highlight,$Color.blue,0); 28 | var Outline = F3(function (a,b,c) { return {color: a,width: b,radius: c};}); 29 | var Dimensions = F4(function (a,b,c,d) { return {left: a,right: b,top: c,bottom: d};}); 30 | var uniformly = function (n) { return A4(Dimensions,n,n,n,n);}; 31 | var noOutline = A3(Outline,$Color.grey,uniformly(0),0); 32 | var defaultStyle = {padding: uniformly(4),outline: A3(Outline,$Color.grey,uniformly(1),2),highlight: A2(Highlight,$Color.blue,1),style: $Text.defaultStyle}; 33 | return _elm.Graphics.Input.Field.values = {_op: _op 34 | ,field: field 35 | ,password: password 36 | ,email: email 37 | ,noContent: noContent 38 | ,defaultStyle: defaultStyle 39 | ,noOutline: noOutline 40 | ,noHighlight: noHighlight 41 | ,uniformly: uniformly 42 | ,Content: Content 43 | ,Selection: Selection 44 | ,Style: Style 45 | ,Outline: Outline 46 | ,Highlight: Highlight 47 | ,Dimensions: Dimensions 48 | ,Forward: Forward 49 | ,Backward: Backward}; 50 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Graphics-Input.elmi: -------------------------------------------------------------------------------- 1 | elm-langcorebutton customButtoncheckboxdropDown hoverable clickable::aListaListabuttonelm-langcoreSignalMessageStringelm-langcoreGraphicsElementElementcheckboxBoolelm-langcoreSignalMessageBoolelm-langcoreGraphicsElementElement clickableelm-langcoreSignalMessageelm-langcoreGraphicsElementElementelm-langcoreGraphicsElementElement customButtonelm-langcoreSignalMessageelm-langcoreGraphicsElementElementelm-langcoreGraphicsElementElementelm-langcoreGraphicsElementElementelm-langcoreGraphicsElementElementdropDownaelm-langcoreSignalMessageList_Tuple2Stringaelm-langcoreGraphicsElementElement hoverableBoolelm-langcoreSignalMessageelm-langcoreGraphicsElementElementelm-langcoreGraphicsElementElementGraphicsElementNativeGraphicsInputSignal -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Graphics-Input.elmo: -------------------------------------------------------------------------------- 1 | Elm.Graphics = Elm.Graphics || {}; 2 | Elm.Graphics.Input = Elm.Graphics.Input || {}; 3 | Elm.Graphics.Input.make = function (_elm) { 4 | "use strict"; 5 | _elm.Graphics = _elm.Graphics || {}; 6 | _elm.Graphics.Input = _elm.Graphics.Input || {}; 7 | if (_elm.Graphics.Input.values) return _elm.Graphics.Input.values; 8 | var _U = Elm.Native.Utils.make(_elm), 9 | $Graphics$Element = Elm.Graphics.Element.make(_elm), 10 | $Native$Graphics$Input = Elm.Native.Graphics.Input.make(_elm), 11 | $Signal = Elm.Signal.make(_elm); 12 | var _op = {}; 13 | var clickable = $Native$Graphics$Input.clickable; 14 | var hoverable = $Native$Graphics$Input.hoverable; 15 | var dropDown = $Native$Graphics$Input.dropDown; 16 | var checkbox = $Native$Graphics$Input.checkbox; 17 | var customButton = $Native$Graphics$Input.customButton; 18 | var button = $Native$Graphics$Input.button; 19 | return _elm.Graphics.Input.values = {_op: _op 20 | ,button: button 21 | ,customButton: customButton 22 | ,checkbox: checkbox 23 | ,dropDown: dropDown 24 | ,hoverable: hoverable 25 | ,clickable: clickable}; 26 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Json-Encode.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore 2 | encodestringintfloatboolnulllistarrayobjectValue ::aListaListaValueelm-langcoreJsonEncodeValuearrayelm-langcoreArrayArrayelm-langcoreJsonEncodeValueelm-langcoreJsonEncodeValueboolBoolelm-langcoreJsonEncodeValueencodeIntelm-langcoreJsonEncodeValueStringfloatFloatelm-langcoreJsonEncodeValueintIntelm-langcoreJsonEncodeValuelistListelm-langcoreJsonEncodeValueelm-langcoreJsonEncodeValuenullelm-langcoreJsonEncodeValueobjectList_Tuple2Stringelm-langcoreJsonEncodeValueelm-langcoreJsonEncodeValuestringStringelm-langcoreJsonEncodeValueArrayNativeJsonValueValue -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Json-Encode.elmo: -------------------------------------------------------------------------------- 1 | Elm.Json = Elm.Json || {}; 2 | Elm.Json.Encode = Elm.Json.Encode || {}; 3 | Elm.Json.Encode.make = function (_elm) { 4 | "use strict"; 5 | _elm.Json = _elm.Json || {}; 6 | _elm.Json.Encode = _elm.Json.Encode || {}; 7 | if (_elm.Json.Encode.values) return _elm.Json.Encode.values; 8 | var _U = Elm.Native.Utils.make(_elm),$Array = Elm.Array.make(_elm),$Native$Json = Elm.Native.Json.make(_elm); 9 | var _op = {}; 10 | var list = $Native$Json.encodeList; 11 | var array = $Native$Json.encodeArray; 12 | var object = $Native$Json.encodeObject; 13 | var $null = $Native$Json.encodeNull; 14 | var bool = $Native$Json.identity; 15 | var $float = $Native$Json.identity; 16 | var $int = $Native$Json.identity; 17 | var string = $Native$Json.identity; 18 | var encode = $Native$Json.encode; 19 | var Value = {ctor: "Value"}; 20 | return _elm.Json.Encode.values = {_op: _op 21 | ,encode: encode 22 | ,string: string 23 | ,$int: $int 24 | ,$float: $float 25 | ,bool: bool 26 | ,$null: $null 27 | ,list: list 28 | ,array: array 29 | ,object: object}; 30 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Keyboard.elmo: -------------------------------------------------------------------------------- 1 | Elm.Keyboard = Elm.Keyboard || {}; 2 | Elm.Keyboard.make = function (_elm) { 3 | "use strict"; 4 | _elm.Keyboard = _elm.Keyboard || {}; 5 | if (_elm.Keyboard.values) return _elm.Keyboard.values; 6 | var _U = Elm.Native.Utils.make(_elm), 7 | $Basics = Elm.Basics.make(_elm), 8 | $Char = Elm.Char.make(_elm), 9 | $Native$Keyboard = Elm.Native.Keyboard.make(_elm), 10 | $Set = Elm.Set.make(_elm), 11 | $Signal = Elm.Signal.make(_elm); 12 | var _op = {}; 13 | var presses = A2($Signal.map,function (_) { return _.keyCode;},$Native$Keyboard.presses); 14 | var toXY = F2(function (_p0,keyCodes) { 15 | var _p1 = _p0; 16 | var is = function (keyCode) { return A2($Set.member,keyCode,keyCodes) ? 1 : 0;}; 17 | return {x: is(_p1.right) - is(_p1.left),y: is(_p1.up) - is(_p1.down)}; 18 | }); 19 | var Directions = F4(function (a,b,c,d) { return {up: a,down: b,left: c,right: d};}); 20 | var dropMap = F2(function (f,signal) { return $Signal.dropRepeats(A2($Signal.map,f,signal));}); 21 | var EventInfo = F3(function (a,b,c) { return {alt: a,meta: b,keyCode: c};}); 22 | var Blur = {ctor: "Blur"}; 23 | var Down = function (a) { return {ctor: "Down",_0: a};}; 24 | var Up = function (a) { return {ctor: "Up",_0: a};}; 25 | var rawEvents = $Signal.mergeMany(_U.list([A2($Signal.map,Up,$Native$Keyboard.ups) 26 | ,A2($Signal.map,Down,$Native$Keyboard.downs) 27 | ,A2($Signal.map,$Basics.always(Blur),$Native$Keyboard.blurs)])); 28 | var empty = {alt: false,meta: false,keyCodes: $Set.empty}; 29 | var update = F2(function (event,model) { 30 | var _p2 = event; 31 | switch (_p2.ctor) 32 | {case "Down": var _p3 = _p2._0; 33 | return {alt: _p3.alt,meta: _p3.meta,keyCodes: A2($Set.insert,_p3.keyCode,model.keyCodes)}; 34 | case "Up": var _p4 = _p2._0; 35 | return {alt: _p4.alt,meta: _p4.meta,keyCodes: A2($Set.remove,_p4.keyCode,model.keyCodes)}; 36 | default: return empty;} 37 | }); 38 | var model = A3($Signal.foldp,update,empty,rawEvents); 39 | var alt = A2(dropMap,function (_) { return _.alt;},model); 40 | var meta = A2(dropMap,function (_) { return _.meta;},model); 41 | var keysDown = A2(dropMap,function (_) { return _.keyCodes;},model); 42 | var arrows = A2(dropMap,toXY({up: 38,down: 40,left: 37,right: 39}),keysDown); 43 | var wasd = A2(dropMap,toXY({up: 87,down: 83,left: 65,right: 68}),keysDown); 44 | var isDown = function (keyCode) { return A2(dropMap,$Set.member(keyCode),keysDown);}; 45 | var ctrl = isDown(17); 46 | var shift = isDown(16); 47 | var space = isDown(32); 48 | var enter = isDown(13); 49 | var Model = F3(function (a,b,c) { return {alt: a,meta: b,keyCodes: c};}); 50 | return _elm.Keyboard.values = {_op: _op 51 | ,arrows: arrows 52 | ,wasd: wasd 53 | ,enter: enter 54 | ,space: space 55 | ,ctrl: ctrl 56 | ,shift: shift 57 | ,alt: alt 58 | ,meta: meta 59 | ,isDown: isDown 60 | ,keysDown: keysDown 61 | ,presses: presses}; 62 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Maybe.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore andThenmapmap2map3map4map5 withDefaultoneOfMaybeJustNothing ::aListaListaJustaelm-langcoreMaybeMaybeaNothingelm-langcoreMaybeMaybeaandThenelm-langcoreMaybeMaybeaaelm-langcoreMaybeMaybebelm-langcoreMaybeMaybebmapabelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybebmap2abcelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybebelm-langcoreMaybeMaybecmap3abcdelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybebelm-langcoreMaybeMaybecelm-langcoreMaybeMaybedmap4abcdeelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybebelm-langcoreMaybeMaybecelm-langcoreMaybeMaybedelm-langcoreMaybeMaybeemap5abcdefelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybebelm-langcoreMaybeMaybecelm-langcoreMaybeMaybedelm-langcoreMaybeMaybeeelm-langcoreMaybeMaybefoneOfListelm-langcoreMaybeMaybeaelm-langcoreMaybeMaybea withDefaultaelm-langcoreMaybeMaybeaaMaybeaJustaNothing -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Maybe.elmo: -------------------------------------------------------------------------------- 1 | Elm.Maybe = Elm.Maybe || {}; 2 | Elm.Maybe.make = function (_elm) { 3 | "use strict"; 4 | _elm.Maybe = _elm.Maybe || {}; 5 | if (_elm.Maybe.values) return _elm.Maybe.values; 6 | var _U = Elm.Native.Utils.make(_elm); 7 | var _op = {}; 8 | var withDefault = F2(function ($default,maybe) { var _p0 = maybe;if (_p0.ctor === "Just") { return _p0._0;} else { return $default;}}); 9 | var Nothing = {ctor: "Nothing"}; 10 | var oneOf = function (maybes) { 11 | oneOf: while (true) { 12 | var _p1 = maybes; 13 | if (_p1.ctor === "[]") { 14 | return Nothing; 15 | } else { 16 | var _p3 = _p1._0; 17 | var _p2 = _p3; 18 | if (_p2.ctor === "Nothing") { 19 | var _v3 = _p1._1; 20 | maybes = _v3; 21 | continue oneOf; 22 | } else { 23 | return _p3; 24 | } 25 | } 26 | } 27 | }; 28 | var andThen = F2(function (maybeValue,callback) { 29 | var _p4 = maybeValue; 30 | if (_p4.ctor === "Just") { 31 | return callback(_p4._0); 32 | } else { 33 | return Nothing; 34 | } 35 | }); 36 | var Just = function (a) { return {ctor: "Just",_0: a};}; 37 | var map = F2(function (f,maybe) { var _p5 = maybe;if (_p5.ctor === "Just") { return Just(f(_p5._0));} else { return Nothing;}}); 38 | var map2 = F3(function (func,ma,mb) { 39 | var _p6 = {ctor: "_Tuple2",_0: ma,_1: mb}; 40 | if (_p6.ctor === "_Tuple2" && _p6._0.ctor === "Just" && _p6._1.ctor === "Just") { 41 | return Just(A2(func,_p6._0._0,_p6._1._0)); 42 | } else { 43 | return Nothing; 44 | } 45 | }); 46 | var map3 = F4(function (func,ma,mb,mc) { 47 | var _p7 = {ctor: "_Tuple3",_0: ma,_1: mb,_2: mc}; 48 | if (_p7.ctor === "_Tuple3" && _p7._0.ctor === "Just" && _p7._1.ctor === "Just" && _p7._2.ctor === "Just") { 49 | return Just(A3(func,_p7._0._0,_p7._1._0,_p7._2._0)); 50 | } else { 51 | return Nothing; 52 | } 53 | }); 54 | var map4 = F5(function (func,ma,mb,mc,md) { 55 | var _p8 = {ctor: "_Tuple4",_0: ma,_1: mb,_2: mc,_3: md}; 56 | if (_p8.ctor === "_Tuple4" && _p8._0.ctor === "Just" && _p8._1.ctor === "Just" && _p8._2.ctor === "Just" && _p8._3.ctor === "Just") { 57 | return Just(A4(func,_p8._0._0,_p8._1._0,_p8._2._0,_p8._3._0)); 58 | } else { 59 | return Nothing; 60 | } 61 | }); 62 | var map5 = F6(function (func,ma,mb,mc,md,me) { 63 | var _p9 = {ctor: "_Tuple5",_0: ma,_1: mb,_2: mc,_3: md,_4: me}; 64 | if (_p9.ctor === "_Tuple5" && _p9._0.ctor === "Just" && _p9._1.ctor === "Just" && _p9._2.ctor === "Just" && _p9._3.ctor === "Just" && _p9._4.ctor === "Just") 65 | { 66 | return Just(A5(func,_p9._0._0,_p9._1._0,_p9._2._0,_p9._3._0,_p9._4._0)); 67 | } else { 68 | return Nothing; 69 | } 70 | }); 71 | return _elm.Maybe.values = {_op: _op 72 | ,andThen: andThen 73 | ,map: map 74 | ,map2: map2 75 | ,map3: map3 76 | ,map4: map4 77 | ,map5: map5 78 | ,withDefault: withDefault 79 | ,oneOf: oneOf 80 | ,Just: Just 81 | ,Nothing: Nothing}; 82 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Mouse.elmi: -------------------------------------------------------------------------------- 1 | elm-langcorepositionxyisDownclicks::aListaListaclickselm-langcoreSignalSignal_Tuple0isDownelm-langcoreSignalSignalBoolpositionelm-langcoreSignalSignal_Tuple2IntIntxelm-langcoreSignalSignalIntyelm-langcoreSignalSignalIntBasicsNativeMouseSignal -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Mouse.elmo: -------------------------------------------------------------------------------- 1 | Elm.Mouse = Elm.Mouse || {}; 2 | Elm.Mouse.make = function (_elm) { 3 | "use strict"; 4 | _elm.Mouse = _elm.Mouse || {}; 5 | if (_elm.Mouse.values) return _elm.Mouse.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Basics = Elm.Basics.make(_elm),$Native$Mouse = Elm.Native.Mouse.make(_elm),$Signal = Elm.Signal.make(_elm); 7 | var _op = {}; 8 | var clicks = $Native$Mouse.clicks; 9 | var isDown = $Native$Mouse.isDown; 10 | var position = $Native$Mouse.position; 11 | var x = A2($Signal.map,$Basics.fst,position); 12 | var y = A2($Signal.map,$Basics.snd,position); 13 | return _elm.Mouse.values = {_op: _op,position: position,x: x,y: y,isDown: isDown,clicks: clicks}; 14 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Regex.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore regexescapecaseInsensitivecontainsfindreplacesplitRegexMatchMatchHowManyAllAtMost ::aListaListaAllelm-langcoreRegexHowManyAtMostIntelm-langcoreRegexHowManyMatchStringListelm-langcoreMaybeMaybeStringIntIntelm-langcoreRegexMatchindexIntmatchStringnumberInt 2 | submatchesListelm-langcoreMaybeMaybeStringRegexelm-langcoreRegexRegexcaseInsensitiveelm-langcoreRegexRegexelm-langcoreRegexRegexcontainselm-langcoreRegexRegexStringBoolescapeStringStringfindelm-langcoreRegexHowManyelm-langcoreRegexRegexStringListelm-langcoreRegexMatchindexIntmatchStringnumberInt 3 | submatchesListelm-langcoreMaybeMaybeStringregexStringelm-langcoreRegexRegexreplaceelm-langcoreRegexHowManyelm-langcoreRegexRegexelm-langcoreRegexMatchindexIntmatchStringnumberInt 4 | submatchesListelm-langcoreMaybeMaybeStringStringStringStringsplitelm-langcoreRegexHowManyelm-langcoreRegexRegexStringListStringMaybeNativeRegexHowManyAllAtMostIntRegexRegexMatchmatchString 5 | submatchesListelm-langcoreMaybeMaybeStringindexIntnumberInt -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Regex.elmo: -------------------------------------------------------------------------------- 1 | Elm.Regex = Elm.Regex || {}; 2 | Elm.Regex.make = function (_elm) { 3 | "use strict"; 4 | _elm.Regex = _elm.Regex || {}; 5 | if (_elm.Regex.values) return _elm.Regex.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Maybe = Elm.Maybe.make(_elm),$Native$Regex = Elm.Native.Regex.make(_elm); 7 | var _op = {}; 8 | var split = $Native$Regex.split; 9 | var replace = $Native$Regex.replace; 10 | var find = $Native$Regex.find; 11 | var AtMost = function (a) { return {ctor: "AtMost",_0: a};}; 12 | var All = {ctor: "All"}; 13 | var Match = F4(function (a,b,c,d) { return {match: a,submatches: b,index: c,number: d};}); 14 | var contains = $Native$Regex.contains; 15 | var caseInsensitive = $Native$Regex.caseInsensitive; 16 | var regex = $Native$Regex.regex; 17 | var escape = $Native$Regex.escape; 18 | var Regex = {ctor: "Regex"}; 19 | return _elm.Regex.values = {_op: _op 20 | ,regex: regex 21 | ,escape: escape 22 | ,caseInsensitive: caseInsensitive 23 | ,contains: contains 24 | ,find: find 25 | ,replace: replace 26 | ,split: split 27 | ,Match: Match 28 | ,All: All 29 | ,AtMost: AtMost}; 30 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Set.elmo: -------------------------------------------------------------------------------- 1 | Elm.Set = Elm.Set || {}; 2 | Elm.Set.make = function (_elm) { 3 | "use strict"; 4 | _elm.Set = _elm.Set || {}; 5 | if (_elm.Set.values) return _elm.Set.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Basics = Elm.Basics.make(_elm),$Dict = Elm.Dict.make(_elm),$List = Elm.List.make(_elm); 7 | var _op = {}; 8 | var foldr = F3(function (f,b,_p0) { var _p1 = _p0;return A3($Dict.foldr,F3(function (k,_p2,b) { return A2(f,k,b);}),b,_p1._0);}); 9 | var foldl = F3(function (f,b,_p3) { var _p4 = _p3;return A3($Dict.foldl,F3(function (k,_p5,b) { return A2(f,k,b);}),b,_p4._0);}); 10 | var toList = function (_p6) { var _p7 = _p6;return $Dict.keys(_p7._0);}; 11 | var size = function (_p8) { var _p9 = _p8;return $Dict.size(_p9._0);}; 12 | var member = F2(function (k,_p10) { var _p11 = _p10;return A2($Dict.member,k,_p11._0);}); 13 | var isEmpty = function (_p12) { var _p13 = _p12;return $Dict.isEmpty(_p13._0);}; 14 | var Set_elm_builtin = function (a) { return {ctor: "Set_elm_builtin",_0: a};}; 15 | var empty = Set_elm_builtin($Dict.empty); 16 | var singleton = function (k) { return Set_elm_builtin(A2($Dict.singleton,k,{ctor: "_Tuple0"}));}; 17 | var insert = F2(function (k,_p14) { var _p15 = _p14;return Set_elm_builtin(A3($Dict.insert,k,{ctor: "_Tuple0"},_p15._0));}); 18 | var fromList = function (xs) { return A3($List.foldl,insert,empty,xs);}; 19 | var map = F2(function (f,s) { return fromList(A2($List.map,f,toList(s)));}); 20 | var remove = F2(function (k,_p16) { var _p17 = _p16;return Set_elm_builtin(A2($Dict.remove,k,_p17._0));}); 21 | var union = F2(function (_p19,_p18) { var _p20 = _p19;var _p21 = _p18;return Set_elm_builtin(A2($Dict.union,_p20._0,_p21._0));}); 22 | var intersect = F2(function (_p23,_p22) { var _p24 = _p23;var _p25 = _p22;return Set_elm_builtin(A2($Dict.intersect,_p24._0,_p25._0));}); 23 | var diff = F2(function (_p27,_p26) { var _p28 = _p27;var _p29 = _p26;return Set_elm_builtin(A2($Dict.diff,_p28._0,_p29._0));}); 24 | var filter = F2(function (p,_p30) { var _p31 = _p30;return Set_elm_builtin(A2($Dict.filter,F2(function (k,_p32) { return p(k);}),_p31._0));}); 25 | var partition = F2(function (p,_p33) { 26 | var _p34 = _p33; 27 | var _p35 = A2($Dict.partition,F2(function (k,_p36) { return p(k);}),_p34._0); 28 | var p1 = _p35._0; 29 | var p2 = _p35._1; 30 | return {ctor: "_Tuple2",_0: Set_elm_builtin(p1),_1: Set_elm_builtin(p2)}; 31 | }); 32 | return _elm.Set.values = {_op: _op 33 | ,empty: empty 34 | ,singleton: singleton 35 | ,insert: insert 36 | ,remove: remove 37 | ,isEmpty: isEmpty 38 | ,member: member 39 | ,size: size 40 | ,foldl: foldl 41 | ,foldr: foldr 42 | ,map: map 43 | ,filter: filter 44 | ,partition: partition 45 | ,union: union 46 | ,intersect: intersect 47 | ,diff: diff 48 | ,toList: toList 49 | ,fromList: fromList}; 50 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Signal.elmo: -------------------------------------------------------------------------------- 1 | Elm.Signal = Elm.Signal || {}; 2 | Elm.Signal.make = function (_elm) { 3 | "use strict"; 4 | _elm.Signal = _elm.Signal || {}; 5 | if (_elm.Signal.values) return _elm.Signal.values; 6 | var _U = Elm.Native.Utils.make(_elm), 7 | $Basics = Elm.Basics.make(_elm), 8 | $Debug = Elm.Debug.make(_elm), 9 | $List = Elm.List.make(_elm), 10 | $Maybe = Elm.Maybe.make(_elm), 11 | $Native$Signal = Elm.Native.Signal.make(_elm), 12 | $Task = Elm.Task.make(_elm); 13 | var _op = {}; 14 | var send = F2(function (_p0,value) { 15 | var _p1 = _p0; 16 | return A2($Task.onError,_p1._0(value),function (_p2) { return $Task.succeed({ctor: "_Tuple0"});}); 17 | }); 18 | var Message = function (a) { return {ctor: "Message",_0: a};}; 19 | var message = F2(function (_p3,value) { var _p4 = _p3;return Message(_p4._0(value));}); 20 | var mailbox = $Native$Signal.mailbox; 21 | var Address = function (a) { return {ctor: "Address",_0: a};}; 22 | var forwardTo = F2(function (_p5,f) { var _p6 = _p5;return Address(function (x) { return _p6._0(f(x));});}); 23 | var Mailbox = F2(function (a,b) { return {address: a,signal: b};}); 24 | var sampleOn = $Native$Signal.sampleOn; 25 | var dropRepeats = $Native$Signal.dropRepeats; 26 | var filterMap = $Native$Signal.filterMap; 27 | var filter = F3(function (isOk,base,signal) { 28 | return A3(filterMap,function (value) { return isOk(value) ? $Maybe.Just(value) : $Maybe.Nothing;},base,signal); 29 | }); 30 | var merge = F2(function (left,right) { return A3($Native$Signal.genericMerge,$Basics.always,left,right);}); 31 | var mergeMany = function (signalList) { 32 | var _p7 = $List.reverse(signalList); 33 | if (_p7.ctor === "[]") { 34 | return _U.crashCase("Signal",{start: {line: 184,column: 3},end: {line: 189,column: 40}},_p7)("mergeMany was given an empty list!"); 35 | } else { 36 | return A3($List.foldl,merge,_p7._0,_p7._1); 37 | } 38 | }; 39 | var foldp = $Native$Signal.foldp; 40 | var map5 = $Native$Signal.map5; 41 | var map4 = $Native$Signal.map4; 42 | var map3 = $Native$Signal.map3; 43 | var map2 = $Native$Signal.map2; 44 | var map = $Native$Signal.map; 45 | var constant = $Native$Signal.constant; 46 | var Signal = {ctor: "Signal"}; 47 | return _elm.Signal.values = {_op: _op 48 | ,merge: merge 49 | ,mergeMany: mergeMany 50 | ,map: map 51 | ,map2: map2 52 | ,map3: map3 53 | ,map4: map4 54 | ,map5: map5 55 | ,constant: constant 56 | ,dropRepeats: dropRepeats 57 | ,filter: filter 58 | ,filterMap: filterMap 59 | ,sampleOn: sampleOn 60 | ,foldp: foldp 61 | ,mailbox: mailbox 62 | ,send: send 63 | ,message: message 64 | ,forwardTo: forwardTo 65 | ,Mailbox: Mailbox}; 66 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Text.elmo: -------------------------------------------------------------------------------- 1 | Elm.Text = Elm.Text || {}; 2 | Elm.Text.make = function (_elm) { 3 | "use strict"; 4 | _elm.Text = _elm.Text || {}; 5 | if (_elm.Text.values) return _elm.Text.values; 6 | var _U = Elm.Native.Utils.make(_elm), 7 | $Color = Elm.Color.make(_elm), 8 | $List = Elm.List.make(_elm), 9 | $Maybe = Elm.Maybe.make(_elm), 10 | $Native$Text = Elm.Native.Text.make(_elm); 11 | var _op = {}; 12 | var line = $Native$Text.line; 13 | var italic = $Native$Text.italic; 14 | var bold = $Native$Text.bold; 15 | var color = $Native$Text.color; 16 | var height = $Native$Text.height; 17 | var link = $Native$Text.link; 18 | var monospace = $Native$Text.monospace; 19 | var typeface = $Native$Text.typeface; 20 | var style = $Native$Text.style; 21 | var append = $Native$Text.append; 22 | var fromString = $Native$Text.fromString; 23 | var empty = fromString(""); 24 | var concat = function (texts) { return A3($List.foldr,append,empty,texts);}; 25 | var join = F2(function (seperator,texts) { return concat(A2($List.intersperse,seperator,texts));}); 26 | var defaultStyle = {typeface: _U.list([]),height: $Maybe.Nothing,color: $Color.black,bold: false,italic: false,line: $Maybe.Nothing}; 27 | var Style = F6(function (a,b,c,d,e,f) { return {typeface: a,height: b,color: c,bold: d,italic: e,line: f};}); 28 | var Through = {ctor: "Through"}; 29 | var Over = {ctor: "Over"}; 30 | var Under = {ctor: "Under"}; 31 | var Text = {ctor: "Text"}; 32 | return _elm.Text.values = {_op: _op 33 | ,fromString: fromString 34 | ,empty: empty 35 | ,append: append 36 | ,concat: concat 37 | ,join: join 38 | ,link: link 39 | ,style: style 40 | ,defaultStyle: defaultStyle 41 | ,typeface: typeface 42 | ,monospace: monospace 43 | ,height: height 44 | ,color: color 45 | ,bold: bold 46 | ,italic: italic 47 | ,line: line 48 | ,Style: Style 49 | ,Under: Under 50 | ,Over: Over 51 | ,Through: Through}; 52 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Time.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore millisecondsecondminutehourinMilliseconds inSeconds inMinutesinHoursfpsfpsWhenevery timestampdelaysinceTime::aListaListadelayelm-langcoreTimeTimeFloatelm-langcoreSignalSignalaelm-langcoreSignalSignalaeveryelm-langcoreTimeTimeFloatelm-langcoreSignalSignalelm-langcoreTimeTimeFloatfpsnumberelm-langcoreSignalSignalelm-langcoreTimeTimeFloatfpsWhennumberelm-langcoreSignalSignalBoolelm-langcoreSignalSignalelm-langcoreTimeTimeFloathourelm-langcoreTimeTimeFloatinHourselm-langcoreTimeTimeFloatFloatinMillisecondselm-langcoreTimeTimeFloatFloat inMinuteselm-langcoreTimeTimeFloatFloat inSecondselm-langcoreTimeTimeFloatFloat millisecondelm-langcoreTimeTimeFloatminuteelm-langcoreTimeTimeFloatsecondelm-langcoreTimeTimeFloatsinceelm-langcoreTimeTimeFloatelm-langcoreSignalSignalaelm-langcoreSignalSignalBool timestampelm-langcoreSignalSignalaelm-langcoreSignalSignal_Tuple2elm-langcoreTimeTimeFloataBasicsNativeSignalNativeTimeSignalTimeFloat -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Time.elmo: -------------------------------------------------------------------------------- 1 | Elm.Time = Elm.Time || {}; 2 | Elm.Time.make = function (_elm) { 3 | "use strict"; 4 | _elm.Time = _elm.Time || {}; 5 | if (_elm.Time.values) return _elm.Time.values; 6 | var _U = Elm.Native.Utils.make(_elm), 7 | $Basics = Elm.Basics.make(_elm), 8 | $Native$Signal = Elm.Native.Signal.make(_elm), 9 | $Native$Time = Elm.Native.Time.make(_elm), 10 | $Signal = Elm.Signal.make(_elm); 11 | var _op = {}; 12 | var delay = $Native$Signal.delay; 13 | var since = F2(function (time,signal) { 14 | var stop = A2($Signal.map,$Basics.always(-1),A2(delay,time,signal)); 15 | var start = A2($Signal.map,$Basics.always(1),signal); 16 | var delaydiff = A3($Signal.foldp,F2(function (x,y) { return x + y;}),0,A2($Signal.merge,start,stop)); 17 | return A2($Signal.map,F2(function (x,y) { return !_U.eq(x,y);})(0),delaydiff); 18 | }); 19 | var timestamp = $Native$Signal.timestamp; 20 | var every = $Native$Time.every; 21 | var fpsWhen = $Native$Time.fpsWhen; 22 | var fps = function (targetFrames) { return A2(fpsWhen,targetFrames,$Signal.constant(true));}; 23 | var inMilliseconds = function (t) { return t;}; 24 | var millisecond = 1; 25 | var second = 1000 * millisecond; 26 | var minute = 60 * second; 27 | var hour = 60 * minute; 28 | var inHours = function (t) { return t / hour;}; 29 | var inMinutes = function (t) { return t / minute;}; 30 | var inSeconds = function (t) { return t / second;}; 31 | return _elm.Time.values = {_op: _op 32 | ,millisecond: millisecond 33 | ,second: second 34 | ,minute: minute 35 | ,hour: hour 36 | ,inMilliseconds: inMilliseconds 37 | ,inSeconds: inSeconds 38 | ,inMinutes: inMinutes 39 | ,inHours: inHours 40 | ,fps: fps 41 | ,fpsWhen: fpsWhen 42 | ,every: every 43 | ,timestamp: timestamp 44 | ,delay: delay 45 | ,since: since}; 46 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Touch.elmi: -------------------------------------------------------------------------------- 1 | elm-langcoretouchestapsTouchTouch::aListaListaTouchIntIntIntIntIntelm-langcoreTimeTimeFloatelm-langcoreTouchTouchidIntt0elm-langcoreTimeTimeFloatxIntx0IntyInty0Inttapselm-langcoreSignalSignalxIntyInttoucheselm-langcoreSignalSignalListelm-langcoreTouchTouchidIntt0elm-langcoreTimeTimeFloatxIntx0IntyInty0IntNativeTouchSignalTimeTouchxIntyIntidIntx0Inty0Intt0elm-langcoreTimeTimeFloat -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Touch.elmo: -------------------------------------------------------------------------------- 1 | Elm.Touch = Elm.Touch || {}; 2 | Elm.Touch.make = function (_elm) { 3 | "use strict"; 4 | _elm.Touch = _elm.Touch || {}; 5 | if (_elm.Touch.values) return _elm.Touch.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Native$Touch = Elm.Native.Touch.make(_elm),$Signal = Elm.Signal.make(_elm),$Time = Elm.Time.make(_elm); 7 | var _op = {}; 8 | var taps = $Native$Touch.taps; 9 | var touches = $Native$Touch.touches; 10 | var Touch = F6(function (a,b,c,d,e,f) { return {x: a,y: b,id: c,x0: d,y0: e,t0: f};}); 11 | return _elm.Touch.values = {_op: _op,touches: touches,taps: taps,Touch: Touch}; 12 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Trampoline.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore 2 | trampoline 3 | TrampolineDoneContinue::aListaListaContinue_Tuple0elm-langcore 4 | Trampoline 5 | Trampolineaelm-langcore 6 | Trampoline 7 | TrampolineaDoneaelm-langcore 8 | Trampoline 9 | Trampolinea 10 | trampolineelm-langcore 11 | Trampoline 12 | Trampolineaa 13 | TrampolineaDoneaContinue_Tuple0elm-langcore 14 | Trampoline 15 | Trampolinea -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Trampoline.elmo: -------------------------------------------------------------------------------- 1 | Elm.Trampoline = Elm.Trampoline || {}; 2 | Elm.Trampoline.make = function (_elm) { 3 | "use strict"; 4 | _elm.Trampoline = _elm.Trampoline || {}; 5 | if (_elm.Trampoline.values) return _elm.Trampoline.values; 6 | var _U = Elm.Native.Utils.make(_elm); 7 | var _op = {}; 8 | var trampoline = function (tramp) { 9 | trampoline: while (true) { 10 | var _p0 = tramp; 11 | if (_p0.ctor === "Done") { 12 | return _p0._0; 13 | } else { 14 | var _v1 = _p0._0({ctor: "_Tuple0"}); 15 | tramp = _v1; 16 | continue trampoline; 17 | } 18 | } 19 | }; 20 | var Continue = function (a) { return {ctor: "Continue",_0: a};}; 21 | var Done = function (a) { return {ctor: "Done",_0: a};}; 22 | return _elm.Trampoline.values = {_op: _op,trampoline: trampoline,Done: Done,Continue: Continue}; 23 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Transform2D.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore identitymatrixmultiplyrotation translationscalescaleXscaleY Transform2D 2 | ::aListaLista Transform2Delm-langcore Transform2D Transform2Didentityelm-langcore Transform2D Transform2DmatrixFloatFloatFloatFloatFloatFloatelm-langcore Transform2D Transform2Dmultiplyelm-langcore Transform2D Transform2Delm-langcore Transform2D Transform2Delm-langcore Transform2D Transform2DrotationFloatelm-langcore Transform2D Transform2DscaleFloatelm-langcore Transform2D Transform2DscaleXFloatelm-langcore Transform2D Transform2DscaleYFloatelm-langcore Transform2D Transform2D translationFloatFloatelm-langcore Transform2D Transform2DNative Transform2D Transform2D Transform2D -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Transform2D.elmo: -------------------------------------------------------------------------------- 1 | Elm.Transform2D = Elm.Transform2D || {}; 2 | Elm.Transform2D.make = function (_elm) { 3 | "use strict"; 4 | _elm.Transform2D = _elm.Transform2D || {}; 5 | if (_elm.Transform2D.values) return _elm.Transform2D.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Native$Transform2D = Elm.Native.Transform2D.make(_elm); 7 | var _op = {}; 8 | var multiply = $Native$Transform2D.multiply; 9 | var rotation = $Native$Transform2D.rotation; 10 | var matrix = $Native$Transform2D.matrix; 11 | var translation = F2(function (x,y) { return A6(matrix,1,0,0,1,x,y);}); 12 | var scale = function (s) { return A6(matrix,s,0,0,s,0,0);}; 13 | var scaleX = function (x) { return A6(matrix,x,0,0,1,0,0);}; 14 | var scaleY = function (y) { return A6(matrix,1,0,0,y,0,0);}; 15 | var identity = $Native$Transform2D.identity; 16 | var Transform2D = {ctor: "Transform2D"}; 17 | return _elm.Transform2D.values = {_op: _op 18 | ,identity: identity 19 | ,matrix: matrix 20 | ,multiply: multiply 21 | ,rotation: rotation 22 | ,translation: translation 23 | ,scale: scale 24 | ,scaleX: scaleX 25 | ,scaleY: scaleY}; 26 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Window.elmi: -------------------------------------------------------------------------------- 1 | elm-langcore 2 | dimensionswidthheight::aListaLista 3 | dimensionselm-langcoreSignalSignal_Tuple2IntIntheightelm-langcoreSignalSignalIntwidthelm-langcoreSignalSignalIntBasicsNativeWindowSignal -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/elm-lang/core/3.0.0/Window.elmo: -------------------------------------------------------------------------------- 1 | Elm.Window = Elm.Window || {}; 2 | Elm.Window.make = function (_elm) { 3 | "use strict"; 4 | _elm.Window = _elm.Window || {}; 5 | if (_elm.Window.values) return _elm.Window.values; 6 | var _U = Elm.Native.Utils.make(_elm),$Basics = Elm.Basics.make(_elm),$Native$Window = Elm.Native.Window.make(_elm),$Signal = Elm.Signal.make(_elm); 7 | var _op = {}; 8 | var dimensions = $Native$Window.dimensions; 9 | var width = A2($Signal.map,$Basics.fst,dimensions); 10 | var height = A2($Signal.map,$Basics.snd,dimensions); 11 | return _elm.Window.values = {_op: _op,dimensions: dimensions,width: width,height: height}; 12 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/evancz/elm-html/4.0.2/Html-Events.elmo: -------------------------------------------------------------------------------- 1 | Elm.Html = Elm.Html || {}; 2 | Elm.Html.Events = Elm.Html.Events || {}; 3 | Elm.Html.Events.make = function (_elm) { 4 | "use strict"; 5 | _elm.Html = _elm.Html || {}; 6 | _elm.Html.Events = _elm.Html.Events || {}; 7 | if (_elm.Html.Events.values) return _elm.Html.Events.values; 8 | var _U = Elm.Native.Utils.make(_elm), 9 | $Basics = Elm.Basics.make(_elm), 10 | $Debug = Elm.Debug.make(_elm), 11 | $Html = Elm.Html.make(_elm), 12 | $Json$Decode = Elm.Json.Decode.make(_elm), 13 | $List = Elm.List.make(_elm), 14 | $Maybe = Elm.Maybe.make(_elm), 15 | $Result = Elm.Result.make(_elm), 16 | $Signal = Elm.Signal.make(_elm), 17 | $VirtualDom = Elm.VirtualDom.make(_elm); 18 | var _op = {}; 19 | var keyCode = A2($Json$Decode._op[":="],"keyCode",$Json$Decode.$int); 20 | var targetChecked = A2($Json$Decode.at,_U.list(["target","checked"]),$Json$Decode.bool); 21 | var targetValue = A2($Json$Decode.at,_U.list(["target","value"]),$Json$Decode.string); 22 | var defaultOptions = $VirtualDom.defaultOptions; 23 | var Options = F2(function (a,b) { return {stopPropagation: a,preventDefault: b};}); 24 | var onWithOptions = $VirtualDom.onWithOptions; 25 | var on = $VirtualDom.on; 26 | var messageOn = F3(function (name,addr,msg) { return A3(on,name,$Json$Decode.value,function (_p0) { return A2($Signal.message,addr,msg);});}); 27 | var onClick = messageOn("click"); 28 | var onDoubleClick = messageOn("dblclick"); 29 | var onMouseMove = messageOn("mousemove"); 30 | var onMouseDown = messageOn("mousedown"); 31 | var onMouseUp = messageOn("mouseup"); 32 | var onMouseEnter = messageOn("mouseenter"); 33 | var onMouseLeave = messageOn("mouseleave"); 34 | var onMouseOver = messageOn("mouseover"); 35 | var onMouseOut = messageOn("mouseout"); 36 | var onBlur = messageOn("blur"); 37 | var onFocus = messageOn("focus"); 38 | var onSubmit = messageOn("submit"); 39 | var onKey = F3(function (name,addr,handler) { return A3(on,name,keyCode,function (code) { return A2($Signal.message,addr,handler(code));});}); 40 | var onKeyUp = onKey("keyup"); 41 | var onKeyDown = onKey("keydown"); 42 | var onKeyPress = onKey("keypress"); 43 | return _elm.Html.Events.values = {_op: _op 44 | ,onBlur: onBlur 45 | ,onFocus: onFocus 46 | ,onSubmit: onSubmit 47 | ,onKeyUp: onKeyUp 48 | ,onKeyDown: onKeyDown 49 | ,onKeyPress: onKeyPress 50 | ,onClick: onClick 51 | ,onDoubleClick: onDoubleClick 52 | ,onMouseMove: onMouseMove 53 | ,onMouseDown: onMouseDown 54 | ,onMouseUp: onMouseUp 55 | ,onMouseEnter: onMouseEnter 56 | ,onMouseLeave: onMouseLeave 57 | ,onMouseOver: onMouseOver 58 | ,onMouseOut: onMouseOut 59 | ,on: on 60 | ,onWithOptions: onWithOptions 61 | ,defaultOptions: defaultOptions 62 | ,targetValue: targetValue 63 | ,targetChecked: targetChecked 64 | ,keyCode: keyCode 65 | ,Options: Options}; 66 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/evancz/elm-html/4.0.2/Html-Lazy.elmi: -------------------------------------------------------------------------------- 1 | evanczelm-htmllazylazy2lazy3::aListaListalazyaevanczelm-htmlHtmlHtmlevancz virtual-dom 2 | VirtualDomNodeaevanczelm-htmlHtmlHtmlevancz virtual-dom 3 | VirtualDomNodelazy2abevanczelm-htmlHtmlHtmlevancz virtual-dom 4 | VirtualDomNodeabevanczelm-htmlHtmlHtmlevancz virtual-dom 5 | VirtualDomNodelazy3abcevanczelm-htmlHtmlHtmlevancz virtual-dom 6 | VirtualDomNodeabcevanczelm-htmlHtmlHtmlevancz virtual-dom 7 | VirtualDomNodeBasicsDebugHtmlListMaybeResultSignal 8 | VirtualDom -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/evancz/elm-html/4.0.2/Html-Lazy.elmo: -------------------------------------------------------------------------------- 1 | Elm.Html = Elm.Html || {}; 2 | Elm.Html.Lazy = Elm.Html.Lazy || {}; 3 | Elm.Html.Lazy.make = function (_elm) { 4 | "use strict"; 5 | _elm.Html = _elm.Html || {}; 6 | _elm.Html.Lazy = _elm.Html.Lazy || {}; 7 | if (_elm.Html.Lazy.values) return _elm.Html.Lazy.values; 8 | var _U = Elm.Native.Utils.make(_elm), 9 | $Basics = Elm.Basics.make(_elm), 10 | $Debug = Elm.Debug.make(_elm), 11 | $Html = Elm.Html.make(_elm), 12 | $List = Elm.List.make(_elm), 13 | $Maybe = Elm.Maybe.make(_elm), 14 | $Result = Elm.Result.make(_elm), 15 | $Signal = Elm.Signal.make(_elm), 16 | $VirtualDom = Elm.VirtualDom.make(_elm); 17 | var _op = {}; 18 | var lazy3 = $VirtualDom.lazy3; 19 | var lazy2 = $VirtualDom.lazy2; 20 | var lazy = $VirtualDom.lazy; 21 | return _elm.Html.Lazy.values = {_op: _op,lazy: lazy,lazy2: lazy2,lazy3: lazy3}; 22 | }; -------------------------------------------------------------------------------- /elm-stuff/build-artifacts/0.16.0/evancz/elm-html/4.0.2/graph.dat: -------------------------------------------------------------------------------- 1 | evanczelm-htmlHtml5elm-stuff/packages/evancz/elm-html/4.0.2/src/Html.elmevanczelm-htmlelm-langcoreBasicselm-langcoreDebugelm-langcoreListelm-langcoreMaybeelm-langcoreResultelm-langcoreSignalelm-langcoreGraphicsElementevancz virtual-dom 2 | VirtualDomevanczelm-htmlHtml 3 | Attributes@elm-stuff/packages/evancz/elm-html/4.0.2/src/Html/Attributes.elmevanczelm-html 4 | elm-langcoreBasicselm-langcoreDebugelm-langcoreListelm-langcoreMaybeelm-langcoreResultelm-langcoreSignalevanczelm-htmlHtmlelm-langcoreJsonEncodeelm-langcoreStringevancz virtual-dom 5 | VirtualDomevanczelm-htmlHtmlEventselm-stuff/packages/evancz/virtual-dom/2.1.0/src/VirtualDom.elmevancz virtual-dom elm-langcoreBasicselm-langcoreDebugelm-langcoreListelm-langcoreMaybeelm-langcoreResultelm-langcoreSignalelm-langcoreGraphicsElementelm-langcoreJsonDecodeevancz virtual-domNative 3 | VirtualDomevancz virtual-domNative 4 | VirtualDomDelm-stuff/packages/evancz/virtual-dom/2.1.0/src/Native/VirtualDom.jsevancz virtual-dom -------------------------------------------------------------------------------- /elm-stuff/exact-dependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "evancz/virtual-dom": "2.1.0", 3 | "evancz/elm-html": "4.0.2", 4 | "elm-lang/core": "3.0.0" 5 | } -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/.gitignore: -------------------------------------------------------------------------------- 1 | elm-stuff 2 | tests/test.js -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/.travis.yml: -------------------------------------------------------------------------------- 1 | language: haskell 2 | install: 3 | - cabal sandbox init 4 | - 5 | - git clone https://github.com/elm-lang/elm-compiler.git 6 | - cd elm-compiler 7 | - cabal sandbox init --sandbox .. 8 | - cabal install 9 | - cd .. 10 | - 11 | - git clone https://github.com/elm-lang/elm-package.git 12 | - cd elm-package 13 | - cabal sandbox init --sandbox .. 14 | - cabal install 15 | - cd .. 16 | - 17 | - git clone https://github.com/elm-lang/elm-make.git 18 | - cd elm-make 19 | - cabal sandbox init --sandbox .. 20 | - cabal install 21 | - cd .. 22 | 23 | before_script: 24 | - export PATH=$PWD/bin:$PATH 25 | script: 26 | - tests/run-test.sh 27 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to the core libraries 2 | 3 | Thanks helping with the development of Elm! This document describes the basic 4 | standards for opening pull requests and making the review process as smooth as 5 | possible. 6 | 7 | ## Ground rules 8 | 9 | * Always make pull requests minimal. If it can be split up, it should be split up. 10 | * Use style consistent with the file you are modifying. 11 | * Use descriptive titles for PRs 12 | * Provide all the necessary context for evaluation in the PR. 13 | If there are relevant issues or examples or discussions, add them. 14 | If things can be summarized, summarize them. The easiest PRs are ones 15 | that already address the reviewers questions and concerns. 16 | 17 | ## Documentation Fixes 18 | 19 | If you want to fix docs, just open a PR. This is super helpful! 20 | 21 | ## Bug Fixes 22 | 23 | If you find an issue or see one you want to work on, go for it! 24 | 25 | The best strategy is often to dive in. Asking for directions usually 26 | does not work. If someone knew the specifics and knew how how to fix 27 | it, it is likely they would have already sent the PR themselves! 28 | 29 | Also, be sure you are testing. 30 | 31 | ## Adding New Functions 32 | 33 | We are fairly conservative about adding new functions to core libraries. 34 | If you want to augment the `List` or `Array` library, we recommend creating 35 | small packages called `list-extras` or `array-extras` that have all the 36 | features you want. 37 | 38 | Long term, we will set up a process to review `*-extras` packages to move 39 | stuff into core. By going through packages, it will be much easier to assess 40 | whether a function is pleasant and useful in practice before committing to it 41 | in the core libraries. 42 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Evan Czaplicki 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of Evan Czaplicki nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/README.md: -------------------------------------------------------------------------------- 1 | # Elm Core Libraries 2 | 3 | [![Build Status](https://travis-ci.org/elm-lang/core.png)](https://travis-ci.org/elm-lang/core) 4 | 5 | Every Elm project needs the core libraries. They provide basic functionality including: 6 | 7 | * The Basics — addition, subtraction, etc. 8 | * Data Structures — lists, dictionaries, sets, etc. 9 | * Signals — to make Elm programs reactive 10 | 11 | 12 | ## Default Imports 13 | 14 | In all Elm files there is a small set of default imports: 15 | 16 | ```elm 17 | import Basics exposing (..) 18 | import Debug 19 | import List exposing ( List, (::) ) 20 | import Maybe exposing ( Maybe( Just, Nothing ) ) 21 | import Result exposing ( Result( Ok, Err ) ) 22 | import Signal exposing ( Signal ) 23 | ``` 24 | 25 | The intention is to include things that are both extremely useful and very 26 | unlikely to overlap with anything that anyone will ever write in a library. 27 | By keeping the set of default imports small, it also becomes easier to use 28 | whatever version of `map` suits your fancy. Finally, it makes it easier to 29 | figure out where the heck a function is coming from. 30 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0.0", 3 | "summary": "Elm's standard libraries", 4 | "repository": "http://github.com/elm-lang/core.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | "src" 8 | ], 9 | "exposed-modules": [ 10 | "Array", 11 | "Basics", 12 | "Bitwise", 13 | "Char", 14 | "Color", 15 | "Date", 16 | "Debug", 17 | "Dict", 18 | "Graphics.Element", 19 | "Graphics.Collage", 20 | "Graphics.Input", 21 | "Graphics.Input.Field", 22 | "Json.Decode", 23 | "Json.Encode", 24 | "Keyboard", 25 | "List", 26 | "Maybe", 27 | "Mouse", 28 | "Random", 29 | "Regex", 30 | "Result", 31 | "Set", 32 | "Signal", 33 | "String", 34 | "Task", 35 | "Text", 36 | "Time", 37 | "Touch", 38 | "Trampoline", 39 | "Transform2D", 40 | "Window" 41 | ], 42 | "native-modules": true, 43 | "dependencies": {}, 44 | "elm-version": "0.16.0 <= v < 0.17.0" 45 | } -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Bitwise.elm: -------------------------------------------------------------------------------- 1 | module Bitwise 2 | ( and, or, xor, complement 3 | , shiftLeft, shiftRight, shiftRightLogical 4 | ) where 5 | 6 | {-| Library for [bitwise operations](http://en.wikipedia.org/wiki/Bitwise_operation). 7 | 8 | # Basic Operations 9 | 10 | @docs and, or, xor, complement 11 | 12 | # Bit Shifts 13 | 14 | @docs shiftLeft, shiftRight, shiftRightLogical 15 | -} 16 | 17 | import Native.Bitwise 18 | 19 | 20 | {-| Bitwise AND 21 | -} 22 | and : Int -> Int -> Int 23 | and = 24 | Native.Bitwise.and 25 | 26 | 27 | {-| Bitwise OR 28 | -} 29 | or : Int -> Int -> Int 30 | or = 31 | Native.Bitwise.or 32 | 33 | 34 | {-| Bitwise XOR 35 | -} 36 | xor : Int -> Int -> Int 37 | xor = 38 | Native.Bitwise.xor 39 | 40 | 41 | {-| Flip each bit individually, often called bitwise NOT 42 | -} 43 | complement : Int -> Int 44 | complement = 45 | Native.Bitwise.complement 46 | 47 | 48 | {-| Shift bits to the left by a given offset, filling new bits with zeros. 49 | This can be used to multiply numbers by powers of two. 50 | 51 | 8 `shiftLeft` 1 == 16 52 | 8 `shiftLeft` 2 == 32 53 | -} 54 | shiftLeft : Int -> Int -> Int 55 | shiftLeft = 56 | Native.Bitwise.shiftLeft 57 | 58 | 59 | {-| Shift bits to the right by a given offset, filling new bits with 60 | whatever is the topmost bit. This can be used to divide numbers by powers of two. 61 | 62 | 32 `shiftRight` 1 == 16 63 | 32 `shiftRight` 2 == 8 64 | -32 `shiftRight` 1 == -16 65 | 66 | This is called an [arithmetic right 67 | shift](http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift), 68 | often written (>>), and sometimes called a sign-propagating 69 | right shift because it fills empty spots with copies of the highest bit. 70 | -} 71 | shiftRight : Int -> Int -> Int 72 | shiftRight = 73 | Native.Bitwise.shiftRightArithmatic 74 | 75 | 76 | {-| Shift bits to the right by a given offset, filling new bits with 77 | zeros. 78 | 79 | 32 `shiftRightLogical` 1 == 16 80 | 32 `shiftRightLogical` 2 == 8 81 | -32 `shiftRightLogical` 1 == 2147483632 82 | 83 | This is called an [logical right 84 | shift](http://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift), often written (>>>), 85 | and sometimes called a zero-fill right shift because it fills empty spots 86 | with zeros. 87 | -} 88 | shiftRightLogical : Int -> Int -> Int 89 | shiftRightLogical = 90 | Native.Bitwise.shiftRightLogical 91 | 92 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Char.elm: -------------------------------------------------------------------------------- 1 | module Char 2 | ( isUpper, isLower, isDigit, isOctDigit, isHexDigit 3 | , toUpper, toLower, toLocaleUpper, toLocaleLower 4 | , KeyCode, toCode, fromCode 5 | ) where 6 | 7 | {-| Functions for working with characters. Character literals are enclosed in 8 | `'a'` pair of single quotes. 9 | 10 | # Classification 11 | @docs isUpper, isLower, isDigit, isOctDigit, isHexDigit 12 | 13 | # Conversion 14 | @docs toUpper, toLower, toLocaleUpper, toLocaleLower 15 | 16 | # Key Codes 17 | @docs KeyCode, toCode, fromCode 18 | 19 | -} 20 | 21 | import Native.Char 22 | import Basics exposing ((&&), (||), (>=), (<=)) 23 | 24 | 25 | isBetween : Char -> Char -> Char -> Bool 26 | isBetween low high char = 27 | let code = toCode char 28 | in 29 | (code >= toCode low) && (code <= toCode high) 30 | 31 | 32 | {-| True for upper case letters. -} 33 | isUpper : Char -> Bool 34 | isUpper = 35 | isBetween 'A' 'Z' 36 | 37 | 38 | {-| True for lower case letters. -} 39 | isLower : Char -> Bool 40 | isLower = 41 | isBetween 'a' 'z' 42 | 43 | 44 | {-| True for ASCII digits `[0-9]`. -} 45 | isDigit : Char -> Bool 46 | isDigit = 47 | isBetween '0' '9' 48 | 49 | 50 | {-| True for ASCII octal digits `[0-7]`. -} 51 | isOctDigit : Char -> Bool 52 | isOctDigit = 53 | isBetween '0' '7' 54 | 55 | 56 | {-| True for ASCII hexadecimal digits `[0-9a-fA-F]`. -} 57 | isHexDigit : Char -> Bool 58 | isHexDigit char = 59 | isDigit char || isBetween 'a' 'f' char || isBetween 'A' 'F' char 60 | 61 | 62 | {-| Convert to upper case. -} 63 | toUpper : Char -> Char 64 | toUpper = 65 | Native.Char.toUpper 66 | 67 | 68 | {-| Convert to lower case. -} 69 | toLower : Char -> Char 70 | toLower = 71 | Native.Char.toLower 72 | 73 | 74 | {-| Convert to upper case, according to any locale-specific case mappings. -} 75 | toLocaleUpper : Char -> Char 76 | toLocaleUpper = 77 | Native.Char.toLocaleUpper 78 | 79 | 80 | {-| Convert to lower case, according to any locale-specific case mappings. -} 81 | toLocaleLower : Char -> Char 82 | toLocaleLower = 83 | Native.Char.toLocaleLower 84 | 85 | 86 | {-| In this library, we use integers to represent the key codes coming from the 87 | keyboard. You can use [`toCode`](#toCode) and [`fromCode`](#fromCode) 88 | to convert between key codes and characters. 89 | -} 90 | type alias KeyCode = Int 91 | 92 | 93 | {-| Convert to unicode. Used with the [`Keyboard`](Keyboard) library, 94 | which expects the input to be uppercase. 95 | -} 96 | toCode : Char -> KeyCode 97 | toCode = 98 | Native.Char.toCode 99 | 100 | 101 | {-| Convert from unicode. -} 102 | fromCode : KeyCode -> Char 103 | fromCode = 104 | Native.Char.fromCode 105 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Date.elm: -------------------------------------------------------------------------------- 1 | module Date 2 | ( Date, fromString, toTime, fromTime 3 | , year, month, Month(..) 4 | , day, dayOfWeek, Day(..) 5 | , hour, minute, second, millisecond 6 | ) where 7 | 8 | {-| Library for working with dates. Email the mailing list if you encounter 9 | issues with internationalization or locale formatting. 10 | 11 | # Dates 12 | @docs Date 13 | 14 | # Conversions 15 | @docs fromString, toTime, fromTime 16 | 17 | # Extractions 18 | @docs year, month, Month, day, dayOfWeek, Day, hour, minute, second, millisecond 19 | 20 | -} 21 | 22 | import Native.Date 23 | import Time exposing (Time) 24 | import Result exposing (Result) 25 | 26 | 27 | {-| Representation of a date. 28 | -} 29 | type Date = Date 30 | 31 | 32 | {-| Represents the days of the week. 33 | -} 34 | type Day = Mon | Tue | Wed | Thu | Fri | Sat | Sun 35 | 36 | 37 | {-| Represents the month of the year. 38 | -} 39 | type Month 40 | = Jan | Feb | Mar | Apr 41 | | May | Jun | Jul | Aug 42 | | Sep | Oct | Nov | Dec 43 | 44 | 45 | {-| Attempt to read a date from a string. 46 | -} 47 | fromString : String -> Result String Date 48 | fromString = 49 | Native.Date.read 50 | 51 | 52 | {-| Convert a date into a time since midnight (UTC) of 1 January 1970 (i.e. 53 | [UNIX time](http://en.wikipedia.org/wiki/Unix_time)). Given the date 23 June 54 | 1990 at 11:45AM this returns the corresponding time. 55 | -} 56 | toTime : Date -> Time 57 | toTime = 58 | Native.Date.toTime 59 | 60 | 61 | {-| Take a UNIX time and convert it to a `Date`. 62 | -} 63 | fromTime : Time -> Date 64 | fromTime = 65 | Native.Date.fromTime 66 | 67 | 68 | {-| Extract the year of a given date. Given the date 23 June 1990 at 11:45AM 69 | this returns the integer `1990`. 70 | -} 71 | year : Date -> Int 72 | year = 73 | Native.Date.year 74 | 75 | 76 | {-| Extract the month of a given date. Given the date 23 June 1990 at 11:45AM 77 | this returns the Month `Jun` as defined below. 78 | -} 79 | month : Date -> Month 80 | month = 81 | Native.Date.month 82 | 83 | 84 | {-| Extract the day of a given date. Given the date 23 June 1990 at 11:45AM 85 | this returns the integer `23`. 86 | -} 87 | day : Date -> Int 88 | day = 89 | Native.Date.day 90 | 91 | 92 | {-| Extract the day of the week for a given date. Given the date 23 June 93 | 1990 at 11:45AM this returns the Day `Thu` as defined below. 94 | -} 95 | dayOfWeek : Date -> Day 96 | dayOfWeek = 97 | Native.Date.dayOfWeek 98 | 99 | 100 | {-| Extract the hour of a given date. Given the date 23 June 1990 at 11:45AM 101 | this returns the integer `11`. 102 | -} 103 | hour : Date -> Int 104 | hour = 105 | Native.Date.hour 106 | 107 | 108 | {-| Extract the minute of a given date. Given the date 23 June 1990 at 11:45AM 109 | this returns the integer `45`. 110 | -} 111 | minute : Date -> Int 112 | minute = 113 | Native.Date.minute 114 | 115 | 116 | {-| Extract the second of a given date. Given the date 23 June 1990 at 11:45AM 117 | this returns the integer `0`. 118 | -} 119 | second : Date -> Int 120 | second = 121 | Native.Date.second 122 | 123 | 124 | {-| Extract the millisecond of a given date. Given the date 23 June 1990 at 11:45:30.123AM 125 | this returns the integer `123`. 126 | -} 127 | millisecond : Date -> Int 128 | millisecond = 129 | Native.Date.millisecond 130 | 131 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Json/Encode.elm: -------------------------------------------------------------------------------- 1 | module Json.Encode 2 | ( Value 3 | , encode 4 | , string, int, float, bool, null 5 | , list, array 6 | , object 7 | ) where 8 | 9 | {-| Library for turning Elm values into Json values. 10 | 11 | # Encoding 12 | @docs encode, Value 13 | 14 | # Primitives 15 | @docs string, int, float, bool, null 16 | 17 | # Arrays 18 | @docs list, array 19 | 20 | # Objects 21 | @docs object 22 | -} 23 | 24 | import Array exposing (Array) 25 | import Native.Json 26 | 27 | 28 | {-| Represents a JavaScript value. 29 | -} 30 | type Value = Value 31 | 32 | 33 | {-| Convert a `Value` into a prettified string. The first argument specifies 34 | the amount of indentation in the resulting string. 35 | 36 | person = 37 | object 38 | [ ("name", string "Tom") 39 | , ("age", int 42) 40 | ] 41 | 42 | compact = encode 0 person 43 | -- {"name":"Tom","age":42} 44 | 45 | readable = encode 4 person 46 | -- { 47 | -- "name": "Tom", 48 | -- "age": 42 49 | -- } 50 | -} 51 | encode : Int -> Value -> String 52 | encode = 53 | Native.Json.encode 54 | 55 | 56 | {-|-} 57 | string : String -> Value 58 | string = 59 | Native.Json.identity 60 | 61 | 62 | {-|-} 63 | int : Int -> Value 64 | int = 65 | Native.Json.identity 66 | 67 | 68 | {-| Encode a Float. `Infinity` and `NaN` are encoded as `null`. 69 | -} 70 | float : Float -> Value 71 | float = 72 | Native.Json.identity 73 | 74 | 75 | {-|-} 76 | bool : Bool -> Value 77 | bool = 78 | Native.Json.identity 79 | 80 | 81 | {-|-} 82 | null : Value 83 | null = 84 | Native.Json.encodeNull 85 | 86 | 87 | {-|-} 88 | object : List (String, Value) -> Value 89 | object = 90 | Native.Json.encodeObject 91 | 92 | 93 | {-|-} 94 | array : Array Value -> Value 95 | array = 96 | Native.Json.encodeArray 97 | 98 | 99 | {-|-} 100 | list : List Value -> Value 101 | list = 102 | Native.Json.encodeList 103 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Mouse.elm: -------------------------------------------------------------------------------- 1 | module Mouse 2 | ( position, x, y 3 | , isDown, clicks 4 | ) where 5 | 6 | {-| Library for working with mouse input. 7 | 8 | # Position 9 | @docs position, x, y 10 | 11 | # Button Status 12 | @docs isDown, clicks 13 | 14 | -} 15 | 16 | import Basics exposing (fst, snd) 17 | import Native.Mouse 18 | import Signal exposing (Signal) 19 | 20 | 21 | {-| The current mouse position. -} 22 | position : Signal (Int,Int) 23 | position = 24 | Native.Mouse.position 25 | 26 | 27 | {-| The current x-coordinate of the mouse. -} 28 | x : Signal Int 29 | x = 30 | Signal.map fst position 31 | 32 | 33 | {-| The current y-coordinate of the mouse. -} 34 | y : Signal Int 35 | y = 36 | Signal.map snd position 37 | 38 | 39 | {-| The current state of the mouse 40 | True when any mouse button is down, and false otherwise. -} 41 | isDown : Signal Bool 42 | isDown = 43 | Native.Mouse.isDown 44 | 45 | 46 | {-| Always equal to unit. Event triggers on every mouse click. -} 47 | clicks : Signal () 48 | clicks = 49 | Native.Mouse.clicks 50 | 51 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Basics.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Basics = {}; 2 | Elm.Native.Basics.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Basics = localRuntime.Native.Basics || {}; 5 | if (localRuntime.Native.Basics.values) 6 | { 7 | return localRuntime.Native.Basics.values; 8 | } 9 | 10 | var Utils = Elm.Native.Utils.make(localRuntime); 11 | 12 | function div(a, b) 13 | { 14 | return (a / b) | 0; 15 | } 16 | function rem(a, b) 17 | { 18 | return a % b; 19 | } 20 | function mod(a, b) 21 | { 22 | if (b === 0) 23 | { 24 | throw new Error('Cannot perform mod 0. Division by zero error.'); 25 | } 26 | var r = a % b; 27 | var m = a === 0 ? 0 : (b > 0 ? (a >= 0 ? r : r + b) : -mod(-a, -b)); 28 | 29 | return m === b ? 0 : m; 30 | } 31 | function logBase(base, n) 32 | { 33 | return Math.log(n) / Math.log(base); 34 | } 35 | function negate(n) 36 | { 37 | return -n; 38 | } 39 | function abs(n) 40 | { 41 | return n < 0 ? -n : n; 42 | } 43 | 44 | function min(a, b) 45 | { 46 | return Utils.cmp(a, b) < 0 ? a : b; 47 | } 48 | function max(a, b) 49 | { 50 | return Utils.cmp(a, b) > 0 ? a : b; 51 | } 52 | function clamp(lo, hi, n) 53 | { 54 | return Utils.cmp(n, lo) < 0 ? lo : Utils.cmp(n, hi) > 0 ? hi : n; 55 | } 56 | 57 | function xor(a, b) 58 | { 59 | return a !== b; 60 | } 61 | function not(b) 62 | { 63 | return !b; 64 | } 65 | function isInfinite(n) 66 | { 67 | return n === Infinity || n === -Infinity; 68 | } 69 | 70 | function truncate(n) 71 | { 72 | return n | 0; 73 | } 74 | 75 | function degrees(d) 76 | { 77 | return d * Math.PI / 180; 78 | } 79 | function turns(t) 80 | { 81 | return 2 * Math.PI * t; 82 | } 83 | function fromPolar(point) 84 | { 85 | var r = point._0; 86 | var t = point._1; 87 | return Utils.Tuple2(r * Math.cos(t), r * Math.sin(t)); 88 | } 89 | function toPolar(point) 90 | { 91 | var x = point._0; 92 | var y = point._1; 93 | return Utils.Tuple2(Math.sqrt(x * x + y * y), Math.atan2(y, x)); 94 | } 95 | 96 | return localRuntime.Native.Basics.values = { 97 | div: F2(div), 98 | rem: F2(rem), 99 | mod: F2(mod), 100 | 101 | pi: Math.PI, 102 | e: Math.E, 103 | cos: Math.cos, 104 | sin: Math.sin, 105 | tan: Math.tan, 106 | acos: Math.acos, 107 | asin: Math.asin, 108 | atan: Math.atan, 109 | atan2: F2(Math.atan2), 110 | 111 | degrees: degrees, 112 | turns: turns, 113 | fromPolar: fromPolar, 114 | toPolar: toPolar, 115 | 116 | sqrt: Math.sqrt, 117 | logBase: F2(logBase), 118 | negate: negate, 119 | abs: abs, 120 | min: F2(min), 121 | max: F2(max), 122 | clamp: F3(clamp), 123 | compare: Utils.compare, 124 | 125 | xor: F2(xor), 126 | not: not, 127 | 128 | truncate: truncate, 129 | ceiling: Math.ceil, 130 | floor: Math.floor, 131 | round: Math.round, 132 | toFloat: function(x) { return x; }, 133 | isNaN: isNaN, 134 | isInfinite: isInfinite 135 | }; 136 | }; 137 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Bitwise.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Bitwise = {}; 2 | Elm.Native.Bitwise.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Bitwise = localRuntime.Native.Bitwise || {}; 5 | if (localRuntime.Native.Bitwise.values) 6 | { 7 | return localRuntime.Native.Bitwise.values; 8 | } 9 | 10 | function and(a, b) { return a & b; } 11 | function or(a, b) { return a | b; } 12 | function xor(a, b) { return a ^ b; } 13 | function not(a) { return ~a; } 14 | function sll(a, offset) { return a << offset; } 15 | function sra(a, offset) { return a >> offset; } 16 | function srl(a, offset) { return a >>> offset; } 17 | 18 | return localRuntime.Native.Bitwise.values = { 19 | and: F2(and), 20 | or: F2(or), 21 | xor: F2(xor), 22 | complement: not, 23 | shiftLeft: F2(sll), 24 | shiftRightArithmatic: F2(sra), 25 | shiftRightLogical: F2(srl) 26 | }; 27 | }; 28 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Char.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Char = {}; 2 | Elm.Native.Char.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Char = localRuntime.Native.Char || {}; 5 | if (localRuntime.Native.Char.values) 6 | { 7 | return localRuntime.Native.Char.values; 8 | } 9 | 10 | var Utils = Elm.Native.Utils.make(localRuntime); 11 | 12 | return localRuntime.Native.Char.values = { 13 | fromCode: function(c) { return Utils.chr(String.fromCharCode(c)); }, 14 | toCode: function(c) { return c.charCodeAt(0); }, 15 | toUpper: function(c) { return Utils.chr(c.toUpperCase()); }, 16 | toLower: function(c) { return Utils.chr(c.toLowerCase()); }, 17 | toLocaleUpper: function(c) { return Utils.chr(c.toLocaleUpperCase()); }, 18 | toLocaleLower: function(c) { return Utils.chr(c.toLocaleLowerCase()); } 19 | }; 20 | }; 21 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Color.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Color = {}; 2 | Elm.Native.Color.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Color = localRuntime.Native.Color || {}; 5 | if (localRuntime.Native.Color.values) 6 | { 7 | return localRuntime.Native.Color.values; 8 | } 9 | 10 | function toCss(c) 11 | { 12 | var format = ''; 13 | var colors = ''; 14 | if (c.ctor === 'RGBA') 15 | { 16 | format = 'rgb'; 17 | colors = c._0 + ', ' + c._1 + ', ' + c._2; 18 | } 19 | else 20 | { 21 | format = 'hsl'; 22 | colors = (c._0 * 180 / Math.PI) + ', ' + 23 | (c._1 * 100) + '%, ' + 24 | (c._2 * 100) + '%'; 25 | } 26 | if (c._3 === 1) 27 | { 28 | return format + '(' + colors + ')'; 29 | } 30 | else 31 | { 32 | return format + 'a(' + colors + ', ' + c._3 + ')'; 33 | } 34 | } 35 | 36 | return localRuntime.Native.Color.values = { 37 | toCss: toCss 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Date.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Date = {}; 2 | Elm.Native.Date.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Date = localRuntime.Native.Date || {}; 5 | if (localRuntime.Native.Date.values) 6 | { 7 | return localRuntime.Native.Date.values; 8 | } 9 | 10 | var Result = Elm.Result.make(localRuntime); 11 | 12 | function readDate(str) 13 | { 14 | var date = new Date(str); 15 | return isNaN(date.getTime()) 16 | ? Result.Err('unable to parse \'' + str + '\' as a date') 17 | : Result.Ok(date); 18 | } 19 | 20 | var dayTable = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; 21 | var monthTable = 22 | ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 23 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; 24 | 25 | 26 | return localRuntime.Native.Date.values = { 27 | read: readDate, 28 | year: function(d) { return d.getFullYear(); }, 29 | month: function(d) { return { ctor: monthTable[d.getMonth()] }; }, 30 | day: function(d) { return d.getDate(); }, 31 | hour: function(d) { return d.getHours(); }, 32 | minute: function(d) { return d.getMinutes(); }, 33 | second: function(d) { return d.getSeconds(); }, 34 | millisecond: function(d) { return d.getMilliseconds(); }, 35 | toTime: function(d) { return d.getTime(); }, 36 | fromTime: function(t) { return new Date(t); }, 37 | dayOfWeek: function(d) { return { ctor: dayTable[d.getDay()] }; } 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Debug.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Debug = {}; 2 | Elm.Native.Debug.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Debug = localRuntime.Native.Debug || {}; 5 | if (localRuntime.Native.Debug.values) 6 | { 7 | return localRuntime.Native.Debug.values; 8 | } 9 | 10 | var toString = Elm.Native.Utils.make(localRuntime).toString; 11 | 12 | function log(tag, value) 13 | { 14 | var msg = tag + ': ' + toString(value); 15 | var process = process || {}; 16 | if (process.stdout) 17 | { 18 | process.stdout.write(msg); 19 | } 20 | else 21 | { 22 | console.log(msg); 23 | } 24 | return value; 25 | } 26 | 27 | function crash(message) 28 | { 29 | throw new Error(message); 30 | } 31 | 32 | function tracePath(tag, form) 33 | { 34 | if (localRuntime.debug) 35 | { 36 | return localRuntime.debug.trace(tag, form); 37 | } 38 | return form; 39 | } 40 | 41 | function watch(tag, value) 42 | { 43 | if (localRuntime.debug) 44 | { 45 | localRuntime.debug.watch(tag, value); 46 | } 47 | return value; 48 | } 49 | 50 | function watchSummary(tag, summarize, value) 51 | { 52 | if (localRuntime.debug) 53 | { 54 | localRuntime.debug.watch(tag, summarize(value)); 55 | } 56 | return value; 57 | } 58 | 59 | return localRuntime.Native.Debug.values = { 60 | crash: crash, 61 | tracePath: F2(tracePath), 62 | log: F2(log), 63 | watch: F2(watch), 64 | watchSummary: F3(watchSummary) 65 | }; 66 | }; 67 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Keyboard.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Keyboard = {}; 2 | 3 | Elm.Native.Keyboard.make = function(localRuntime) { 4 | localRuntime.Native = localRuntime.Native || {}; 5 | localRuntime.Native.Keyboard = localRuntime.Native.Keyboard || {}; 6 | if (localRuntime.Native.Keyboard.values) 7 | { 8 | return localRuntime.Native.Keyboard.values; 9 | } 10 | 11 | var NS = Elm.Native.Signal.make(localRuntime); 12 | 13 | 14 | function keyEvent(event) 15 | { 16 | return { 17 | alt: event.altKey, 18 | meta: event.metaKey, 19 | keyCode: event.keyCode 20 | }; 21 | } 22 | 23 | 24 | function keyStream(node, eventName, handler) 25 | { 26 | var stream = NS.input(eventName, { alt: false, meta: false, keyCode: 0 }); 27 | 28 | localRuntime.addListener([stream.id], node, eventName, function(e) { 29 | localRuntime.notify(stream.id, handler(e)); 30 | }); 31 | 32 | return stream; 33 | } 34 | 35 | var downs = keyStream(document, 'keydown', keyEvent); 36 | var ups = keyStream(document, 'keyup', keyEvent); 37 | var presses = keyStream(document, 'keypress', keyEvent); 38 | var blurs = keyStream(window, 'blur', function() { return null; }); 39 | 40 | 41 | return localRuntime.Native.Keyboard.values = { 42 | downs: downs, 43 | ups: ups, 44 | blurs: blurs, 45 | presses: presses 46 | }; 47 | }; 48 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Mouse.js: -------------------------------------------------------------------------------- 1 | Elm.Native = Elm.Native || {}; 2 | Elm.Native.Mouse = {}; 3 | Elm.Native.Mouse.make = function(localRuntime) { 4 | localRuntime.Native = localRuntime.Native || {}; 5 | localRuntime.Native.Mouse = localRuntime.Native.Mouse || {}; 6 | if (localRuntime.Native.Mouse.values) 7 | { 8 | return localRuntime.Native.Mouse.values; 9 | } 10 | 11 | var NS = Elm.Native.Signal.make(localRuntime); 12 | var Utils = Elm.Native.Utils.make(localRuntime); 13 | 14 | var position = NS.input('Mouse.position', Utils.Tuple2(0, 0)); 15 | 16 | var isDown = NS.input('Mouse.isDown', false); 17 | 18 | var clicks = NS.input('Mouse.clicks', Utils.Tuple0); 19 | 20 | var node = localRuntime.isFullscreen() 21 | ? document 22 | : localRuntime.node; 23 | 24 | localRuntime.addListener([clicks.id], node, 'click', function click() { 25 | localRuntime.notify(clicks.id, Utils.Tuple0); 26 | }); 27 | localRuntime.addListener([isDown.id], node, 'mousedown', function down() { 28 | localRuntime.notify(isDown.id, true); 29 | }); 30 | localRuntime.addListener([isDown.id], node, 'mouseup', function up() { 31 | localRuntime.notify(isDown.id, false); 32 | }); 33 | localRuntime.addListener([position.id], node, 'mousemove', function move(e) { 34 | localRuntime.notify(position.id, Utils.getXY(e)); 35 | }); 36 | 37 | return localRuntime.Native.Mouse.values = { 38 | position: position, 39 | isDown: isDown, 40 | clicks: clicks 41 | }; 42 | }; 43 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Port.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Port = {}; 2 | 3 | Elm.Native.Port.make = function(localRuntime) { 4 | localRuntime.Native = localRuntime.Native || {}; 5 | localRuntime.Native.Port = localRuntime.Native.Port || {}; 6 | if (localRuntime.Native.Port.values) 7 | { 8 | return localRuntime.Native.Port.values; 9 | } 10 | 11 | var NS; 12 | 13 | // INBOUND 14 | 15 | function inbound(name, type, converter) 16 | { 17 | if (!localRuntime.argsTracker[name]) 18 | { 19 | throw new Error( 20 | 'Port Error:\n' + 21 | 'No argument was given for the port named \'' + name + '\' with type:\n\n' + 22 | ' ' + type.split('\n').join('\n ') + '\n\n' + 23 | 'You need to provide an initial value!\n\n' + 24 | 'Find out more about ports here ' 25 | ); 26 | } 27 | var arg = localRuntime.argsTracker[name]; 28 | arg.used = true; 29 | 30 | return jsToElm(name, type, converter, arg.value); 31 | } 32 | 33 | 34 | function inboundSignal(name, type, converter) 35 | { 36 | var initialValue = inbound(name, type, converter); 37 | 38 | if (!NS) 39 | { 40 | NS = Elm.Native.Signal.make(localRuntime); 41 | } 42 | var signal = NS.input('inbound-port-' + name, initialValue); 43 | 44 | function send(jsValue) 45 | { 46 | var elmValue = jsToElm(name, type, converter, jsValue); 47 | setTimeout(function() { 48 | localRuntime.notify(signal.id, elmValue); 49 | }, 0); 50 | } 51 | 52 | localRuntime.ports[name] = { send: send }; 53 | 54 | return signal; 55 | } 56 | 57 | 58 | function jsToElm(name, type, converter, value) 59 | { 60 | try 61 | { 62 | return converter(value); 63 | } 64 | catch(e) 65 | { 66 | throw new Error( 67 | 'Port Error:\n' + 68 | 'Regarding the port named \'' + name + '\' with type:\n\n' + 69 | ' ' + type.split('\n').join('\n ') + '\n\n' + 70 | 'You just sent the value:\n\n' + 71 | ' ' + JSON.stringify(value) + '\n\n' + 72 | 'but it cannot be converted to the necessary type.\n' + 73 | e.message 74 | ); 75 | } 76 | } 77 | 78 | 79 | // OUTBOUND 80 | 81 | function outbound(name, converter, elmValue) 82 | { 83 | localRuntime.ports[name] = converter(elmValue); 84 | } 85 | 86 | 87 | function outboundSignal(name, converter, signal) 88 | { 89 | var subscribers = []; 90 | 91 | function subscribe(handler) 92 | { 93 | subscribers.push(handler); 94 | } 95 | function unsubscribe(handler) 96 | { 97 | subscribers.pop(subscribers.indexOf(handler)); 98 | } 99 | 100 | function notify(elmValue) 101 | { 102 | var jsValue = converter(elmValue); 103 | var len = subscribers.length; 104 | for (var i = 0; i < len; ++i) 105 | { 106 | subscribers[i](jsValue); 107 | } 108 | } 109 | 110 | if (!NS) 111 | { 112 | NS = Elm.Native.Signal.make(localRuntime); 113 | } 114 | NS.output('outbound-port-' + name, notify, signal); 115 | 116 | localRuntime.ports[name] = { 117 | subscribe: subscribe, 118 | unsubscribe: unsubscribe 119 | }; 120 | 121 | return signal; 122 | } 123 | 124 | 125 | return localRuntime.Native.Port.values = { 126 | inbound: inbound, 127 | outbound: outbound, 128 | inboundSignal: inboundSignal, 129 | outboundSignal: outboundSignal 130 | }; 131 | }; 132 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Regex.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Regex = {}; 2 | Elm.Native.Regex.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Regex = localRuntime.Native.Regex || {}; 5 | if (localRuntime.Native.Regex.values) 6 | { 7 | return localRuntime.Native.Regex.values; 8 | } 9 | if ('values' in Elm.Native.Regex) 10 | { 11 | return localRuntime.Native.Regex.values = Elm.Native.Regex.values; 12 | } 13 | 14 | var List = Elm.Native.List.make(localRuntime); 15 | var Maybe = Elm.Maybe.make(localRuntime); 16 | 17 | function escape(str) 18 | { 19 | return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); 20 | } 21 | function caseInsensitive(re) 22 | { 23 | return new RegExp(re.source, 'gi'); 24 | } 25 | function regex(raw) 26 | { 27 | return new RegExp(raw, 'g'); 28 | } 29 | 30 | function contains(re, string) 31 | { 32 | return string.match(re) !== null; 33 | } 34 | 35 | function find(n, re, str) 36 | { 37 | n = n.ctor === 'All' ? Infinity : n._0; 38 | var out = []; 39 | var number = 0; 40 | var string = str; 41 | var lastIndex = re.lastIndex; 42 | var prevLastIndex = -1; 43 | var result; 44 | while (number++ < n && (result = re.exec(string))) 45 | { 46 | if (prevLastIndex === re.lastIndex) break; 47 | var i = result.length - 1; 48 | var subs = new Array(i); 49 | while (i > 0) 50 | { 51 | var submatch = result[i]; 52 | subs[--i] = submatch === undefined 53 | ? Maybe.Nothing 54 | : Maybe.Just(submatch); 55 | } 56 | out.push({ 57 | match: result[0], 58 | submatches: List.fromArray(subs), 59 | index: result.index, 60 | number: number 61 | }); 62 | prevLastIndex = re.lastIndex; 63 | } 64 | re.lastIndex = lastIndex; 65 | return List.fromArray(out); 66 | } 67 | 68 | function replace(n, re, replacer, string) 69 | { 70 | n = n.ctor === 'All' ? Infinity : n._0; 71 | var count = 0; 72 | function jsReplacer(match) 73 | { 74 | if (count++ >= n) 75 | { 76 | return match; 77 | } 78 | var i = arguments.length - 3; 79 | var submatches = new Array(i); 80 | while (i > 0) 81 | { 82 | var submatch = arguments[i]; 83 | submatches[--i] = submatch === undefined 84 | ? Maybe.Nothing 85 | : Maybe.Just(submatch); 86 | } 87 | return replacer({ 88 | match: match, 89 | submatches: List.fromArray(submatches), 90 | index: arguments[i - 1], 91 | number: count 92 | }); 93 | } 94 | return string.replace(re, jsReplacer); 95 | } 96 | 97 | function split(n, re, str) 98 | { 99 | n = n.ctor === 'All' ? Infinity : n._0; 100 | if (n === Infinity) 101 | { 102 | return List.fromArray(str.split(re)); 103 | } 104 | var string = str; 105 | var result; 106 | var out = []; 107 | var start = re.lastIndex; 108 | while (n--) 109 | { 110 | if (!(result = re.exec(string))) break; 111 | out.push(string.slice(start, result.index)); 112 | start = re.lastIndex; 113 | } 114 | out.push(string.slice(start)); 115 | return List.fromArray(out); 116 | } 117 | 118 | return Elm.Native.Regex.values = { 119 | regex: regex, 120 | caseInsensitive: caseInsensitive, 121 | escape: escape, 122 | 123 | contains: F2(contains), 124 | find: F3(find), 125 | replace: F4(replace), 126 | split: F3(split) 127 | }; 128 | }; 129 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Time.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Time = {}; 2 | 3 | Elm.Native.Time.make = function(localRuntime) 4 | { 5 | localRuntime.Native = localRuntime.Native || {}; 6 | localRuntime.Native.Time = localRuntime.Native.Time || {}; 7 | if (localRuntime.Native.Time.values) 8 | { 9 | return localRuntime.Native.Time.values; 10 | } 11 | 12 | var NS = Elm.Native.Signal.make(localRuntime); 13 | var Maybe = Elm.Maybe.make(localRuntime); 14 | 15 | 16 | // FRAMES PER SECOND 17 | 18 | function fpsWhen(desiredFPS, isOn) 19 | { 20 | var msPerFrame = 1000 / desiredFPS; 21 | var ticker = NS.input('fps-' + desiredFPS, null); 22 | 23 | function notifyTicker() 24 | { 25 | localRuntime.notify(ticker.id, null); 26 | } 27 | 28 | function firstArg(x, y) 29 | { 30 | return x; 31 | } 32 | 33 | // input fires either when isOn changes, or when ticker fires. 34 | // Its value is a tuple with the current timestamp, and the state of isOn 35 | var input = NS.timestamp(A3(NS.map2, F2(firstArg), NS.dropRepeats(isOn), ticker)); 36 | 37 | var initialState = { 38 | isOn: false, 39 | time: localRuntime.timer.programStart, 40 | delta: 0 41 | }; 42 | 43 | var timeoutId; 44 | 45 | function update(input, state) 46 | { 47 | var currentTime = input._0; 48 | var isOn = input._1; 49 | var wasOn = state.isOn; 50 | var previousTime = state.time; 51 | 52 | if (isOn) 53 | { 54 | timeoutId = localRuntime.setTimeout(notifyTicker, msPerFrame); 55 | } 56 | else if (wasOn) 57 | { 58 | clearTimeout(timeoutId); 59 | } 60 | 61 | return { 62 | isOn: isOn, 63 | time: currentTime, 64 | delta: (isOn && !wasOn) ? 0 : currentTime - previousTime 65 | }; 66 | } 67 | 68 | return A2( 69 | NS.map, 70 | function(state) { return state.delta; }, 71 | A3(NS.foldp, F2(update), update(input.value, initialState), input) 72 | ); 73 | } 74 | 75 | 76 | // EVERY 77 | 78 | function every(t) 79 | { 80 | var ticker = NS.input('every-' + t, null); 81 | function tellTime() 82 | { 83 | localRuntime.notify(ticker.id, null); 84 | } 85 | var clock = A2(NS.map, fst, NS.timestamp(ticker)); 86 | setInterval(tellTime, t); 87 | return clock; 88 | } 89 | 90 | 91 | function fst(pair) 92 | { 93 | return pair._0; 94 | } 95 | 96 | 97 | function read(s) 98 | { 99 | var t = Date.parse(s); 100 | return isNaN(t) ? Maybe.Nothing : Maybe.Just(t); 101 | } 102 | 103 | return localRuntime.Native.Time.values = { 104 | fpsWhen: F2(fpsWhen), 105 | every: every, 106 | toDate: function(t) { return new Date(t); }, 107 | read: read 108 | }; 109 | }; 110 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Transform2D.js: -------------------------------------------------------------------------------- 1 | Elm.Native.Transform2D = {}; 2 | Elm.Native.Transform2D.make = function(localRuntime) { 3 | localRuntime.Native = localRuntime.Native || {}; 4 | localRuntime.Native.Transform2D = localRuntime.Native.Transform2D || {}; 5 | if (localRuntime.Native.Transform2D.values) 6 | { 7 | return localRuntime.Native.Transform2D.values; 8 | } 9 | 10 | var A; 11 | if (typeof Float32Array === 'undefined') 12 | { 13 | A = function(arr) 14 | { 15 | this.length = arr.length; 16 | this[0] = arr[0]; 17 | this[1] = arr[1]; 18 | this[2] = arr[2]; 19 | this[3] = arr[3]; 20 | this[4] = arr[4]; 21 | this[5] = arr[5]; 22 | }; 23 | } 24 | else 25 | { 26 | A = Float32Array; 27 | } 28 | 29 | // layout of matrix in an array is 30 | // 31 | // | m11 m12 dx | 32 | // | m21 m22 dy | 33 | // | 0 0 1 | 34 | // 35 | // new A([ m11, m12, dx, m21, m22, dy ]) 36 | 37 | var identity = new A([1, 0, 0, 0, 1, 0]); 38 | function matrix(m11, m12, m21, m22, dx, dy) 39 | { 40 | return new A([m11, m12, dx, m21, m22, dy]); 41 | } 42 | 43 | function rotation(t) 44 | { 45 | var c = Math.cos(t); 46 | var s = Math.sin(t); 47 | return new A([c, -s, 0, s, c, 0]); 48 | } 49 | 50 | function rotate(t, m) 51 | { 52 | var c = Math.cos(t); 53 | var s = Math.sin(t); 54 | var m11 = m[0], m12 = m[1], m21 = m[3], m22 = m[4]; 55 | return new A([m11 * c + m12 * s, -m11 * s + m12 * c, m[2], 56 | m21 * c + m22 * s, -m21 * s + m22 * c, m[5]]); 57 | } 58 | /* 59 | function move(xy,m) { 60 | var x = xy._0; 61 | var y = xy._1; 62 | var m11 = m[0], m12 = m[1], m21 = m[3], m22 = m[4]; 63 | return new A([m11, m12, m11*x + m12*y + m[2], 64 | m21, m22, m21*x + m22*y + m[5]]); 65 | } 66 | function scale(s,m) { return new A([m[0]*s, m[1]*s, m[2], m[3]*s, m[4]*s, m[5]]); } 67 | function scaleX(x,m) { return new A([m[0]*x, m[1], m[2], m[3]*x, m[4], m[5]]); } 68 | function scaleY(y,m) { return new A([m[0], m[1]*y, m[2], m[3], m[4]*y, m[5]]); } 69 | function reflectX(m) { return new A([-m[0], m[1], m[2], -m[3], m[4], m[5]]); } 70 | function reflectY(m) { return new A([m[0], -m[1], m[2], m[3], -m[4], m[5]]); } 71 | 72 | function transform(m11, m21, m12, m22, mdx, mdy, n) { 73 | var n11 = n[0], n12 = n[1], n21 = n[3], n22 = n[4], ndx = n[2], ndy = n[5]; 74 | return new A([m11*n11 + m12*n21, 75 | m11*n12 + m12*n22, 76 | m11*ndx + m12*ndy + mdx, 77 | m21*n11 + m22*n21, 78 | m21*n12 + m22*n22, 79 | m21*ndx + m22*ndy + mdy]); 80 | } 81 | */ 82 | function multiply(m, n) 83 | { 84 | var m11 = m[0], m12 = m[1], m21 = m[3], m22 = m[4], mdx = m[2], mdy = m[5]; 85 | var n11 = n[0], n12 = n[1], n21 = n[3], n22 = n[4], ndx = n[2], ndy = n[5]; 86 | return new A([m11 * n11 + m12 * n21, 87 | m11 * n12 + m12 * n22, 88 | m11 * ndx + m12 * ndy + mdx, 89 | m21 * n11 + m22 * n21, 90 | m21 * n12 + m22 * n22, 91 | m21 * ndx + m22 * ndy + mdy]); 92 | } 93 | 94 | return localRuntime.Native.Transform2D.values = { 95 | identity: identity, 96 | matrix: F6(matrix), 97 | rotation: rotation, 98 | multiply: F2(multiply) 99 | /* 100 | transform: F7(transform), 101 | rotate: F2(rotate), 102 | move: F2(move), 103 | scale: F2(scale), 104 | scaleX: F2(scaleX), 105 | scaleY: F2(scaleY), 106 | reflectX: reflectX, 107 | reflectY: reflectY 108 | */ 109 | }; 110 | }; 111 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Native/Window.js: -------------------------------------------------------------------------------- 1 | Elm.Native = Elm.Native || {}; 2 | Elm.Native.Window = {}; 3 | Elm.Native.Window.make = function make(localRuntime) { 4 | localRuntime.Native = localRuntime.Native || {}; 5 | localRuntime.Native.Window = localRuntime.Native.Window || {}; 6 | if (localRuntime.Native.Window.values) 7 | { 8 | return localRuntime.Native.Window.values; 9 | } 10 | 11 | var NS = Elm.Native.Signal.make(localRuntime); 12 | var Tuple2 = Elm.Native.Utils.make(localRuntime).Tuple2; 13 | 14 | 15 | function getWidth() 16 | { 17 | return localRuntime.node.clientWidth; 18 | } 19 | 20 | 21 | function getHeight() 22 | { 23 | if (localRuntime.isFullscreen()) 24 | { 25 | return window.innerHeight; 26 | } 27 | return localRuntime.node.clientHeight; 28 | } 29 | 30 | 31 | var dimensions = NS.input('Window.dimensions', Tuple2(getWidth(), getHeight())); 32 | 33 | 34 | function resizeIfNeeded() 35 | { 36 | // Do not trigger event if the dimensions have not changed. 37 | // This should be most of the time. 38 | var w = getWidth(); 39 | var h = getHeight(); 40 | if (dimensions.value._0 === w && dimensions.value._1 === h) 41 | { 42 | return; 43 | } 44 | 45 | setTimeout(function() { 46 | // Check again to see if the dimensions have changed. 47 | // It is conceivable that the dimensions have changed 48 | // again while some other event was being processed. 49 | w = getWidth(); 50 | h = getHeight(); 51 | if (dimensions.value._0 === w && dimensions.value._1 === h) 52 | { 53 | return; 54 | } 55 | localRuntime.notify(dimensions.id, Tuple2(w, h)); 56 | }, 0); 57 | } 58 | 59 | 60 | localRuntime.addListener([dimensions.id], window, 'resize', resizeIfNeeded); 61 | 62 | 63 | return localRuntime.Native.Window.values = { 64 | dimensions: dimensions, 65 | resizeIfNeeded: resizeIfNeeded 66 | }; 67 | }; 68 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Touch.elm: -------------------------------------------------------------------------------- 1 | module Touch 2 | ( Touch, touches 3 | , taps 4 | ) where 5 | 6 | {-| This is an early version of the touch library. It will likely grow to 7 | include gestures that would be useful for both games and web-pages. 8 | 9 | # Touches 10 | @docs Touch, touches 11 | 12 | # Gestures 13 | @docs taps 14 | -} 15 | 16 | import Native.Touch 17 | import Time exposing (Time) 18 | import Signal exposing (Signal) 19 | 20 | 21 | {-| Every `Touch` has `xy` coordinates. It also has an identifier 22 | `id` to distinguish one touch from another. 23 | 24 | A touch also keeps info about the initial point and time of contact: 25 | `x0`, `y0`, and `t0`. This helps compute more complicated gestures 26 | like taps, drags, and swipes which need to know about timing or direction. 27 | -} 28 | type alias Touch = 29 | { x : Int 30 | , y : Int 31 | , id : Int 32 | , x0 : Int 33 | , y0 : Int 34 | , t0 : Time 35 | } 36 | 37 | 38 | {-| A list of ongoing touches. -} 39 | touches : Signal (List Touch) 40 | touches = 41 | Native.Touch.touches 42 | 43 | 44 | {-| The last position that was tapped. Default value is `{x=0,y=0}`. 45 | Updates whenever the user taps the screen. 46 | -} 47 | taps : Signal { x:Int, y:Int } 48 | taps = 49 | Native.Touch.taps 50 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Trampoline.elm: -------------------------------------------------------------------------------- 1 | module Trampoline 2 | ( trampoline 3 | , Trampoline(..) 4 | ) where 5 | 6 | {-| A [trampoline](http://en.wikipedia.org/wiki/Tail-recursive_function#Through_trampolining) 7 | makes it possible to recursively call a function without growing the stack. 8 | 9 | Popular JavaScript implementations do not perform any tail-call elimination, so 10 | recursive functions can cause a stack overflow if they go too deep. Trampolines 11 | permit unbounded recursion despite limitations in JavaScript. 12 | 13 | This strategy may create many intermediate closures, which is very expensive in 14 | JavaScript, so use this library only when it is essential that you recurse deeply. 15 | 16 | # Trampolines 17 | @docs trampoline, Trampoline 18 | -} 19 | 20 | 21 | {-| A way to build computations that may be deeply recursive. We will take an 22 | example of a tail-recursive function and rewrite it in a way that lets us use 23 | a trampoline: 24 | 25 | length : List a -> Int 26 | length list = length' 0 list 27 | 28 | length' : Int -> List a -> Int 29 | length' accum list = 30 | case list of 31 | [] -> accum 32 | hd::tl -> length' (accum+1) tl 33 | 34 | This finds the length of a list, but if the list is too long, it may cause a 35 | stack overflow. We can rewrite it as follows: 36 | 37 | length : List a -> Int 38 | length list = trampoline (length' 0 list) 39 | 40 | length' : Int -> List a -> Trampoline Int 41 | length' accum list = 42 | case list of 43 | [] -> Done accum 44 | hd::tl -> Continue (\() -> length' (accum+1) tl) 45 | 46 | Now it uses a trampoline and can recurse without growing the stack! 47 | -} 48 | type Trampoline a 49 | = Done a 50 | | Continue (() -> Trampoline a) 51 | 52 | 53 | {-| Evaluate a trampolined value in constant space. -} 54 | trampoline : Trampoline a -> a 55 | trampoline tramp = 56 | case tramp of 57 | Done value -> 58 | value 59 | 60 | Continue f -> 61 | trampoline (f ()) 62 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Transform2D.elm: -------------------------------------------------------------------------------- 1 | module Transform2D 2 | ( Transform2D 3 | , identity, matrix, multiply 4 | , rotation, translation 5 | , scale, scaleX, scaleY 6 | ) where 7 | 8 | {-| A library for performing [2D matrix transformations][affine]. It 9 | is used primarily with the `groupTransform` function from 10 | [`Graphics.Collage`](Graphics-Collage) and allows you to do things 11 | like rotation, scaling, translation, shearing, and reflection. 12 | 13 | Note that all the matrices in this library are 3x3 matrices of homogeneous 14 | coordinates, used for [affine transformations][affine]. Since the bottom row as 15 | always `0 0 1` in these matrices, it is omitted in the diagrams below. 16 | 17 | [affine]: http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations 18 | 19 | # Transforms 20 | @docs Transform2D, identity, matrix, rotation, translation, scale, scaleX, scaleY 21 | 22 | # Multiplication 23 | @docs multiply 24 | -} 25 | 26 | import Native.Transform2D 27 | 28 | 29 | {-| A matrix representing a 2D transformation. 30 | -} 31 | type Transform2D = Transform2D 32 | 33 | 34 | {-| Create an identity transform. Transforming by the identity does 35 | not change anything, but it can come in handy as a default or 36 | base case. 37 | 38 | / 1 0 0 \ 39 | \ 0 1 0 / 40 | -} 41 | identity : Transform2D 42 | identity = 43 | Native.Transform2D.identity 44 | 45 | 46 | {-| Create a transformation matrix. This lets you create transforms 47 | such as scales, shears, reflections, and translations. 48 | 49 | matrix a b c d x y 50 | 51 | / a b x \ 52 | \ c d y / 53 | 54 | Note that `x` and `y` are the translation values. 55 | -} 56 | matrix : Float -> Float -> Float -> Float -> Float -> Float -> Transform2D 57 | matrix = 58 | Native.Transform2D.matrix 59 | 60 | 61 | {-| Create a [rotation matrix](http://en.wikipedia.org/wiki/Rotation_matrix). 62 | Given an angle t, it creates a counterclockwise rotation matrix: 63 | 64 | rotation t 65 | 66 | / cos t -sin t 0 \ 67 | \ sin t cos t 0 / 68 | -} 69 | rotation : Float -> Transform2D 70 | rotation = 71 | Native.Transform2D.rotation 72 | 73 | 74 | {-| Create a transformation matrix for translation. 75 | 76 | translation x y 77 | 78 | / 1 0 x \ 79 | \ 0 1 y / 80 | -} 81 | translation : Float -> Float -> Transform2D 82 | translation x y = 83 | matrix 1 0 0 1 x y 84 | 85 | 86 | {-| Creates a transformation matrix for scaling by a all directions. 87 | 88 | scale s 89 | 90 | / s 0 0 \ 91 | \ 0 s 0 / 92 | -} 93 | scale : Float -> Transform2D 94 | scale s = 95 | matrix s 0 0 s 0 0 96 | 97 | 98 | {-| Create a transformation for horizontal scaling. -} 99 | scaleX : Float -> Transform2D 100 | scaleX x = 101 | matrix x 0 0 1 0 0 102 | 103 | 104 | {-| Create a transformation for vertical scaling. -} 105 | scaleY : Float -> Transform2D 106 | scaleY y = 107 | matrix 1 0 0 y 0 0 108 | 109 | 110 | {-| Multiply two transforms together. 111 | 112 | multiply m n 113 | 114 | / ma mb mx \ / na nb nx \ 115 | | mc md my | . | nc nd ny | 116 | \ 0 0 1 / \ 0 0 1 / 117 | -} 118 | multiply : Transform2D -> Transform2D -> Transform2D 119 | multiply = 120 | Native.Transform2D.multiply 121 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/src/Window.elm: -------------------------------------------------------------------------------- 1 | module Window 2 | ( dimensions, width, height 3 | ) where 4 | 5 | {-| Provides information about the container that your Elm program lives in. 6 | When you embed Elm in a `
` it gives the dimensions of the container, not 7 | the whole window. 8 | 9 | # Dimensions 10 | @docs dimensions, width, height 11 | 12 | -} 13 | 14 | import Basics exposing (fst,snd) 15 | import Native.Window 16 | import Signal exposing (Signal) 17 | 18 | 19 | {-| The current width and height of the window (i.e. the area viewable to the 20 | user, not including scroll bars). -} 21 | dimensions : Signal (Int,Int) 22 | dimensions = 23 | Native.Window.dimensions 24 | 25 | 26 | {-| The current width of the window. -} 27 | width : Signal Int 28 | width = 29 | Signal.map fst dimensions 30 | 31 | 32 | {-| The current height of the window. -} 33 | height : Signal Int 34 | height = 35 | Signal.map snd dimensions -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test.elm: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Basics exposing (..) 4 | import Signal exposing (..) 5 | 6 | import ElmTest.Assertion as A 7 | import ElmTest.Run as R 8 | import ElmTest.Runner.Console exposing (runDisplay) 9 | import ElmTest.Test exposing (..) 10 | import IO.IO exposing (..) 11 | import IO.Runner exposing (Request, Response) 12 | import IO.Runner as Run 13 | 14 | import Test.Array as Array 15 | import Test.Basics as Basics 16 | import Test.Bitwise as Bitwise 17 | import Test.Char as Char 18 | import Test.CodeGen as CodeGen 19 | import Test.Dict as Dict 20 | import Test.Equality as Equality 21 | import Test.Json as Json 22 | import Test.List as List 23 | import Test.Result as Result 24 | import Test.Set as Set 25 | import Test.String as String 26 | import Test.Regex as Regex 27 | import Test.Trampoline as Trampoline 28 | 29 | tests : Test 30 | tests = 31 | suite "Elm Standard Library Tests" 32 | [ Array.tests 33 | , Basics.tests 34 | , Bitwise.tests 35 | , Char.tests 36 | , CodeGen.tests 37 | , Dict.tests 38 | , Equality.tests 39 | , Json.tests 40 | , List.tests 41 | , Result.tests 42 | , Set.tests 43 | , String.tests 44 | , Regex.tests 45 | , Trampoline.tests 46 | ] 47 | 48 | console : IO () 49 | console = runDisplay tests 50 | 51 | port requests : Signal Request 52 | port requests = Run.run responses console 53 | 54 | port responses : Signal Response 55 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Bitwise.elm: -------------------------------------------------------------------------------- 1 | module Test.Bitwise (tests) where 2 | 3 | import Basics exposing (..) 4 | import Bitwise 5 | 6 | import ElmTest.Assertion exposing (..) 7 | import ElmTest.Test exposing (..) 8 | 9 | tests : Test 10 | tests = 11 | suite "Bitwise" 12 | [ suite "and" 13 | [ test "and with 32 bit integers" <| assertEqual 1 (Bitwise.and 5 3) 14 | , test "and with 0 as first argument" <| assertEqual 0 (Bitwise.and 0 1450) 15 | , test "and with 0 as second argument" <| assertEqual 0 (Bitwise.and 274 0) 16 | , test "and with -1 as first argument" <| assertEqual 2671 (Bitwise.and -1 2671) 17 | , test "and with -1 as second argument" <| assertEqual 96 (Bitwise.and 96 -1) 18 | ] 19 | , suite "or" 20 | [ test "or with 32 bit integers" <| assertEqual 15 (Bitwise.or 9 14) 21 | , test "or with 0 as first argument" <| assertEqual 843 (Bitwise.or 0 843) 22 | , test "or with 0 as second argument" <| assertEqual 19 (Bitwise.or 19 0) 23 | , test "or with -1 as first argument" <| assertEqual -1 (Bitwise.or -1 2360) 24 | , test "or with -1 as second argument" <| assertEqual -1 (Bitwise.or 3 -1) 25 | ] 26 | , suite "xor" 27 | [ test "xor with 32 bit integers" <| assertEqual 604 (Bitwise.xor 580 24) 28 | , test "xor with 0 as first argument" <| assertEqual 56 (Bitwise.xor 0 56) 29 | , test "xor with 0 as second argument" <| assertEqual -268 (Bitwise.xor -268 0) 30 | , test "xor with -1 as first argument" <| assertEqual -25 (Bitwise.xor -1 24) 31 | , test "xor with -1 as second argument" <| assertEqual 25601 (Bitwise.xor -25602 -1) 32 | ] 33 | , suite "complement" 34 | [ test "complement a positive" <| assertEqual -9 (Bitwise.complement 8) 35 | , test "complement a negative" <| assertEqual 278 (Bitwise.complement -279) 36 | ] 37 | , suite "shiftLeft" 38 | [ test "8 `shiftLeft` 1 == 16" <| assertEqual 16 (Bitwise.shiftLeft 8 1) 39 | , test "8 `shiftLeft` 2 == 32" <| assertEqual 32 (Bitwise.shiftLeft 8 2) 40 | ] 41 | , suite "shiftRight" 42 | [ test "32 `shiftRight` 1 == 16" <| assertEqual 16 (Bitwise.shiftRight 32 1) 43 | , test "32 `shiftRight` 2 == 8" <| assertEqual 8 (Bitwise.shiftRight 32 2) 44 | , test "-32 `shiftRight` 1 == -16" <| assertEqual -16 (Bitwise.shiftRight -32 1) 45 | ] 46 | , suite "shiftRightLogical" 47 | [ test "32 `shiftRightLogical` 1 == 16" <| assertEqual 16 (Bitwise.shiftRightLogical 32 1) 48 | , test "32 `shiftRightLogical` 2 == 8" <| assertEqual 8 (Bitwise.shiftRightLogical 32 2) 49 | , test "-32 `shiftRightLogical` 1 == 2147483632" <| assertEqual 2147483632 (Bitwise.shiftRightLogical -32 1) 50 | ] 51 | ] 52 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/CodeGen.elm: -------------------------------------------------------------------------------- 1 | module Test.CodeGen (tests) where 2 | 3 | import Basics exposing (..) 4 | import ElmTest.Assertion exposing (..) 5 | import ElmTest.Test exposing (..) 6 | 7 | import Maybe 8 | import Maybe exposing (..) 9 | 10 | casePrime m' = 11 | case m' of 12 | Just x -> x 13 | Nothing -> 0 14 | 15 | patternPrime = 16 | case Just 42 of 17 | Just x' -> x' 18 | Nothing -> 0 19 | 20 | letQualified = 21 | let (Maybe.Just x) = Just 42 22 | in x 23 | 24 | caseQualified = 25 | case Just 42 of 26 | Maybe.Just x -> x 27 | Nothing -> 0 28 | 29 | caseScope : String 30 | caseScope = 31 | case "Not this one!" of 32 | string -> 33 | case "Hi" of 34 | string -> string 35 | 36 | tests : Test 37 | tests = 38 | let primes = 39 | suite "Primes" 40 | [ test "case" <| assertEqual 42 (casePrime (Just 42)) 41 | , test "pattern" <| assertEqual 42 patternPrime 42 | ] 43 | qualifiedPatterns = 44 | suite "Qualified Patterns" 45 | [ test "let" <| assertEqual 42 letQualified 46 | , test "case" <| assertEqual 42 caseQualified 47 | ] 48 | scope = 49 | suite "Scoping" 50 | [ test "case" <| assertEqual "Hi" caseScope ] 51 | in 52 | suite "CodeGen" 53 | [ primes 54 | , qualifiedPatterns 55 | , scope 56 | ] 57 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Dict.elm: -------------------------------------------------------------------------------- 1 | module Test.Dict (tests) where 2 | 3 | import Basics exposing (..) 4 | import Dict 5 | import List 6 | import Maybe exposing (..) 7 | 8 | import ElmTest.Assertion exposing (..) 9 | import ElmTest.Test exposing (..) 10 | 11 | animals : Dict.Dict String String 12 | animals = Dict.fromList [ ("Tom", "cat"), ("Jerry", "mouse") ] 13 | 14 | tests : Test 15 | tests = 16 | let buildTests = suite "build Tests" 17 | [ test "empty" <| assertEqual (Dict.fromList []) (Dict.empty) 18 | , test "singleton" <| assertEqual (Dict.fromList [("k","v")]) (Dict.singleton "k" "v") 19 | , test "insert" <| assertEqual (Dict.fromList [("k","v")]) (Dict.insert "k" "v" Dict.empty) 20 | , test "insert replace" <| assertEqual (Dict.fromList [("k","vv")]) (Dict.insert "k" "vv" (Dict.singleton "k" "v")) 21 | , test "update" <| assertEqual (Dict.fromList [("k","vv")]) (Dict.update "k" (\v->Just "vv") (Dict.singleton "k" "v")) 22 | , test "update Nothing" <| assertEqual Dict.empty (Dict.update "k" (\v->Nothing) (Dict.singleton "k" "v")) 23 | , test "remove" <| assertEqual Dict.empty (Dict.remove "k" (Dict.singleton "k" "v")) 24 | , test "remove not found" <| assertEqual (Dict.singleton "k" "v") (Dict.remove "kk" (Dict.singleton "k" "v")) 25 | ] 26 | queryTests = suite "query Tests" 27 | [ test "member 1" <| assertEqual True (Dict.member "Tom" animals) 28 | , test "member 2" <| assertEqual False (Dict.member "Spike" animals) 29 | , test "get 1" <| assertEqual (Just "cat") (Dict.get "Tom" animals) 30 | , test "get 2" <| assertEqual Nothing (Dict.get "Spike" animals) 31 | , test "size of empty dictionary" <| assertEqual 0 (Dict.size Dict.empty) 32 | , test "size of example dictionary" <| assertEqual 2 (Dict.size animals) 33 | ] 34 | combineTests = suite "combine Tests" 35 | [ test "union" <| assertEqual animals (Dict.union (Dict.singleton "Jerry" "mouse") (Dict.singleton "Tom" "cat")) 36 | , test "union collison" <| assertEqual (Dict.singleton "Tom" "cat") (Dict.union (Dict.singleton "Tom" "cat") (Dict.singleton "Tom" "mouse")) 37 | , test "intersect" <| assertEqual (Dict.singleton "Tom" "cat") (Dict.intersect animals (Dict.singleton "Tom" "cat")) 38 | , test "diff" <| assertEqual (Dict.singleton "Jerry" "mouse") (Dict.diff animals (Dict.singleton "Tom" "cat")) 39 | ] 40 | transformTests = suite "transform Tests" 41 | [ test "filter" <| assertEqual (Dict.singleton "Tom" "cat") (Dict.filter (\k v -> k == "Tom") animals) 42 | , test "partition" <| assertEqual (Dict.singleton "Tom" "cat", Dict.singleton "Jerry" "mouse") (Dict.partition (\k v -> k == "Tom") animals) 43 | ] 44 | in 45 | suite "Dict Tests" 46 | [ buildTests 47 | , queryTests 48 | , combineTests 49 | , transformTests 50 | ] 51 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Equality.elm: -------------------------------------------------------------------------------- 1 | module Test.Equality (tests) where 2 | 3 | import Basics exposing (..) 4 | import Maybe exposing (..) 5 | 6 | import ElmTest.Assertion exposing (..) 7 | import ElmTest.Test exposing (..) 8 | 9 | type Different 10 | = A String 11 | | B (List Int) 12 | 13 | tests : Test 14 | tests = 15 | let diffTests = suite "ADT equality" 16 | [ test "As eq" <| assert (A "a" == A "a") 17 | , test "Bs eq" <| assert (B [1] == B [1]) 18 | , test "A left neq" <| assert (A "a" /= B [1]) 19 | , test "A left neq" <| assert (B [1] /= A "a") 20 | ] 21 | recordTests = suite "Record equality" 22 | [ test "empty same" <| assert ({} == {}) 23 | , test "ctor same" <| assert ({ctor = Just 3} == {ctor = Just 3}) 24 | , test "ctor diff" <| assert ({ctor = Just 3} /= {ctor = Nothing}) 25 | ] 26 | in 27 | suite "Equality Tests" [diffTests, recordTests] 28 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Json.elm: -------------------------------------------------------------------------------- 1 | module Test.Json (tests) where 2 | 3 | import Basics exposing (..) 4 | import Result exposing (..) 5 | import Json.Decode 6 | 7 | import ElmTest.Assertion exposing (..) 8 | import ElmTest.Test exposing (..) 9 | 10 | tests : Test 11 | tests = 12 | let testInt val str = 13 | case Json.Decode.decodeString Json.Decode.int str of 14 | Ok _ -> assertEqual val True 15 | Err _ -> assertEqual val False 16 | in 17 | suite "Json decode int" 18 | [ test "whole int" <| testInt True "4" 19 | , test "-whole int" <| testInt True "-4" 20 | , test "whole float" <| testInt True "4.0" 21 | , test "-whole float" <| testInt True "-4.0" 22 | , test "large int" <| testInt True "1801439850948" 23 | , test "-large int" <| testInt True "-1801439850948" 24 | , test "float" <| testInt False "4.2" 25 | , test "-float" <| testInt False "-4.2" 26 | , test "Infinity" <| testInt False "Infinity" 27 | , test "-Infinity" <| testInt False "-Infinity" 28 | , test "NaN" <| testInt False "NaN" 29 | , test "-NaN" <| testInt False "-NaN" 30 | , test "true" <| testInt False "true" 31 | , test "false" <| testInt False "false" 32 | , test "string" <| testInt False "\"string\"" 33 | , test "object" <| testInt False "{}" 34 | , test "null" <| testInt False "null" 35 | , test "undefined" <| testInt False "undefined" 36 | ] 37 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Regex.elm: -------------------------------------------------------------------------------- 1 | module Test.Regex (tests) where 2 | 3 | import Basics exposing (..) 4 | 5 | import Regex exposing (..) 6 | 7 | import ElmTest.Assertion exposing (..) 8 | import ElmTest.Test exposing (..) 9 | 10 | 11 | tests : Test 12 | tests = 13 | let simpleTests = suite "Simple Stuff" 14 | [ test "split All" <| assertEqual ["a", "b"] (split All (regex ",") "a,b") 15 | , test "split" <| assertEqual ["a","b,c"] (split (AtMost 1) (regex ",") "a,b,c") 16 | , test "find All" <| assertEqual 17 | ([Match "a" [] 0 1, Match "b" [] 1 2]) 18 | (find All (regex ".") "ab") 19 | , test "find All" <| assertEqual 20 | ([Match "" [] 0 1]) 21 | (find All (regex ".*") "") 22 | 23 | , test "replace AtMost 0" <| assertEqual "The quick brown fox" 24 | (replace (AtMost 0) (regex "[aeiou]") (\_ -> "") "The quick brown fox") 25 | 26 | , test "replace AtMost 1" <| assertEqual "Th quick brown fox" 27 | (replace (AtMost 1) (regex "[aeiou]") (\_ -> "") "The quick brown fox") 28 | 29 | , test "replace AtMost 2" <| assertEqual "Th qick brown fox" 30 | (replace (AtMost 2) (regex "[aeiou]") (\_ -> "") "The quick brown fox") 31 | 32 | , test "replace All" <| assertEqual "Th qck brwn fx" 33 | (replace All (regex "[aeiou]") (\_ -> "") "The quick brown fox") 34 | ] 35 | in 36 | suite "Regex" [ simpleTests ] 37 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Result.elm: -------------------------------------------------------------------------------- 1 | module Test.Result (tests) where 2 | 3 | import Basics exposing (..) 4 | import Result 5 | import Result exposing (Result(..)) 6 | import String 7 | 8 | import ElmTest.Assertion exposing (..) 9 | import ElmTest.Test exposing (..) 10 | 11 | isEven n = 12 | if n % 2 == 0 13 | then Ok n 14 | else Err "number is odd" 15 | 16 | add3 a b c = 17 | a + b + c 18 | 19 | add4 a b c d = 20 | a + b + c + d 21 | 22 | add5 a b c d e = 23 | a + b + c + d + e 24 | 25 | tests : Test 26 | tests = 27 | let mapTests = suite "map Tests" 28 | [ 29 | test "map Ok" <| assertEqual (Ok 3) (Result.map ((+) 1) (Ok 2)), 30 | test "map Err" <| assertEqual (Err "error") (Result.map ((+) 1) (Err "error")) 31 | ] 32 | mapNTests = suite "mapN Tests" 33 | [ 34 | test "map2 Ok" <| assertEqual (Ok 3) (Result.map2 (+) (Ok 1) (Ok 2)), 35 | test "map2 Err" <| assertEqual (Err "x") (Result.map2 (+) (Ok 1) (Err "x")), 36 | 37 | test "map3 Ok" <| assertEqual (Ok 6) (Result.map3 add3 (Ok 1) (Ok 2) (Ok 3)), 38 | test "map3 Err" <| assertEqual (Err "x") (Result.map3 add3 (Ok 1) (Ok 2) (Err "x")), 39 | 40 | test "map4 Ok" <| assertEqual (Ok 10) (Result.map4 add4 (Ok 1) (Ok 2) (Ok 3) (Ok 4)), 41 | test "map4 Err" <| assertEqual (Err "x") (Result.map4 add4 (Ok 1) (Ok 2) (Ok 3) (Err "x")), 42 | 43 | test "map5 Ok" <| assertEqual (Ok 15) (Result.map5 add5 (Ok 1) (Ok 2) (Ok 3) (Ok 4) (Ok 5)), 44 | test "map5 Err" <| assertEqual (Err "x") (Result.map5 add5 (Ok 1) (Ok 2) (Ok 3) (Ok 4) (Err "x")) 45 | ] 46 | andThenTests = suite "andThen Tests" 47 | [ 48 | test "andThen Ok" <| assertEqual (Ok 42) ((String.toInt "42") `Result.andThen` isEven), 49 | test "andThen first Err" <| assertEqual 50 | (Err "could not convert string '4.2' to an Int") 51 | (String.toInt "4.2" `Result.andThen` isEven), 52 | test "andThen second Err" <| assertEqual 53 | (Err "number is odd") 54 | (String.toInt "41" `Result.andThen` isEven) 55 | ] 56 | in 57 | suite "Result Tests" 58 | [ mapTests 59 | , mapNTests 60 | , andThenTests 61 | ] 62 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Set.elm: -------------------------------------------------------------------------------- 1 | module Test.Set (tests) where 2 | 3 | import Basics exposing (..) 4 | 5 | import Set 6 | import Set exposing (Set) 7 | import List 8 | 9 | import ElmTest.Assertion exposing (..) 10 | import ElmTest.Test exposing (..) 11 | 12 | set : Set Int 13 | set = Set.fromList [1..100] 14 | 15 | setPart1 : Set Int 16 | setPart1 = Set.fromList [1..50] 17 | 18 | setPart2 : Set Int 19 | setPart2 = Set.fromList [51..100] 20 | 21 | pred : Int -> Bool 22 | pred x = x <= 50 23 | 24 | tests : Test 25 | tests = 26 | let 27 | queryTests = suite "query Tests" [test "size of set of 100 elements" <| assertEqual 100 (Set.size set)] 28 | filterTests = suite "filter Tests" [test "Simple filter" <| assertEqual setPart1 <| Set.filter pred set] 29 | partitionTests = suite "partition Tests" [test "Simple partition" <| assertEqual (setPart1, setPart2) <| Set.partition pred set] 30 | in suite "Set Tests" [queryTests, partitionTests, filterTests] 31 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/String.elm: -------------------------------------------------------------------------------- 1 | module Test.String (tests) where 2 | 3 | import Basics exposing (..) 4 | 5 | import List 6 | import Maybe exposing (..) 7 | import String 8 | 9 | import ElmTest.Assertion exposing (..) 10 | import ElmTest.Test exposing (..) 11 | 12 | tests : Test 13 | tests = 14 | let simpleTests = suite "Simple Stuff" 15 | [ test "is empty" <| assert (String.isEmpty "") 16 | , test "is not empty" <| assert (not (String.isEmpty ("the world"))) 17 | , test "length" <| assertEqual 11 (String.length "innumerable") 18 | , test "endsWith" (assert <| String.endsWith "ship" "spaceship") 19 | , test "reverse" <| assertEqual "desserts" (String.reverse "stressed") 20 | , test "repeat" <| assertEqual "hahaha" (String.repeat 3 "ha") 21 | ] 22 | 23 | combiningTests = suite "Combining Strings" 24 | [ test "uncons non-empty" <| assertEqual (Just ('a',"bc")) (String.uncons "abc") 25 | , test "uncons empty" <| assertEqual Nothing (String.uncons "") 26 | , test "append 1" <| assertEqual "butterfly" (String.append "butter" "fly") 27 | , test "append 2" <| assertEqual "butter" (String.append "butter" "") 28 | , test "append 3" <| assertEqual "butter" (String.append "" "butter") 29 | , test "concat" <| assertEqual "nevertheless" (String.concat ["never","the","less"]) 30 | , test "split commas" <| assertEqual ["cat","dog","cow"] (String.split "," "cat,dog,cow") 31 | , test "split slashes"<| assertEqual ["home","steve","Desktop", ""] (String.split "/" "home/steve/Desktop/") 32 | , test "join spaces" <| assertEqual "cat dog cow" (String.join " " ["cat","dog","cow"]) 33 | , test "join slashes" <| assertEqual "home/steve/Desktop" (String.join "/" ["home","steve","Desktop"]) 34 | , test "slice 1" <| assertEqual "c" (String.slice 2 3 "abcd") 35 | , test "slice 2" <| assertEqual "abc" (String.slice 0 3 "abcd") 36 | , test "slice 3" <| assertEqual "abc" (String.slice 0 -1 "abcd") 37 | , test "slice 4" <| assertEqual "cd" (String.slice -2 4 "abcd") 38 | ] 39 | in 40 | suite "String" [ simpleTests, combiningTests ] 41 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/Test/Trampoline.elm: -------------------------------------------------------------------------------- 1 | module Test.Trampoline (tests) where 2 | 3 | import Basics exposing (..) 4 | 5 | import List 6 | import Trampoline exposing (..) 7 | 8 | import ElmTest.Assertion exposing (..) 9 | import ElmTest.Test exposing (..) 10 | 11 | badSum : Int -> Int 12 | badSum n = 13 | let loop x acc = 14 | case x of 15 | 0 -> acc 16 | _ -> loop (x - 1) (acc+x) 17 | in loop n 0 18 | 19 | goodSum : Int -> Int 20 | goodSum n = 21 | let sumT x acc = 22 | case x of 23 | 0 -> Done acc 24 | _ -> Continue (\_ -> sumT (x-1) (acc+x)) 25 | in trampoline <| sumT n 0 26 | 27 | tests : Test 28 | tests = 29 | let mkLoopCheck n = test ("Equivalent Loop Check #"++ toString n) (assertEqual (badSum n) (goodSum n)) 30 | loopChecks = suite "Equivalent to untrampolined Tests" <| List.map mkLoopCheck [0..25] 31 | noStackOverflow = test "Trampoline Deep Recursion Test" (assertEqual 500000500000 (goodSum 1000000)) 32 | in suite "Trampoline Tests" [noStackOverflow, loopChecks] 33 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/elm-io-ports.js: -------------------------------------------------------------------------------- 1 | /* Implementation from: https://raw.githubusercontent.com/maxsnew/IO/master/elm-io.sh */ 2 | (function() { 3 | var stdin = process.stdin; 4 | var fs = require('fs'); 5 | var worker = Elm.worker(Elm.Main, {responses: null }); 6 | var just = function(v) { 7 | return { 'Just': v}; 8 | }; 9 | var handle = function(request) { 10 | switch (request.ctor) { 11 | case 'Put': 12 | process.stdout.write(request.val); 13 | break; 14 | case 'Get': 15 | stdin.resume(); 16 | break; 17 | case 'Exit': 18 | process.exit(request.val); 19 | break; 20 | case 'WriteFile': 21 | fs.writeFileSync(request.file, request.content); 22 | break; 23 | } 24 | }; 25 | var handler = function(reqs) { 26 | for (var i = 0; i < reqs.length; i++) { 27 | handle(reqs[i]); 28 | } 29 | if (reqs.length > 0 && reqs[reqs.length - 1].ctor !== 'Get') { 30 | worker.ports.responses.send(just('')); 31 | } 32 | }; 33 | worker.ports.requests.subscribe(handler); 34 | 35 | // Read 36 | stdin.on('data', function(chunk) { 37 | stdin.pause(); 38 | worker.ports.responses.send(just(chunk.toString())); 39 | }); 40 | 41 | // Start msg 42 | worker.ports.responses.send(null); 43 | })(); 44 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.1.0", 3 | "summary": "Tests for Elm's standard libraries", 4 | "repository": "http://github.com/elm-lang/core.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | ".", 8 | "../src" 9 | ], 10 | "exposed-modules": [ ], 11 | "native-modules": true, 12 | "dependencies": { 13 | "maxsnew/IO": "1.0.0 <= v < 2.0.0", 14 | "deadfoxygrandpa/Elm-Test": "1.0.3 <= v < 2.0.0" 15 | }, 16 | "elm-version": "0.15.0 <= v < 0.16.0" 17 | } 18 | -------------------------------------------------------------------------------- /elm-stuff/packages/elm-lang/core/3.0.0/tests/run-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd "$(dirname "$0")" 4 | set -e 5 | 6 | elm-package install -y 7 | 8 | VERSION_DIR="$(ls elm-stuff/packages/elm-lang/core/)" 9 | CORE_PACKAGE_DIR="elm-stuff/packages/elm-lang/core/$VERSION_DIR" 10 | CORE_GIT_DIR="$(dirname $PWD)" 11 | 12 | echo "Linking $CORE_PACKAGE_DIR to $CORE_GIT_DIR" 13 | rm -rf $CORE_PACKAGE_DIR 14 | ln -s $CORE_GIT_DIR $CORE_PACKAGE_DIR 15 | 16 | elm-make --yes --output test.js Test.elm 17 | cat elm-io-ports.js >> test.js 18 | node test.js -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/.gitignore: -------------------------------------------------------------------------------- 1 | elm-stuff -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Evan Czaplicki 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/README.md: -------------------------------------------------------------------------------- 1 | # HTML in Elm 2 | 3 | Blazing fast HTML *and* all of the benefits of Elm. 4 | 5 | Read more about how this library works and how to use it in [this post][html]. 6 | 7 | [html]: http://elm-lang.org/blog/Blazing-Fast-Html.elm 8 | 9 | ### Get Started 10 | 11 | Once you have the [Elm Platform][platform], use [elm-package][package] to download 12 | elm-html. The commands would be something like this: 13 | 14 | [platform]: https://github.com/elm-lang/elm-platform#elm-platform 15 | [package]: https://github.com/elm-lang/elm-package#basic-usage 16 | 17 | ``` 18 | mkdir myProject 19 | cd myProject 20 | elm-package install evancz/elm-html 21 | ``` 22 | 23 | After that you will be able to use anything described in [the 24 | documentation][docs]. 25 | 26 | [docs]: http://package.elm-lang.org/packages/evancz/elm-html/latest/ 27 | 28 | Another way to get started is to fork the [elm-todomvc project][todomvc] and 29 | work from there. This will also give you a reasonable architecture for your 30 | project. 31 | 32 | [todomvc]: https://github.com/evancz/elm-todomvc 33 | 34 | ### Example 35 | 36 | Try out [TodoMVC written in Elm][demo] and check out the [source code][src]. 37 | 38 | [![Live Demo](https://raw.githubusercontent.com/evancz/elm-html/master/todo.png)][demo] 39 | 40 | [demo]: http://evancz.github.io/elm-todomvc/ 41 | [src]: https://github.com/evancz/elm-todomvc/ 42 | 43 | For information on architecting larger projects, see [this 44 | document][architecture]. 45 | 46 | [architecture]: https://gist.github.com/evancz/2b2ba366cae1887fe621 47 | 48 | ### Performance 49 | 50 | [The benchmarks][bench] show that elm-html is really fast when compared to 51 | other popular alternatives. 52 | 53 | [bench]: http://evancz.github.io/todomvc-perf-comparison/ 54 | 55 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "4.0.2", 3 | "summary": "Fast HTML, rendered with virtual DOM diffing", 4 | "repository": "https://github.com/evancz/elm-html.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | "src" 8 | ], 9 | "exposed-modules": [ 10 | "Html", 11 | "Html.Attributes", 12 | "Html.Events", 13 | "Html.Lazy" 14 | ], 15 | "dependencies": { 16 | "elm-lang/core": "2.0.0 <= v < 4.0.0", 17 | "evancz/virtual-dom": "2.0.0 <= v < 3.0.0" 18 | }, 19 | "elm-version": "0.15.0 <= v < 0.17.0" 20 | } -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | There are a bunch of examples here, and [the TodoMVC example][todo] is a great 4 | example of a more complicated app with more robust architecture. 5 | 6 | [todo]: https://github.com/evancz/elm-todomvc 7 | 8 | ### Run an Example 9 | 10 | Let's say you want to see the results of `Yogi.elm`. You would run the 11 | following two commands: 12 | 13 | ```bash 14 | elm-package install 15 | elm-reactor 16 | ``` 17 | 18 | Then open `http://0.0.0.0:8000/Yogi.elm` in your browser! 19 | 20 | You only need to run `elm-package install` once. That will grab the latest 21 | released version of the `elm-html` library. 22 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/examples/TextReverser.elm: -------------------------------------------------------------------------------- 1 | module TextReverser where 2 | 3 | import Html exposing (Html, Attribute, text, div, input) 4 | import Html.Attributes exposing (..) 5 | import Html.Events exposing (on, targetValue) 6 | import String 7 | 8 | 9 | -- VIEW 10 | 11 | view : String -> Html 12 | view string = 13 | div [] 14 | [ stringInput string 15 | , reversedString string 16 | ] 17 | 18 | 19 | reversedString : String -> Html 20 | reversedString string = 21 | div [ myStyle ] [ text (String.reverse string) ] 22 | 23 | 24 | stringInput : String -> Html 25 | stringInput string = 26 | input 27 | [ placeholder "Text to reverse" 28 | , value string 29 | , on "input" targetValue (Signal.message actions.address) 30 | , myStyle 31 | ] 32 | [] 33 | 34 | 35 | myStyle : Attribute 36 | myStyle = 37 | style 38 | [ ("width", "100%") 39 | , ("height", "40px") 40 | , ("padding", "10px 0") 41 | , ("font-size", "2em") 42 | , ("text-align", "center") 43 | ] 44 | 45 | 46 | -- SIGNALS 47 | 48 | main : Signal Html 49 | main = 50 | Signal.map view actions.signal 51 | 52 | actions : Signal.Mailbox String 53 | actions = 54 | Signal.mailbox "" 55 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/examples/Yogi.elm: -------------------------------------------------------------------------------- 1 | 2 | import Html exposing (Html, img) 3 | import Html.Attributes exposing (src, style) 4 | import Time exposing (fps) 5 | import Window 6 | 7 | 8 | -- VIEW 9 | 10 | view : Int -> Html 11 | view n = 12 | img 13 | [ src "http://elm-lang.org/imgs/yogi.jpg" 14 | , style 15 | [ ("width", toString n ++ "px") 16 | , ("height", toString n ++ "px") 17 | ] 18 | ] 19 | [] 20 | 21 | 22 | -- SIGNALS 23 | 24 | main : Signal Html 25 | main = 26 | Signal.map view size 27 | 28 | 29 | size : Signal Int 30 | size = 31 | fps 30 32 | |> Signal.foldp (+) 0 33 | |> Signal.map (\t -> round (200 + 100 * sin (degrees t / 10))) 34 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/examples/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "summary": "A collection of examples for elm-html", 4 | "repository": "https://github.com/evancz/elm-todomvc.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | "." 8 | ], 9 | "exposed-modules": [], 10 | "dependencies": { 11 | "elm-lang/core": "2.1.0 <= v < 3.0.0", 12 | "evancz/elm-html": "3.0.0 <= v < 4.0.0" 13 | }, 14 | "elm-version": "0.15.0 <= v < 0.16.0" 15 | } -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/src/Html/Lazy.elm: -------------------------------------------------------------------------------- 1 | module Html.Lazy where 2 | {-| Since all Elm functions are pure we have a guarantee that the same input 3 | will always result in the same output. This module gives us tools to be lazy 4 | about building `Html` that utilize this fact. 5 | 6 | Rather than immediately applying functions to their arguments, the `lazy` 7 | functions just bundle the function and arguments up for later. When diffing 8 | the old and new virtual DOM, it checks to see if all the arguments are equal. 9 | If so, it skips calling the function! 10 | 11 | This is a really cheap test and often makes things a lot faster, but definitely 12 | benchmark to be sure! 13 | 14 | @docs lazy, lazy2, lazy3 15 | -} 16 | 17 | import Html exposing (Html) 18 | import VirtualDom 19 | 20 | 21 | {-| A performance optimization that delays the building of virtual DOM nodes. 22 | 23 | Calling `(view model)` will definitely build some virtual DOM, perhaps a lot of 24 | it. Calling `(lazy view model)` delays the call until later. During diffing, we 25 | can check to see if `model` is referentially equal to the previous value used, 26 | and if so, we just stop. No need to build up the tree structure and diff it, 27 | we know if the input to `view` is the same, the output must be the same! 28 | -} 29 | lazy : (a -> Html) -> a -> Html 30 | lazy = 31 | VirtualDom.lazy 32 | 33 | 34 | {-| Same as `lazy` but checks on two arguments. 35 | -} 36 | lazy2 : (a -> b -> Html) -> a -> b -> Html 37 | lazy2 = 38 | VirtualDom.lazy2 39 | 40 | 41 | {-| Same as `lazy` but checks on three arguments. 42 | -} 43 | lazy3 : (a -> b -> c -> Html) -> a -> b -> c -> Html 44 | lazy3 = 45 | VirtualDom.lazy3 46 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/elm-html/4.0.2/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassox/phoenix_elm/94fc3330569c7d50d55881fb94e8b58b82556e35/elm-stuff/packages/evancz/elm-html/4.0.2/todo.png -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | elm-stuff 3 | tests/build 4 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: none 3 | install: 4 | - npm install --global elm@2.0.0 5 | - npm install 6 | 7 | script: 8 | - ./tests/run-tests.sh -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Evan Czaplicki 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/README.md: -------------------------------------------------------------------------------- 1 | # Virtual DOM for Elm 2 | [![Build Status](https://travis-ci.org/evancz/virtual-dom.svg)](https://travis-ci.org/evancz/virtual-dom) 3 | 4 | Minimal bindings to a virtual DOM system. Useful for creating libraries for HTML and SVG. 5 | 6 | ## Rebuilding from NPM 7 | The build version of virtual-dom is committed to `src/Native/VirtualDom.js`. To rebuild this file with a newer version of virtual-dom: 8 | 9 | 1. Change the `virtual-dom` version number in `package.json`. 10 | 2. Run `npm install` 11 | 3. Run `./rebuild.sh` 12 | 13 | And you should see changes in `src/Native/VirtualDom.js`. 14 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.1.0", 3 | "summary": "Core virtual DOM implementation, basis for HTML and SVG libraries", 4 | "repository": "https://github.com/evancz/virtual-dom.git", 5 | "license": "BSD3", 6 | "source-directories": [ 7 | "src" 8 | ], 9 | "exposed-modules": [ 10 | "VirtualDom" 11 | ], 12 | "native-modules": true, 13 | "dependencies": { 14 | "elm-lang/core": "2.0.0 <= v < 4.0.0" 15 | }, 16 | "elm-version": "0.15.0 <= v < 0.17.0" 17 | } -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "version": "", 4 | "description": "", 5 | "dependencies": { 6 | "virtual-dom": "2.0.1" 7 | }, 8 | "devDependencies": { 9 | "browserify": "11.1.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/rebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")" 4 | 5 | if [ ! -d node_modules/browserify ] || [ ! -d node_modules/virtual-dom ]; then 6 | echo "Please run 'npm install' first." 7 | exit 8 | fi 9 | 10 | $(npm bin)/browserify src/wrapper.js -o src/Native/VirtualDom.js 11 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/Native/TestHelpers.js: -------------------------------------------------------------------------------- 1 | Elm.Native.TestHelpers = {}; 2 | Elm.Native.TestHelpers.make = function(localRuntime) 3 | { 4 | localRuntime.Native = localRuntime.Native || {}; 5 | localRuntime.Native.TestHelpers = localRuntime.Native.TestHelpers || {}; 6 | if (localRuntime.Native.TestHelpers.values) 7 | { 8 | return localRuntime.Native.TestHelpers.values; 9 | } 10 | 11 | var VirtualDom = Elm.Native.VirtualDom.make(localRuntime); 12 | 13 | function unsafeRecordCallCount(f) { 14 | function wrapper(a) { 15 | wrapper.__elm_test_call_count += 1; 16 | return f(a); 17 | } 18 | wrapper.__elm_test_call_count = 0; 19 | return wrapper; 20 | } 21 | 22 | function unsafeQueryCallCount(f) { 23 | if (f.__elm_test_call_count === undefined) { 24 | return -1; 25 | } 26 | return f.__elm_test_call_count; 27 | } 28 | 29 | Elm.Native.TestHelpers.values = { 30 | unsafeRecordCallCount: unsafeRecordCallCount, 31 | unsafeQueryCallCount: unsafeQueryCallCount, 32 | updateAndReplace: F3(VirtualDom.updateAndReplace) 33 | }; 34 | return localRuntime.Native.TestHelpers.values = Elm.Native.TestHelpers.values; 35 | }; -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/TestCases/Lazy.elm: -------------------------------------------------------------------------------- 1 | module TestCases.Lazy where 2 | 3 | import VirtualDom exposing (Node, lazy) 4 | import ElmTest.Assertion exposing (assertEqual) 5 | import ElmTest.Test exposing (Test, suite, test) 6 | 7 | import TestHelpers exposing (renderDom, updateDom, unsafeRecordCallCount, unsafeQueryCallCount) 8 | 9 | renderRecord : { x: String, y: String } -> Node 10 | renderRecord r = 11 | VirtualDom.text <| "The values: " ++ r.x ++ ", " ++ r.y 12 | 13 | 14 | renderPrimitive : Int -> Node 15 | renderPrimitive x = 16 | VirtualDom.text <| "The value: " ++ (toString x) 17 | 18 | 19 | testLazyIdenticalRecord = 20 | test "isn't called again with identical record" <| 21 | let record = { x = "a", y = "b" } 22 | wrappedRender = unsafeRecordCallCount renderRecord 23 | v1 = renderDom <| lazy wrappedRender record 24 | v2 = updateDom v1 <| lazy wrappedRender record 25 | v3 = updateDom v2 <| lazy wrappedRender record 26 | in 27 | assertEqual 1 <| unsafeQueryCallCount wrappedRender 28 | 29 | 30 | testLazyIdenticalPrimitive = 31 | test "isn't called again with identical primitive" <| 32 | let wrappedRender = unsafeRecordCallCount renderPrimitive 33 | v1 = renderDom <| lazy wrappedRender 5 34 | v2 = updateDom v1 <| lazy wrappedRender 5 35 | v3 = updateDom v2 <| lazy wrappedRender 5 36 | in 37 | assertEqual 1 <| unsafeQueryCallCount wrappedRender 38 | 39 | 40 | testLazyRecordMutationOfIdenticalValue = 41 | test "isn't called again with record mutation of identical value" <| 42 | let record = { x = "a", y = "b" } 43 | wrappedRender = unsafeRecordCallCount renderRecord 44 | v1 = renderDom <| lazy wrappedRender record 45 | v2 = updateDom v1 <| lazy wrappedRender { record | x <- "a" } 46 | v3 = updateDom v2 <| lazy wrappedRender { record | x <- "a", y <- "b" } 47 | in 48 | assertEqual 1 <| unsafeQueryCallCount wrappedRender 49 | 50 | 51 | testNotLazyDifferentRecord = 52 | test "is called again with an equivalent but different record" <| 53 | let wrappedRender = unsafeRecordCallCount renderRecord 54 | v1 = renderDom <| lazy wrappedRender { x = "a", y = "b" } 55 | v2 = updateDom v1 <| lazy wrappedRender { x = "a", y = "b" } 56 | v3 = updateDom v2 <| lazy wrappedRender { x = "a", y = "b" } 57 | in 58 | assertEqual 3 <| unsafeQueryCallCount wrappedRender 59 | 60 | 61 | tests : Test 62 | tests = 63 | suite 64 | "Lazy" 65 | [ 66 | testLazyIdenticalRecord, 67 | testLazyIdenticalPrimitive, 68 | -- Re-enable this test when core supports checking 69 | -- record update values for identity before copying: 70 | -- testLazyRecordMutationOfIdenticalValue, 71 | testNotLazyDifferentRecord 72 | ] 73 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/TestHelpers.elm: -------------------------------------------------------------------------------- 1 | module TestHelpers where 2 | 3 | import VirtualDom exposing (Node) 4 | 5 | import Native.TestHelpers 6 | import Native.VirtualDom 7 | 8 | unsafeRecordCallCount : (a -> b) -> (a -> b) 9 | unsafeRecordCallCount = 10 | Native.TestHelpers.unsafeRecordCallCount 11 | 12 | unsafeQueryCallCount : (a -> b) -> Int 13 | unsafeQueryCallCount = 14 | Native.TestHelpers.unsafeQueryCallCount 15 | 16 | type OpaqueDom = OpaqueDom 17 | 18 | render : Node -> OpaqueDom 19 | render = 20 | Native.VirtualDom.render 21 | 22 | updateAndReplace : OpaqueDom -> Node -> Node -> OpaqueDom 23 | updateAndReplace = 24 | Native.TestHelpers.updateAndReplace 25 | 26 | 27 | renderDom : Node -> (OpaqueDom, Node) 28 | renderDom vdom = 29 | (render vdom, vdom) 30 | 31 | 32 | updateDom : (OpaqueDom, Node) -> Node -> (OpaqueDom, Node) 33 | updateDom (oldDom, oldVDom) newVDom = 34 | (updateAndReplace oldDom oldVDom newVDom, newVDom) 35 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/TestMain.elm: -------------------------------------------------------------------------------- 1 | 2 | import ElmTest.Runner.Console exposing (runDisplay) 3 | import ElmTest.Test exposing (Test, suite) 4 | import IO.IO exposing (IO) 5 | import IO.Runner exposing (Request, Response) 6 | import IO.Runner as Run 7 | 8 | import TestCases.Lazy 9 | 10 | tests : Test 11 | tests = 12 | suite 13 | "VirtualDom Library Tests" 14 | [ 15 | TestCases.Lazy.tests 16 | ] 17 | 18 | console : IO () 19 | console = runDisplay tests 20 | 21 | port requests : Signal Request 22 | port requests = Run.run responses console 23 | 24 | port responses : Signal Response -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/elm-io-ports.js: -------------------------------------------------------------------------------- 1 | /* Implementation from: https://raw.githubusercontent.com/maxsnew/IO/master/elm-io.sh */ 2 | (function() { 3 | var stdin = process.stdin; 4 | var fs = require('fs'); 5 | var worker = Elm.worker(Elm.Main, {responses: null }); 6 | var just = function(v) { 7 | return { 'Just': v}; 8 | }; 9 | var handle = function(request) { 10 | switch (request.ctor) { 11 | case 'Put': 12 | process.stdout.write(request.val); 13 | break; 14 | case 'Get': 15 | stdin.resume(); 16 | break; 17 | case 'Exit': 18 | process.exit(request.val); 19 | break; 20 | case 'WriteFile': 21 | fs.writeFileSync(request.file, request.content); 22 | break; 23 | } 24 | }; 25 | var handler = function(reqs) { 26 | for (var i = 0; i < reqs.length; i++) { 27 | handle(reqs[i]); 28 | } 29 | if (reqs.length > 0 && reqs[reqs.length - 1].ctor !== 'Get') { 30 | worker.ports.responses.send(just('')); 31 | } 32 | }; 33 | worker.ports.requests.subscribe(handler); 34 | 35 | // Read 36 | stdin.on('data', function(chunk) { 37 | stdin.pause(); 38 | worker.ports.responses.send(just(chunk.toString())); 39 | }); 40 | 41 | // Start msg 42 | worker.ports.responses.send(null); 43 | })(); 44 | -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/elm-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "summary": "Test for VirtualDom", 4 | "license": "BSD3", 5 | "repository": "https://github.com/evancz/virtual-dom.git", 6 | "exposed-modules": [], 7 | "source-directories": [ 8 | ".", 9 | "build/virtual-dom/" 10 | ], 11 | "native-modules": true, 12 | "dependencies": { 13 | "elm-lang/core": "2.1.0 <= v < 3.0.0", 14 | "maxsnew/IO": "1.0.0 <= v < 2.0.0", 15 | "deadfoxygrandpa/Elm-Test": "1.0.3 <= v < 2.0.0" 16 | }, 17 | "elm-version": "0.15.1 <= v < 0.16.0" 18 | } -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/tests/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | cd "$(dirname "$0")" 6 | 7 | mkdir -p build/virtual-dom/Native 8 | cp ../src/VirtualDom.elm build/virtual-dom/ 9 | $(npm bin)/browserify ../src/wrapper.js -o build/VirtualDom.browser.js 10 | 11 | set +e 12 | diff -u ../src/Native/VirtualDom.js build/VirtualDom.browser.js 13 | if [ $? != 0 ]; then 14 | echo "ERROR:" 15 | echo "src/Native/VirtualDom.js has local modifications or is out of date. Please run rebuild.sh" 16 | exit 1 17 | fi 18 | set -e 19 | 20 | $(npm bin)/browserify --no-browser-field ../src/wrapper.js -o build/virtual-dom/Native/VirtualDom.js 21 | 22 | elm-make --yes --output build/test.js TestMain.elm 23 | cat elm-io-ports.js >> build/test.js 24 | node build/test.js -------------------------------------------------------------------------------- /elm-stuff/packages/evancz/virtual-dom/2.1.0/todo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassox/phoenix_elm/94fc3330569c7d50d55881fb94e8b58b82556e35/elm-stuff/packages/evancz/virtual-dom/2.1.0/todo.png -------------------------------------------------------------------------------- /lib/phoenix_elm.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm do 2 | use Application 3 | 4 | # See http://elixir-lang.org/docs/stable/elixir/Application.html 5 | # for more information on OTP Applications 6 | def start(_type, _args) do 7 | import Supervisor.Spec, warn: false 8 | 9 | children = [ 10 | # Start the endpoint when the application starts 11 | supervisor(PhoenixElm.Endpoint, []), 12 | # Start the Ecto repository 13 | supervisor(PhoenixElm.Repo, []), 14 | supervisor(PhoenixElm.ElmIo, []), 15 | # Here you could define other workers and supervisors as children 16 | # worker(PhoenixElm.Worker, [arg1, arg2, arg3]), 17 | ] 18 | 19 | # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html 20 | # for other strategies and supported options 21 | opts = [strategy: :one_for_one, name: PhoenixElm.Supervisor] 22 | Supervisor.start_link(children, opts) 23 | end 24 | 25 | # Tell Phoenix to update the endpoint configuration 26 | # whenever the application is updated. 27 | def config_change(changed, _new, removed) do 28 | PhoenixElm.Endpoint.config_change(changed, removed) 29 | :ok 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /lib/phoenix_elm/elm_io.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ElmIo do 2 | use StdJsonIo, otp_app: :phoenix_elm, script: "elm-stdio" 3 | end 4 | -------------------------------------------------------------------------------- /lib/phoenix_elm/endpoint.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Endpoint do 2 | use Phoenix.Endpoint, otp_app: :phoenix_elm 3 | 4 | socket "/socket", PhoenixElm.UserSocket 5 | 6 | # Serve at "/" the static files from "priv/static" directory. 7 | # 8 | # You should set gzip to true if you are running phoenix.digest 9 | # when deploying your static files in production. 10 | plug Plug.Static, 11 | at: "/", from: :phoenix_elm, gzip: false, 12 | only: ~w(css fonts images js favicon.ico robots.txt) 13 | 14 | # Code reloading can be explicitly enabled under the 15 | # :code_reloader configuration of your endpoint. 16 | if code_reloading? do 17 | socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket 18 | plug Phoenix.LiveReloader 19 | plug Phoenix.CodeReloader 20 | end 21 | 22 | plug Plug.RequestId 23 | plug Plug.Logger 24 | 25 | plug Plug.Parsers, 26 | parsers: [:urlencoded, :multipart, :json], 27 | pass: ["*/*"], 28 | json_decoder: Poison 29 | 30 | plug Plug.MethodOverride 31 | plug Plug.Head 32 | 33 | plug Plug.Session, 34 | store: :cookie, 35 | key: "_phoenix_elm_key", 36 | signing_salt: "fIeDuEXQ" 37 | 38 | plug PhoenixElm.Router 39 | end 40 | -------------------------------------------------------------------------------- /lib/phoenix_elm/repo.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Repo do 2 | use Ecto.Repo, otp_app: :phoenix_elm 3 | end 4 | -------------------------------------------------------------------------------- /mix.exs: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Mixfile do 2 | use Mix.Project 3 | 4 | def project do 5 | [app: :phoenix_elm, 6 | version: "0.0.1", 7 | elixir: "~> 1.0", 8 | elixirc_paths: elixirc_paths(Mix.env), 9 | compilers: [:phoenix, :gettext] ++ Mix.compilers, 10 | build_embedded: Mix.env == :prod, 11 | start_permanent: Mix.env == :prod, 12 | aliases: aliases, 13 | deps: deps] 14 | end 15 | 16 | # Configuration for the OTP application. 17 | # 18 | # Type `mix help compile.app` for more information. 19 | def application do 20 | [mod: {PhoenixElm, []}, 21 | applications: [:phoenix, :phoenix_html, :cowboy, :logger, :gettext, 22 | :phoenix_ecto, :postgrex, :std_json_io]] 23 | end 24 | 25 | # Specifies which paths to compile per environment. 26 | defp elixirc_paths(:test), do: ["lib", "web", "test/support"] 27 | defp elixirc_paths(_), do: ["lib", "web"] 28 | 29 | # Specifies your project dependencies. 30 | # 31 | # Type `mix help deps` for examples and options. 32 | defp deps do 33 | [{:phoenix, "~> 1.1.1"}, 34 | {:phoenix_ecto, "~> 2.0"}, 35 | {:postgrex, ">= 0.0.0"}, 36 | {:phoenix_html, "~> 2.3"}, 37 | {:phoenix_live_reload, "~> 1.0", only: :dev}, 38 | {:gettext, "~> 0.9"}, 39 | {:std_json_io, "~> 0.1.0"}, 40 | {:cowboy, "~> 1.0"}] 41 | end 42 | 43 | # Aliases are shortcut or tasks specific to the current project. 44 | # For example, to create, migrate and run the seeds file at once: 45 | # 46 | # $ mix ecto.setup 47 | # 48 | # See the documentation for `Mix` for more info on aliases. 49 | defp aliases do 50 | ["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], 51 | "ecto.reset": ["ecto.drop", "ecto.setup"]] 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /mix.lock: -------------------------------------------------------------------------------- 1 | %{"connection": {:hex, :connection, "1.0.2"}, 2 | "cowboy": {:hex, :cowboy, "1.0.4"}, 3 | "cowlib": {:hex, :cowlib, "1.0.2"}, 4 | "decimal": {:hex, :decimal, "1.1.1"}, 5 | "ecto": {:hex, :ecto, "1.1.1"}, 6 | "fs": {:hex, :fs, "0.9.2"}, 7 | "gettext": {:hex, :gettext, "0.9.0"}, 8 | "phoenix": {:hex, :phoenix, "1.1.1"}, 9 | "phoenix_ecto": {:hex, :phoenix_ecto, "2.0.0"}, 10 | "phoenix_html": {:hex, :phoenix_html, "2.3.0"}, 11 | "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.0.1"}, 12 | "plug": {:hex, :plug, "1.0.3"}, 13 | "poison": {:hex, :poison, "1.5.0"}, 14 | "poolboy": {:hex, :poolboy, "1.5.1"}, 15 | "porcelain": {:hex, :porcelain, "2.0.1"}, 16 | "postgrex": {:hex, :postgrex, "0.10.0"}, 17 | "ranch": {:hex, :ranch, "1.2.0"}, 18 | "std_json_io": {:hex, :std_json_io, "0.1.0"}} 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "repository": {}, 3 | "dependencies": {}, 4 | "devDependencies": { 5 | "babel-core": "^6.3.26", 6 | "babel-loader": "^6.2.0", 7 | "babel-preset-es2015": "^6.3.13", 8 | "bootstrap": "^3.3.6", 9 | "copy-webpack-plugin": "^0.3.3", 10 | "css-loader": "^0.23.1", 11 | "elm-stdio": "^1.0.1", 12 | "elm-webpack-loader": "^1.1.1", 13 | "extract-text-webpack-plugin": "^0.9.1", 14 | "file-loader": "^0.8.5", 15 | "jsdom": "^7.2.2", 16 | "jsx-loader": "^0.13.2", 17 | "min-document": "hassox/min-document", 18 | "style-loader": "^0.13.0", 19 | "url-loader": "^0.5.7", 20 | "vdom-to-html": "^2.2.0", 21 | "virtual-dom": "^2.1.1", 22 | "webpack": "^1.12.9" 23 | }, 24 | "scripts": { 25 | "compile": "webpack -p" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /priv/gettext/en/LC_MESSAGES/errors.po: -------------------------------------------------------------------------------- 1 | ## `msgid`s in this file come from POT (.pot) files. Do not add, change, or 2 | ## remove `msgid`s manually here as they're tied to the ones in the 3 | ## corresponding POT file (with the same domain). Use `mix gettext.extract 4 | ## --merge` or `mix gettext.merge` to merge POT files into PO files. 5 | msgid "" 6 | msgstr "" 7 | "Language: en\n" 8 | 9 | ## From Ecto.Changeset.cast/4 10 | msgid "can't be blank" 11 | msgstr "" 12 | 13 | ## From Ecto.Changeset.unique_constraint/3 14 | msgid "has already been taken" 15 | msgstr "" 16 | 17 | ## From Ecto.Changeset.put_change/3 18 | msgid "is invalid" 19 | msgstr "" 20 | 21 | ## From Ecto.Changeset.validate_format/3 22 | msgid "has invalid format" 23 | msgstr "" 24 | 25 | ## From Ecto.Changeset.validate_subset/3 26 | msgid "has an invalid entry" 27 | msgstr "" 28 | 29 | ## From Ecto.Changeset.validate_exclusion/3 30 | msgid "is reserved" 31 | msgstr "" 32 | 33 | ## From Ecto.Changeset.validate_confirmation/3 34 | msgid "does not match confirmation" 35 | msgstr "" 36 | 37 | ## From Ecto.Changeset.no_assoc_constraint/3 38 | msgid "is still associated to this entry" 39 | msgstr "" 40 | 41 | msgid "are still associated to this entry" 42 | msgstr "" 43 | 44 | ## From Ecto.Changeset.validate_length/3 45 | msgid "should be %{count} character(s)" 46 | msgid_plural "should be %{count} character(s)" 47 | msgstr[0] "" 48 | msgstr[1] "" 49 | 50 | msgid "should have %{count} item(s)" 51 | msgid_plural "should have %{count} item(s)" 52 | msgstr[0] "" 53 | msgstr[1] "" 54 | 55 | msgid "should be at least %{count} character(s)" 56 | msgid_plural "should be at least %{count} character(s)" 57 | msgstr[0] "" 58 | msgstr[1] "" 59 | 60 | msgid "should have at least %{count} item(s)" 61 | msgid_plural "should have at least %{count} item(s)" 62 | msgstr[0] "" 63 | msgstr[1] "" 64 | 65 | msgid "should be at most %{count} character(s)" 66 | msgid_plural "should be at most %{count} character(s)" 67 | msgstr[0] "" 68 | msgstr[1] "" 69 | 70 | msgid "should have at most %{count} item(s)" 71 | msgid_plural "should have at most %{count} item(s)" 72 | msgstr[0] "" 73 | msgstr[1] "" 74 | 75 | ## From Ecto.Changeset.validate_number/3 76 | msgid "must be less than %{count}" 77 | msgid_plural "must be less than %{count}" 78 | msgstr[0] "" 79 | msgstr[1] "" 80 | 81 | msgid "must be greater than %{count}" 82 | msgid_plural "must be greater than %{count}" 83 | msgstr[0] "" 84 | msgstr[1] "" 85 | 86 | msgid "must be less than or equal to %{count}" 87 | msgid_plural "must be less than or equal to %{count}" 88 | msgstr[0] "" 89 | msgstr[1] "" 90 | 91 | msgid "must be greater than or equal to %{count}" 92 | msgid_plural "must be greater than or equal to %{count}" 93 | msgstr[0] "" 94 | msgstr[1] "" 95 | 96 | msgid "must be equal to %{count}" 97 | msgid_plural "must be equal to %{count}" 98 | msgstr[0] "" 99 | msgstr[1] "" 100 | -------------------------------------------------------------------------------- /priv/gettext/errors.pot: -------------------------------------------------------------------------------- 1 | ## This file is a PO Template file. `msgid`s here are often extracted from 2 | ## source code; add new translations manually only if they're dynamic 3 | ## translations that can't be statically extracted. Run `mix 4 | ## gettext.extract` to bring this file up to date. Leave `msgstr`s empty as 5 | ## changing them here as no effect; edit them in PO (`.po`) files instead. 6 | ## From Ecto.Changeset.cast/4 7 | msgid "can't be blank" 8 | msgstr "" 9 | 10 | ## From Ecto.Changeset.unique_constraint/3 11 | msgid "has already been taken" 12 | msgstr "" 13 | 14 | ## From Ecto.Changeset.put_change/3 15 | msgid "is invalid" 16 | msgstr "" 17 | 18 | ## From Ecto.Changeset.validate_format/3 19 | msgid "has invalid format" 20 | msgstr "" 21 | 22 | ## From Ecto.Changeset.validate_subset/3 23 | msgid "has an invalid entry" 24 | msgstr "" 25 | 26 | ## From Ecto.Changeset.validate_exclusion/3 27 | msgid "is reserved" 28 | msgstr "" 29 | 30 | ## From Ecto.Changeset.validate_confirmation/3 31 | msgid "does not match confirmation" 32 | msgstr "" 33 | 34 | ## From Ecto.Changeset.no_assoc_constraint/3 35 | msgid "is still associated to this entry" 36 | msgstr "" 37 | 38 | msgid "are still associated to this entry" 39 | msgstr "" 40 | 41 | ## From Ecto.Changeset.validate_length/3 42 | msgid "should be %{count} character(s)" 43 | msgid_plural "should be %{count} character(s)" 44 | msgstr[0] "" 45 | msgstr[1] "" 46 | 47 | msgid "should have %{count} item(s)" 48 | msgid_plural "should have %{count} item(s)" 49 | msgstr[0] "" 50 | msgstr[1] "" 51 | 52 | msgid "should be at least %{count} character(s)" 53 | msgid_plural "should be at least %{count} character(s)" 54 | msgstr[0] "" 55 | msgstr[1] "" 56 | 57 | msgid "should have at least %{count} item(s)" 58 | msgid_plural "should have at least %{count} item(s)" 59 | msgstr[0] "" 60 | msgstr[1] "" 61 | 62 | msgid "should be at most %{count} character(s)" 63 | msgid_plural "should be at most %{count} character(s)" 64 | msgstr[0] "" 65 | msgstr[1] "" 66 | 67 | msgid "should have at most %{count} item(s)" 68 | msgid_plural "should have at most %{count} item(s)" 69 | msgstr[0] "" 70 | msgstr[1] "" 71 | 72 | ## From Ecto.Changeset.validate_number/3 73 | msgid "must be less than %{count}" 74 | msgid_plural "must be less than %{count}" 75 | msgstr[0] "" 76 | msgstr[1] "" 77 | 78 | msgid "must be greater than %{count}" 79 | msgid_plural "must be greater than %{count}" 80 | msgstr[0] "" 81 | msgstr[1] "" 82 | 83 | msgid "must be less than or equal to %{count}" 84 | msgid_plural "must be less than or equal to %{count}" 85 | msgstr[0] "" 86 | msgstr[1] "" 87 | 88 | msgid "must be greater than or equal to %{count}" 89 | msgid_plural "must be greater than or equal to %{count}" 90 | msgstr[0] "" 91 | msgstr[1] "" 92 | 93 | msgid "must be equal to %{count}" 94 | msgid_plural "must be equal to %{count}" 95 | msgstr[0] "" 96 | msgstr[1] "" 97 | -------------------------------------------------------------------------------- /priv/repo/seeds.exs: -------------------------------------------------------------------------------- 1 | # Script for populating the database. You can run it as: 2 | # 3 | # mix run priv/repo/seeds.exs 4 | # 5 | # Inside the script, you can read and write to any of your 6 | # repositories directly: 7 | # 8 | # PhoenixElm.Repo.insert!(%PhoenixElm.SomeModel{}) 9 | # 10 | # We recommend using the bang functions (`insert!`, `update!` 11 | # and so on) as they will fail if something goes wrong. 12 | -------------------------------------------------------------------------------- /test/controllers/page_controller_test.exs: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.PageControllerTest do 2 | use PhoenixElm.ConnCase 3 | 4 | test "GET /", %{conn: conn} do 5 | conn = get conn, "/" 6 | assert html_response(conn, 200) =~ "Welcome to Phoenix!" 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /test/support/channel_case.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ChannelCase do 2 | @moduledoc """ 3 | This module defines the test case to be used by 4 | channel tests. 5 | 6 | Such tests rely on `Phoenix.ChannelTest` and also 7 | imports other functionality to make it easier 8 | to build and query models. 9 | 10 | Finally, if the test case interacts with the database, 11 | it cannot be async. For this reason, every test runs 12 | inside a transaction which is reset at the beginning 13 | of the test unless the test case is marked as async. 14 | """ 15 | 16 | use ExUnit.CaseTemplate 17 | 18 | using do 19 | quote do 20 | # Import conveniences for testing with channels 21 | use Phoenix.ChannelTest 22 | 23 | alias PhoenixElm.Repo 24 | import Ecto.Model 25 | import Ecto.Query, only: [from: 2] 26 | 27 | 28 | # The default endpoint for testing 29 | @endpoint PhoenixElm.Endpoint 30 | end 31 | end 32 | 33 | setup tags do 34 | unless tags[:async] do 35 | Ecto.Adapters.SQL.restart_test_transaction(PhoenixElm.Repo, []) 36 | end 37 | 38 | :ok 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /test/support/conn_case.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ConnCase do 2 | @moduledoc """ 3 | This module defines the test case to be used by 4 | tests that require setting up a connection. 5 | 6 | Such tests rely on `Phoenix.ConnTest` and also 7 | imports other functionality to make it easier 8 | to build and query models. 9 | 10 | Finally, if the test case interacts with the database, 11 | it cannot be async. For this reason, every test runs 12 | inside a transaction which is reset at the beginning 13 | of the test unless the test case is marked as async. 14 | """ 15 | 16 | use ExUnit.CaseTemplate 17 | 18 | using do 19 | quote do 20 | # Import conveniences for testing with connections 21 | use Phoenix.ConnTest 22 | 23 | alias PhoenixElm.Repo 24 | import Ecto.Model 25 | import Ecto.Query, only: [from: 2] 26 | 27 | import PhoenixElm.Router.Helpers 28 | 29 | # The default endpoint for testing 30 | @endpoint PhoenixElm.Endpoint 31 | end 32 | end 33 | 34 | setup tags do 35 | unless tags[:async] do 36 | Ecto.Adapters.SQL.restart_test_transaction(PhoenixElm.Repo, []) 37 | end 38 | 39 | {:ok, conn: Phoenix.ConnTest.conn()} 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /test/support/model_case.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ModelCase do 2 | @moduledoc """ 3 | This module defines the test case to be used by 4 | model tests. 5 | 6 | You may define functions here to be used as helpers in 7 | your model tests. See `errors_on/2`'s definition as reference. 8 | 9 | Finally, if the test case interacts with the database, 10 | it cannot be async. For this reason, every test runs 11 | inside a transaction which is reset at the beginning 12 | of the test unless the test case is marked as async. 13 | """ 14 | 15 | use ExUnit.CaseTemplate 16 | 17 | using do 18 | quote do 19 | alias PhoenixElm.Repo 20 | import Ecto.Model 21 | import Ecto.Query, only: [from: 2] 22 | import PhoenixElm.ModelCase 23 | end 24 | end 25 | 26 | setup tags do 27 | unless tags[:async] do 28 | Ecto.Adapters.SQL.restart_test_transaction(PhoenixElm.Repo, []) 29 | end 30 | 31 | :ok 32 | end 33 | 34 | @doc """ 35 | Helper for returning list of errors in model when passed certain data. 36 | 37 | ## Examples 38 | 39 | Given a User model that lists `:name` as a required field and validates 40 | `:password` to be safe, it would return: 41 | 42 | iex> errors_on(%User{}, %{password: "password"}) 43 | [password: "is unsafe", name: "is blank"] 44 | 45 | You could then write your assertion like: 46 | 47 | assert {:password, "is unsafe"} in errors_on(%User{}, %{password: "password"}) 48 | 49 | You can also create the changeset manually and retrieve the errors 50 | field directly: 51 | 52 | iex> changeset = User.changeset(%User{}, password: "password") 53 | iex> {:password, "is unsafe"} in changeset.errors 54 | true 55 | """ 56 | def errors_on(model, data) do 57 | model.__struct__.changeset(model, data).errors 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start 2 | 3 | Mix.Task.run "ecto.create", ~w(-r PhoenixElm.Repo --quiet) 4 | Mix.Task.run "ecto.migrate", ~w(-r PhoenixElm.Repo --quiet) 5 | Ecto.Adapters.SQL.begin_test_transaction(PhoenixElm.Repo) 6 | 7 | -------------------------------------------------------------------------------- /test/views/error_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ErrorViewTest do 2 | use PhoenixElm.ConnCase, async: true 3 | 4 | # Bring render/3 and render_to_string/3 for testing custom views 5 | import Phoenix.View 6 | 7 | test "renders 404.html" do 8 | assert render_to_string(PhoenixElm.ErrorView, "404.html", []) == 9 | "Page not found" 10 | end 11 | 12 | test "render 500.html" do 13 | assert render_to_string(PhoenixElm.ErrorView, "500.html", []) == 14 | "Server internal error" 15 | end 16 | 17 | test "render any other" do 18 | assert render_to_string(PhoenixElm.ErrorView, "505.html", []) == 19 | "Server internal error" 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/views/layout_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.LayoutViewTest do 2 | use PhoenixElm.ConnCase, async: true 3 | end -------------------------------------------------------------------------------- /test/views/page_view_test.exs: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.PageViewTest do 2 | use PhoenixElm.ConnCase, async: true 3 | end 4 | -------------------------------------------------------------------------------- /web/channels/user_socket.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.UserSocket do 2 | use Phoenix.Socket 3 | 4 | ## Channels 5 | # channel "rooms:*", PhoenixElm.RoomChannel 6 | 7 | ## Transports 8 | transport :websocket, Phoenix.Transports.WebSocket 9 | # transport :longpoll, Phoenix.Transports.LongPoll 10 | 11 | # Socket params are passed from the client and can 12 | # be used to verify and authenticate a user. After 13 | # verification, you can put default assigns into 14 | # the socket that will be set for all channels, ie 15 | # 16 | # {:ok, assign(socket, :user_id, verified_user_id)} 17 | # 18 | # To deny connection, return `:error`. 19 | # 20 | # See `Phoenix.Token` documentation for examples in 21 | # performing token verification on connect. 22 | def connect(_params, socket) do 23 | {:ok, socket} 24 | end 25 | 26 | # Socket id's are topics that allow you to identify all sockets for a given user: 27 | # 28 | # def id(socket), do: "users_socket:#{socket.assigns.user_id}" 29 | # 30 | # Would allow you to broadcast a "disconnect" event and terminate 31 | # all active sockets and channels for a given user: 32 | # 33 | # PhoenixElm.Endpoint.broadcast("users_socket:#{user.id}", "disconnect", %{}) 34 | # 35 | # Returning `nil` makes this socket anonymous. 36 | def id(_socket), do: nil 37 | end 38 | -------------------------------------------------------------------------------- /web/controllers/page_controller.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.PageController do 2 | use PhoenixElm.Web, :controller 3 | 4 | def index(conn, _params) do 5 | render conn, "index.html", foo: "Bar" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /web/gettext.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Gettext do 2 | @moduledoc """ 3 | A module providing Internationalization with a gettext-based API. 4 | 5 | By using [Gettext](http://hexdocs.pm/gettext), 6 | your module gains a set of macros for translations, for example: 7 | 8 | import PhoenixElm.Gettext 9 | 10 | # Simple translation 11 | gettext "Here is the string to translate" 12 | 13 | # Plural translation 14 | ngettext "Here is the string to translate", 15 | "Here are the strings to translate", 16 | 3 17 | 18 | # Domain-based translation 19 | dgettext "errors", "Here is the error message to translate" 20 | 21 | See the [Gettext Docs](http://hexdocs.pm/gettext) for detailed usage. 22 | """ 23 | use Gettext, otp_app: :phoenix_elm 24 | end 25 | -------------------------------------------------------------------------------- /web/router.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Router do 2 | use PhoenixElm.Web, :router 3 | 4 | pipeline :browser do 5 | plug :accepts, ["html"] 6 | plug :fetch_session 7 | plug :fetch_flash 8 | plug :protect_from_forgery 9 | plug :put_secure_browser_headers 10 | end 11 | 12 | pipeline :api do 13 | plug :accepts, ["json"] 14 | end 15 | 16 | scope "/", PhoenixElm do 17 | pipe_through :browser # Use the default browser stack 18 | 19 | forward "/", PageController, :index 20 | end 21 | 22 | # Other scopes may use custom stacks. 23 | # scope "/api", PhoenixElm do 24 | # pipe_through :api 25 | # end 26 | end 27 | -------------------------------------------------------------------------------- /web/static/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassox/phoenix_elm/94fc3330569c7d50d55881fb94e8b58b82556e35/web/static/assets/favicon.ico -------------------------------------------------------------------------------- /web/static/assets/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassox/phoenix_elm/94fc3330569c7d50d55881fb94e8b58b82556e35/web/static/assets/images/bg.png -------------------------------------------------------------------------------- /web/static/assets/images/phoenix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hassox/phoenix_elm/94fc3330569c7d50d55881fb94e8b58b82556e35/web/static/assets/images/phoenix.png -------------------------------------------------------------------------------- /web/static/assets/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /web/static/js/app.js: -------------------------------------------------------------------------------- 1 | import "phoenix_html" 2 | import Elm from '../elm/Todo.elm' 3 | Elm.embed(Elm.Todo, document.getElementById('elm-main'), APP_DATA); 4 | -------------------------------------------------------------------------------- /web/static/js/server_render.js: -------------------------------------------------------------------------------- 1 | export default require('../elm/Todo.elm'); 2 | 3 | -------------------------------------------------------------------------------- /web/static/js/socket.js: -------------------------------------------------------------------------------- 1 | // NOTE: The contents of this file will only be executed if 2 | // you uncomment its entry in "web/static/js/app.js". 3 | 4 | // To use Phoenix channels, the first step is to import Socket 5 | // and connect at the socket path in "lib/my_app/endpoint.ex": 6 | import {Socket} from "deps/phoenix/web/static/js/phoenix" 7 | 8 | let socket = new Socket("/socket", {params: {token: window.userToken}}) 9 | 10 | // When you connect, you'll often need to authenticate the client. 11 | // For example, imagine you have an authentication plug, `MyAuth`, 12 | // which authenticates the session and assigns a `:current_user`. 13 | // If the current user exists you can assign the user's token in 14 | // the connection for use in the layout. 15 | // 16 | // In your "web/router.ex": 17 | // 18 | // pipeline :browser do 19 | // ... 20 | // plug MyAuth 21 | // plug :put_user_token 22 | // end 23 | // 24 | // defp put_user_token(conn, _) do 25 | // if current_user = conn.assigns[:current_user] do 26 | // token = Phoenix.Token.sign(conn, "user socket", current_user.id) 27 | // assign(conn, :user_token, token) 28 | // else 29 | // conn 30 | // end 31 | // end 32 | // 33 | // Now you need to pass this token to JavaScript. You can do so 34 | // inside a script tag in "web/templates/layout/app.html.eex": 35 | // 36 | // 37 | // 38 | // You will need to verify the user token in the "connect/2" function 39 | // in "web/channels/user_socket.ex": 40 | // 41 | // def connect(%{"token" => token}, socket) do 42 | // # max_age: 1209600 is equivalent to two weeks in seconds 43 | // case Phoenix.Token.verify(socket, "user socket", token, max_age: 1209600) do 44 | // {:ok, user_id} -> 45 | // {:ok, assign(socket, :user, user_id)} 46 | // {:error, reason} -> 47 | // :error 48 | // end 49 | // end 50 | // 51 | // Finally, pass the token on connect as below. Or remove it 52 | // from connect if you don't care about authentication. 53 | 54 | socket.connect() 55 | 56 | // Now that you are connected, you can join channels with a topic: 57 | let channel = socket.channel("topic:subtopic", {}) 58 | channel.join() 59 | .receive("ok", resp => { console.log("Joined successfully", resp) }) 60 | .receive("error", resp => { console.log("Unable to join", resp) }) 61 | 62 | export default socket 63 | -------------------------------------------------------------------------------- /web/templates/layout/app.html.eex: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Elm IO! 11 | "> 12 | 13 | 14 | <%= render @view_module, @view_template, assigns %> 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /web/templates/page/index.html.eex: -------------------------------------------------------------------------------- 1 |
2 |

<%= gettext "Welcome to %{name}", name: "Phoenix!" %>

3 |

A productive web framework that
does not compromise speed and maintainability.

4 |
5 | 6 |
7 |
8 |

Resources

9 | 20 |
21 | 22 |
23 |

Help

24 | 35 |
36 |
37 | -------------------------------------------------------------------------------- /web/templates/page/single_page.html.eex: -------------------------------------------------------------------------------- 1 | <%= raw @html %> 2 | 3 | -------------------------------------------------------------------------------- /web/views/error_helpers.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ErrorHelpers do 2 | @moduledoc """ 3 | Conveniences for translating and building error messages. 4 | """ 5 | 6 | use Phoenix.HTML 7 | 8 | @doc """ 9 | Generates tag for inlined form input errors. 10 | """ 11 | def error_tag(form, field) do 12 | if error = form.errors[field] do 13 | content_tag :span, translate_error(error), class: "help-block" 14 | end 15 | end 16 | 17 | @doc """ 18 | Translates an error message using gettext. 19 | """ 20 | def translate_error({msg, opts}) do 21 | # Because error messages were defined within Ecto, we must 22 | # call the Gettext module passing our Gettext backend. We 23 | # also use the "errors" domain as translations are placed 24 | # in the errors.po file. On your own code and templates, 25 | # this could be written simply as: 26 | # 27 | # dngettext "errors", "1 file", "%{count} files", count 28 | # 29 | Gettext.dngettext(PhoenixElm.Gettext, "errors", msg, msg, opts[:count], opts) 30 | end 31 | 32 | def translate_error(msg) do 33 | Gettext.dgettext(PhoenixElm.Gettext, "errors", msg) 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /web/views/error_view.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.ErrorView do 2 | use PhoenixElm.Web, :view 3 | 4 | def render("404.html", _assigns) do 5 | "Page not found" 6 | end 7 | 8 | def render("500.html", _assigns) do 9 | "Server internal error" 10 | end 11 | 12 | # In case no render clause matches or no 13 | # template is found, let's render it as 500 14 | def template_not_found(_template, assigns) do 15 | render "500.html", assigns 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /web/views/layout_view.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.LayoutView do 2 | use PhoenixElm.Web, :view 3 | end 4 | -------------------------------------------------------------------------------- /web/views/page_view.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.PageView do 2 | use PhoenixElm.Web, :view 3 | 4 | def render("index.html", options) do 5 | data = %{ getStorage: nil } 6 | 7 | opts = %{ 8 | path: "./priv/server/js/main.js", 9 | component: "Todo", 10 | render: "embed", 11 | id: "elm-main", 12 | data: data, 13 | } 14 | 15 | result = PhoenixElm.ElmIo.json_call!(opts) 16 | 17 | render "single_page.html", html: result["html"], data: data 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /web/web.ex: -------------------------------------------------------------------------------- 1 | defmodule PhoenixElm.Web do 2 | @moduledoc """ 3 | A module that keeps using definitions for controllers, 4 | views and so on. 5 | 6 | This can be used in your application as: 7 | 8 | use PhoenixElm.Web, :controller 9 | use PhoenixElm.Web, :view 10 | 11 | The definitions below will be executed for every view, 12 | controller, etc, so keep them short and clean, focused 13 | on imports, uses and aliases. 14 | 15 | Do NOT define functions inside the quoted expressions 16 | below. 17 | """ 18 | 19 | def model do 20 | quote do 21 | use Ecto.Schema 22 | 23 | import Ecto 24 | import Ecto.Changeset 25 | import Ecto.Query, only: [from: 1, from: 2] 26 | end 27 | end 28 | 29 | def controller do 30 | quote do 31 | use Phoenix.Controller 32 | 33 | alias PhoenixElm.Repo 34 | import Ecto 35 | import Ecto.Query, only: [from: 1, from: 2] 36 | 37 | import PhoenixElm.Router.Helpers 38 | import PhoenixElm.Gettext 39 | end 40 | end 41 | 42 | def view do 43 | quote do 44 | use Phoenix.View, root: "web/templates" 45 | 46 | # Import convenience functions from controllers 47 | import Phoenix.Controller, only: [get_csrf_token: 0, get_flash: 2, view_module: 1] 48 | 49 | # Use all HTML functionality (forms, tags, etc) 50 | use Phoenix.HTML 51 | 52 | import PhoenixElm.Router.Helpers 53 | import PhoenixElm.ErrorHelpers 54 | import PhoenixElm.Gettext 55 | end 56 | end 57 | 58 | def router do 59 | quote do 60 | use Phoenix.Router 61 | end 62 | end 63 | 64 | def channel do 65 | quote do 66 | use Phoenix.Channel 67 | 68 | alias PhoenixElm.Repo 69 | import Ecto 70 | import Ecto.Query, only: [from: 1, from: 2] 71 | import PhoenixElm.Gettext 72 | end 73 | end 74 | 75 | @doc """ 76 | When used, dispatch to the appropriate controller/view/etc. 77 | """ 78 | defmacro __using__(which) when is_atom(which) do 79 | apply(__MODULE__, which, []) 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | // setup from http://matthewlehner.net/using-webpack-with-phoenix-and-elixir/ 2 | 3 | var ExtractTextPlugin = require("extract-text-webpack-plugin"); 4 | var CopyWebpackPlugin = require("copy-webpack-plugin"); 5 | 6 | module.exports = { 7 | entry: ["./web/static/js/app.js", "./web/static/css/app.css"], 8 | output: { 9 | path: "./priv/static/", 10 | filename: "js/app.js" 11 | }, 12 | module: { 13 | noParse: /\.elm$/, 14 | loaders: [ 15 | { 16 | test: /\.js$/, 17 | exclude: /node_modules/, 18 | loader: "babel", 19 | query: { 20 | presets: ["es2015"] 21 | } 22 | }, 23 | { 24 | test: /\.elm$/, 25 | exclude: [/elm-stuff/, /node_modules/], 26 | loader: 'elm-webpack' 27 | }, 28 | { 29 | test: /\.css$/, 30 | loader: ExtractTextPlugin.extract("css") 31 | }, 32 | { 33 | test: /\.(png|woff|woff2|eot|ttf|svg)$/, 34 | loader: 'url-loader?limit=100000' 35 | }, 36 | ] 37 | }, 38 | resolve: { 39 | alias: { 40 | phoenix_html: 41 | __dirname + "/deps/phoenix_html/web/static/js/phoenix_html.js", 42 | phoenix: 43 | __dirname + "./deps/phoenix/web/static/js/phoenix.js" 44 | } 45 | }, 46 | plugins: [ 47 | new ExtractTextPlugin("css/app.css"), 48 | new CopyWebpackPlugin([{ from: "./web/static/assets" }]) 49 | ], 50 | devServer: { 51 | inline: true, 52 | stats: 'errors-only' 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /webpack.server.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | entry: "./web/static/js/server_render.js", 3 | output: { 4 | path: "./priv/server", 5 | filename: "js/main.js", 6 | library: "myComponent", 7 | libraryTarget: "commonjs2" 8 | }, 9 | module: { 10 | noParse: /\.elm$/, 11 | loaders: [ 12 | { 13 | test: /\.js$/, 14 | exclude: /node_modules/, 15 | loader: "babel", 16 | query: { 17 | presets: ["es2015"] 18 | } 19 | }, 20 | { 21 | test: /\.elm$/, 22 | exclude: [/elm-stuff/, /node_modules/], 23 | loader: 'elm-webpack' 24 | }, 25 | ] 26 | }, 27 | resolve: { 28 | alias: { 29 | phoenix_html: 30 | __dirname + "/deps/phoenix_html/web/static/js/phoenix_html.js", 31 | phoenix: 32 | __dirname + "./deps/phoenix/web/static/js/phoenix.js" 33 | } 34 | } 35 | }; 36 | --------------------------------------------------------------------------------