@liascript/editor 1.1.6--0.15.12 → 1.1.7--0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/README.md +1 -1
  3. package/dist/{Base.9a5d63ee.js → Base.605d9ab5.js} +1 -1
  4. package/dist/{Base.a9e738fa.js → Base.d8e1fc60.js} +1 -1
  5. package/dist/index.11182e74.js +1 -0
  6. package/dist/index.55026812.js +1 -0
  7. package/dist/index.691fb05c.js +1 -0
  8. package/dist/index.756a5816.css +1 -0
  9. package/dist/index.796e2c5e.js +1 -0
  10. package/dist/index.html +1 -1
  11. package/dist/jszip.min.0e12e848.js +13 -0
  12. package/dist/jszip.min.a7b69263.js +13 -0
  13. package/package.json +9 -2
  14. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/LICENSE +0 -11
  15. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/README.md +0 -172
  16. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/artifacts.dat +0 -0
  17. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/docs.json +0 -1
  18. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/LICENSE +0 -27
  19. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/README.md +0 -107
  20. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/artifacts.dat +0 -0
  21. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/docs.json +0 -1
  22. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/LICENSE +0 -29
  23. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/README.md +0 -51
  24. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/artifacts.dat +0 -0
  25. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/docs.json +0 -1
  26. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/LICENSE +0 -21
  27. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/README.md +0 -313
  28. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/artifacts.dat +0 -0
  29. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/docs.json +0 -1
  30. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/LICENSE +0 -202
  31. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/README.md +0 -820
  32. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/artifacts.dat +0 -0
  33. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/docs.json +0 -1
  34. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/LICENSE +0 -24
  35. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/README.md +0 -7
  36. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/artifacts.dat +0 -0
  37. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/docs.json +0 -1
  38. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/LICENSE +0 -11
  39. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/README.md +0 -57
  40. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/artifacts.dat +0 -0
  41. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/docs.json +0 -1
  42. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/LICENSE +0 -11
  43. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/README.md +0 -58
  44. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/artifacts.dat +0 -0
  45. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/docs.json +0 -1
  46. package/.elm/0.19.1/packages/elm/browser/1.0.2/LICENSE +0 -11
  47. package/.elm/0.19.1/packages/elm/browser/1.0.2/README.md +0 -21
  48. package/.elm/0.19.1/packages/elm/browser/1.0.2/artifacts.dat +0 -0
  49. package/.elm/0.19.1/packages/elm/browser/1.0.2/docs.json +0 -1
  50. package/.elm/0.19.1/packages/elm/bytes/1.0.8/LICENSE +0 -30
  51. package/.elm/0.19.1/packages/elm/bytes/1.0.8/README.md +0 -56
  52. package/.elm/0.19.1/packages/elm/bytes/1.0.8/artifacts.dat +0 -0
  53. package/.elm/0.19.1/packages/elm/bytes/1.0.8/docs.json +0 -1
  54. package/.elm/0.19.1/packages/elm/core/1.0.5/LICENSE +0 -11
  55. package/.elm/0.19.1/packages/elm/core/1.0.5/README.md +0 -30
  56. package/.elm/0.19.1/packages/elm/core/1.0.5/artifacts.dat +0 -0
  57. package/.elm/0.19.1/packages/elm/core/1.0.5/docs.json +0 -1
  58. package/.elm/0.19.1/packages/elm/file/1.0.5/LICENSE +0 -30
  59. package/.elm/0.19.1/packages/elm/file/1.0.5/README.md +0 -127
  60. package/.elm/0.19.1/packages/elm/file/1.0.5/artifacts.dat +0 -0
  61. package/.elm/0.19.1/packages/elm/file/1.0.5/docs.json +0 -1
  62. package/.elm/0.19.1/packages/elm/html/1.0.0/LICENSE +0 -30
  63. package/.elm/0.19.1/packages/elm/html/1.0.0/README.md +0 -50
  64. package/.elm/0.19.1/packages/elm/html/1.0.0/artifacts.dat +0 -0
  65. package/.elm/0.19.1/packages/elm/html/1.0.0/docs.json +0 -1
  66. package/.elm/0.19.1/packages/elm/http/2.0.0/LICENSE +0 -30
  67. package/.elm/0.19.1/packages/elm/http/2.0.0/README.md +0 -36
  68. package/.elm/0.19.1/packages/elm/http/2.0.0/artifacts.dat +0 -0
  69. package/.elm/0.19.1/packages/elm/http/2.0.0/docs.json +0 -1
  70. package/.elm/0.19.1/packages/elm/json/1.1.3/LICENSE +0 -30
  71. package/.elm/0.19.1/packages/elm/json/1.1.3/README.md +0 -63
  72. package/.elm/0.19.1/packages/elm/json/1.1.3/artifacts.dat +0 -0
  73. package/.elm/0.19.1/packages/elm/json/1.1.3/docs.json +0 -1
  74. package/.elm/0.19.1/packages/elm/random/1.0.0/LICENSE +0 -30
  75. package/.elm/0.19.1/packages/elm/random/1.0.0/README.md +0 -46
  76. package/.elm/0.19.1/packages/elm/random/1.0.0/artifacts.dat +0 -0
  77. package/.elm/0.19.1/packages/elm/random/1.0.0/docs.json +0 -1
  78. package/.elm/0.19.1/packages/elm/regex/1.0.0/LICENSE +0 -30
  79. package/.elm/0.19.1/packages/elm/regex/1.0.0/README.md +0 -59
  80. package/.elm/0.19.1/packages/elm/regex/1.0.0/artifacts.dat +0 -0
  81. package/.elm/0.19.1/packages/elm/regex/1.0.0/docs.json +0 -1
  82. package/.elm/0.19.1/packages/elm/svg/1.0.1/LICENSE +0 -30
  83. package/.elm/0.19.1/packages/elm/svg/1.0.1/README.md +0 -62
  84. package/.elm/0.19.1/packages/elm/svg/1.0.1/artifacts.dat +0 -0
  85. package/.elm/0.19.1/packages/elm/svg/1.0.1/docs.json +0 -1
  86. package/.elm/0.19.1/packages/elm/time/1.0.0/LICENSE +0 -30
  87. package/.elm/0.19.1/packages/elm/time/1.0.0/README.md +0 -94
  88. package/.elm/0.19.1/packages/elm/time/1.0.0/artifacts.dat +0 -0
  89. package/.elm/0.19.1/packages/elm/time/1.0.0/docs.json +0 -1
  90. package/.elm/0.19.1/packages/elm/url/1.0.0/LICENSE +0 -27
  91. package/.elm/0.19.1/packages/elm/url/1.0.0/README.md +0 -32
  92. package/.elm/0.19.1/packages/elm/url/1.0.0/artifacts.dat +0 -0
  93. package/.elm/0.19.1/packages/elm/url/1.0.0/docs.json +0 -1
  94. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/LICENSE +0 -30
  95. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/README.md +0 -5
  96. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/artifacts.dat +0 -0
  97. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/docs.json +0 -1
  98. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/LICENSE +0 -21
  99. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/README.md +0 -19
  100. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/artifacts.dat +0 -0
  101. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/docs.json +0 -1
  102. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/LICENSE +0 -29
  103. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/README.md +0 -31
  104. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/artifacts.dat +0 -0
  105. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/docs.json +0 -1
  106. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/LICENSE +0 -11
  107. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/README.md +0 -73
  108. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/artifacts.dat +0 -0
  109. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/docs.json +0 -1
  110. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/LICENSE +0 -373
  111. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/README.md +0 -77
  112. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/artifacts.dat +0 -0
  113. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/docs.json +0 -1
  114. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/LICENSE +0 -9
  115. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/README.md +0 -112
  116. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/artifacts.dat +0 -0
  117. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/docs.json +0 -1
  118. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/LICENSE +0 -11
  119. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/README.md +0 -67
  120. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/artifacts.dat +0 -0
  121. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/docs.json +0 -1
  122. package/.elm/0.19.1/packages/lock +0 -0
  123. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/LICENSE +0 -27
  124. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/README.md +0 -32
  125. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/artifacts.dat +0 -0
  126. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/docs.json +0 -1
  127. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/LICENSE +0 -25
  128. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/README.md +0 -14
  129. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/artifacts.dat +0 -0
  130. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/docs.json +0 -1
  131. package/.elm/0.19.1/packages/registry.dat +0 -0
  132. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/LICENSE +0 -29
  133. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/README.md +0 -13
  134. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/artifacts.dat +0 -0
  135. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/docs.json +0 -1
  136. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/LICENSE +0 -27
  137. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/README.md +0 -72
  138. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/artifacts.dat +0 -0
  139. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/docs.json +0 -1
  140. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/LICENSE +0 -22
  141. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/README.md +0 -27
  142. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/artifacts.dat +0 -0
  143. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/docs.json +0 -1
  144. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/LICENSE +0 -27
  145. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/README.md +0 -34
  146. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/artifacts.dat +0 -0
  147. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/docs.json +0 -1
  148. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/LICENSE +0 -29
  149. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/README.md +0 -8
  150. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/artifacts.dat +0 -0
  151. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/docs.json +0 -1
  152. package/dist/index.270309fa.js +0 -1
  153. package/dist/index.2b67d179.js +0 -1
  154. package/dist/index.3d681c84.js +0 -1
  155. package/dist/index.72230c64.css +0 -1
  156. package/dist/index.d57ed7b9.js +0 -1
@@ -1 +0,0 @@
1
- [{"name":"Html","comment":" This file is organized roughly in order of popularity. The tags which you'd\nexpect to use frequently will be closer to the top.\n\n# Primitives\n@docs Html, Attribute, text, node, map\n\n# Tags\n\n## Headers\n@docs h1, h2, h3, h4, h5, h6\n\n## Grouping Content\n@docs div, p, hr, pre, blockquote\n\n## Text\n@docs span, a, code, em, strong, i, b, u, sub, sup, br\n\n## Lists\n@docs ol, ul, li, dl, dt, dd\n\n## Embedded Content\n@docs img, iframe, canvas, math\n\n## Inputs\n@docs form, input, textarea, button, select, option\n\n## Sections\n@docs section, nav, article, aside, header, footer, address, main_\n\n## Figures\n@docs figure, figcaption\n\n## Tables\n@docs table, caption, colgroup, col, tbody, thead, tfoot, tr, td, th\n\n\n## Less Common Elements\n\n### Less Common Inputs\n@docs fieldset, legend, label, datalist, optgroup, output, progress, meter\n\n### Audio and Video\n@docs audio, video, source, track\n\n### Embedded Objects\n@docs embed, object, param\n\n### Text Edits\n@docs ins, del\n\n### Semantic Text\n@docs small, cite, dfn, abbr, time, var, samp, kbd, s, q\n\n### Less Common Text Tags\n@docs mark, ruby, rt, rp, bdi, bdo, wbr\n\n## Interactive Elements\n@docs details, summary, menuitem, menu\n\n","unions":[],"aliases":[{"name":"Attribute","comment":" Set attributes on your `Html`. Learn more in the\n[`Html.Attributes`](Html-Attributes) module.\n","args":["msg"],"type":"VirtualDom.Attribute msg"},{"name":"Html","comment":" The core building block used to build up HTML. Here we create an `Html`\nvalue with no attributes and one child:\n\n hello : Html msg\n hello =\n div [] [ text \"Hello!\" ]\n","args":["msg"],"type":"VirtualDom.Node msg"}],"values":[{"name":"a","comment":" Represents a hyperlink, linking to another resource. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"abbr","comment":" Represents an abbreviation or an acronym; the expansion of the\nabbreviation can be represented in the title attribute.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"address","comment":" Defines a section containing contact information. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"article","comment":" Defines self-contained content that could exist independently of the rest\nof the content.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"aside","comment":" Defines some content loosely related to the page content. If it is removed,\nthe remaining content still makes sense.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"audio","comment":" Represents a sound or audio stream. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"b","comment":" Represents a text which to which attention is drawn for utilitarian\npurposes. It doesn't convey extra importance and doesn't imply an alternate\nvoice.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"bdi","comment":" Represents text that must be isolated from its surrounding for\nbidirectional text formatting. It allows embedding a span of text with a\ndifferent, or unknown, directionality.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"bdo","comment":" Represents the directionality of its children, in order to explicitly\noverride the Unicode bidirectional algorithm.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"blockquote","comment":" Represents a content that is quoted from another source. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"br","comment":" Represents a line break. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"button","comment":" Represents a button. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"canvas","comment":" Represents a bitmap area for graphics rendering. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"caption","comment":" Represents the title of a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"cite","comment":" Represents the title of a work. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"code","comment":" Represents computer code. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"col","comment":" Represents a column of a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"colgroup","comment":" Represents a set of one or more columns of a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"datalist","comment":" Represents a set of predefined options for other controls. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"dd","comment":" Represents the definition of the terms immediately listed before it. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"del","comment":" Defines a removal from the document. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"details","comment":" Represents a widget from which the user can obtain additional information\nor controls.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"dfn","comment":" Represents a term whose definition is contained in its nearest ancestor\ncontent.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"div","comment":" Represents a generic container with no special meaning. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"dl","comment":" Defines a definition list, that is, a list of terms and their associated\ndefinitions.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"dt","comment":" Represents a term defined by the next `dd`. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"em","comment":" Represents emphasized text, like a stress accent. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"embed","comment":" Represents a integration point for an external, often non-HTML,\napplication or interactive content.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"fieldset","comment":" Represents a set of controls. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"figcaption","comment":" Represents the legend of a figure. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"figure","comment":" Represents a figure illustrated as part of the document. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"footer","comment":" Defines the footer for a page or section. It often contains a copyright\nnotice, some links to legal information, or addresses to give feedback.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"form","comment":" Represents a form, consisting of controls, that can be submitted to a\nserver for processing.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h1","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h2","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h3","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h4","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h5","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"h6","comment":"","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"header","comment":" Defines the header of a page or section. It often contains a logo, the\ntitle of the web site, and a navigational table of content.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"hr","comment":" Represents a thematic break between paragraphs of a section or article or\nany longer content.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"i","comment":" Represents some text in an alternate voice or mood, or at least of\ndifferent quality, such as a taxonomic designation, a technical term, an\nidiomatic phrase, a thought, or a ship name.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"iframe","comment":" Embedded an HTML document. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"img","comment":" Represents an image. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"input","comment":" Represents a typed data field allowing the user to edit the data. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"ins","comment":" Defines an addition to the document. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"kbd","comment":" Represents user input, often from the keyboard, but not necessarily; it\nmay represent other input, like transcribed voice commands.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"label","comment":" Represents the caption of a form control. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"legend","comment":" Represents the caption for a `fieldset`. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"li","comment":" Defines a item of an enumeration list. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"main_","comment":" Defines the main or important content in the document. There is only one\n`main` element in the document.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"map","comment":" Transform the messages produced by some `Html`. In the following example,\nwe have `viewButton` that produces `()` messages, and we transform those values\ninto `Msg` values in `view`.\n\n type Msg = Left | Right\n\n view : model -> Html Msg\n view model =\n div []\n [ map (\\_ -> Left) (viewButton \"Left\")\n , map (\\_ -> Right) (viewButton \"Right\")\n ]\n\n viewButton : String -> Html ()\n viewButton name =\n button [ onClick () ] [ text name ]\n\nThis should not come in handy too often. Definitely read [this][reuse] before\ndeciding if this is what you want.\n\n[reuse]: https://guide.elm-lang.org/reuse/\n","type":"(a -> msg) -> Html.Html a -> Html.Html msg"},{"name":"mark","comment":" Represents text highlighted for reference purposes, that is for its\nrelevance in another context.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"math","comment":" Defines a mathematical formula. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"menu","comment":" Represents a list of commands. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"menuitem","comment":" Represents a command that the user can invoke. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"meter","comment":" Represents a scalar measurement (or a fractional value), within a known\nrange.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"nav","comment":" Defines a section that contains only navigation links.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"node","comment":" General way to create HTML nodes. It is used to define all of the helper\nfunctions in this library.\n\n div : List (Attribute msg) -> List (Html msg) -> Html msg\n div attributes children =\n node \"div\" attributes children\n\nYou can use this to create custom nodes if you need to create something that\nis not covered by the helper functions in this library.\n","type":"String.String -> List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"object","comment":" Represents an external resource, which is treated as an image, an HTML\nsub-document, or an external resource to be processed by a plug-in.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"ol","comment":" Defines an ordered list of items. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"optgroup","comment":" Represents a set of options, logically grouped. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"option","comment":" Represents an option in a `select` element or a suggestion of a `datalist`\nelement.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"output","comment":" Represents the result of a calculation. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"p","comment":" Defines a portion that should be displayed as a paragraph. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"param","comment":" Defines parameters for use by plug-ins invoked by `object` elements. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"pre","comment":" Indicates that its content is preformatted and that this format must be\npreserved.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"progress","comment":" Represents the completion progress of a task. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"q","comment":" Represents an inline quotation. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"rp","comment":" Represents parenthesis around a ruby annotation, used to display the\nannotation in an alternate way by browsers not supporting the standard display\nfor annotations.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"rt","comment":" Represents the text of a ruby annotation. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"ruby","comment":" Represents content to be marked with ruby annotations, short runs of text\npresented alongside the text. This is often used in conjunction with East Asian\nlanguage where the annotations act as a guide for pronunciation, like the\nJapanese furigana.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"s","comment":" Represents content that is no longer accurate or relevant. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"samp","comment":" Represents the output of a program or a computer. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"section","comment":" Defines a section in a document.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"select","comment":" Represents a control allowing selection among a set of options. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"small","comment":" Represents a side comment, that is, text like a disclaimer or a\ncopyright, which is not essential to the comprehension of the document.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"source","comment":" Allows authors to specify alternative media resources for media elements\nlike `video` or `audio`.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"span","comment":" Represents text with no specific meaning. This has to be used when no other\ntext-semantic element conveys an adequate meaning, which, in this case, is\noften brought by global attributes like `class`, `lang`, or `dir`.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"strong","comment":" Represents especially important text. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"sub","comment":" Represent a subscript. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"summary","comment":" Represents a summary, caption, or legend for a given `details`. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"sup","comment":" Represent a superscript. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"table","comment":" Represents data with more than one dimension. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"tbody","comment":" Represents the block of rows that describes the concrete data of a table.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"td","comment":" Represents a data cell in a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"text","comment":" Just put plain text in the DOM. It will escape the string so that it appears\nexactly as you specify.\n\n text \"Hello World!\"\n","type":"String.String -> Html.Html msg"},{"name":"textarea","comment":" Represents a multiline text edit control. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"tfoot","comment":" Represents the block of rows that describes the column summaries of a table.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"th","comment":" Represents a header cell in a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"thead","comment":" Represents the block of rows that describes the column labels of a table.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"time","comment":" Represents a date and time value; the machine-readable equivalent can be\nrepresented in the datetime attribute.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"tr","comment":" Represents a row of cells in a table. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"track","comment":" Allows authors to specify timed text track for media elements like `video`\nor `audio`.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"u","comment":" Represents a non-textual annotation for which the conventional\npresentation is underlining, such labeling the text as being misspelt or\nlabeling a proper name in Chinese text.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"ul","comment":" Defines an unordered list of items. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"var","comment":" Represents a variable. Specific cases where it should be used include an\nactual mathematical expression or programming context, an identifier\nrepresenting a constant, a symbol identifying a physical quantity, a function\nparameter, or a mere placeholder in prose.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"video","comment":" Represents a video, the associated audio and captions, and controls. ","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"},{"name":"wbr","comment":" Represents a line break opportunity, that is a suggested point for\nwrapping text in order to improve readability of text split on several lines.\n","type":"List.List (Html.Attribute msg) -> List.List (Html.Html msg) -> Html.Html msg"}],"binops":[]},{"name":"Html.Attributes","comment":" Helper functions for HTML attributes. They are organized roughly by\ncategory. Each attribute is labeled with the HTML tags it can be used with, so\njust search the page for `video` if you want video stuff.\n\n# Primitives\n@docs style, property, attribute, map\n\n# Super Common Attributes\n@docs class, classList, id, title, hidden\n\n# Inputs\n@docs type_, value, checked, placeholder, selected\n\n## Input Helpers\n@docs accept, acceptCharset, action, autocomplete, autofocus,\n disabled, enctype, list, maxlength, minlength, method, multiple,\n name, novalidate, pattern, readonly, required, size, for, form\n\n## Input Ranges\n@docs max, min, step\n\n## Input Text Areas\n@docs cols, rows, wrap\n\n\n# Links and Areas\n@docs href, target, download, hreflang, media, ping, rel\n\n## Maps\n@docs ismap, usemap, shape, coords\n\n\n# Embedded Content\n@docs src, height, width, alt\n\n## Audio and Video\n@docs autoplay, controls, loop, preload, poster, default, kind, srclang\n\n## iframes\n@docs sandbox, srcdoc\n\n# Ordered Lists\n@docs reversed, start\n\n# Tables\n@docs align, colspan, rowspan, headers, scope\n\n# Less Common Global Attributes\nAttributes that can be attached to any HTML tag but are less commonly used.\n@docs accesskey, contenteditable, contextmenu, dir, draggable, dropzone,\n itemprop, lang, spellcheck, tabindex\n\n# Miscellaneous\n@docs cite, datetime, pubdate, manifest\n\n","unions":[],"aliases":[],"values":[{"name":"accept","comment":" List of types the server accepts, typically a file type.\nFor `form` and `input`.\n","type":"String.String -> Html.Attribute msg"},{"name":"acceptCharset","comment":" List of supported charsets in a `form`.\n","type":"String.String -> Html.Attribute msg"},{"name":"accesskey","comment":" Defines a keyboard shortcut to activate or add focus to the element. ","type":"Char.Char -> Html.Attribute msg"},{"name":"action","comment":" The URI of a program that processes the information submitted via a `form`.\n","type":"String.String -> Html.Attribute msg"},{"name":"align","comment":" Specifies the horizontal alignment of a `caption`, `col`, `colgroup`,\n`hr`, `iframe`, `img`, `table`, `tbody`, `td`, `tfoot`, `th`, `thead`, or\n`tr`.\n","type":"String.String -> Html.Attribute msg"},{"name":"alt","comment":" Alternative text in case an image can't be displayed. Works with `img`,\n`area`, and `input`.\n","type":"String.String -> Html.Attribute msg"},{"name":"attribute","comment":" Create *attributes*, like saying `domNode.setAttribute('class', 'greeting')`\nin JavaScript.\n\n class : String -> Attribute msg\n class name =\n attribute \"class\" name\n\nRead more about the difference between properties and attributes [here][].\n\n[here]: https://github.com/elm/html/blob/master/properties-vs-attributes.md\n","type":"String.String -> String.String -> Html.Attribute msg"},{"name":"autocomplete","comment":" Indicates whether a `form` or an `input` can have their values automatically\ncompleted by the browser.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"autofocus","comment":" The element should be automatically focused after the page loaded.\nFor `button`, `input`, `select`, and `textarea`.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"autoplay","comment":" The `audio` or `video` should play as soon as possible. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"checked","comment":" Indicates whether an `input` of type checkbox is checked. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"cite","comment":" Contains a URI which points to the source of the quote or change in a\n`blockquote`, `del`, `ins`, or `q`.\n","type":"String.String -> Html.Attribute msg"},{"name":"class","comment":" Often used with CSS to style elements with common properties.\n\n**Note:** You can have as many `class` and `classList` attributes as you want.\nThey all get applied, so if you say `[ class \"notice\", class \"notice-seen\" ]`\nyou will get both classes!\n","type":"String.String -> Html.Attribute msg"},{"name":"classList","comment":" This function makes it easier to build a space-separated class attribute.\nEach class can easily be added and removed depending on the boolean value it\nis paired with. For example, maybe we want a way to view notices:\n\n viewNotice : Notice -> Html msg\n viewNotice notice =\n div\n [ classList\n [ (\"notice\", True)\n , (\"notice-important\", notice.isImportant)\n , (\"notice-seen\", notice.isSeen)\n ]\n ]\n [ text notice.content ]\n\n**Note:** You can have as many `class` and `classList` attributes as you want.\nThey all get applied, so if you say `[ class \"notice\", class \"notice-seen\" ]`\nyou will get both classes!\n","type":"List.List ( String.String, Basics.Bool ) -> Html.Attribute msg"},{"name":"cols","comment":" Defines the number of columns in a `textarea`. ","type":"Basics.Int -> Html.Attribute msg"},{"name":"colspan","comment":" The colspan attribute defines the number of columns a cell should span.\nFor `td` and `th`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"contenteditable","comment":" Indicates whether the element's content is editable. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"contextmenu","comment":" Defines the ID of a `menu` element which will serve as the element's\ncontext menu.\n","type":"String.String -> Html.Attribute msg"},{"name":"controls","comment":" Indicates whether the browser should show playback controls for the `audio`\nor `video`.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"coords","comment":" A set of values specifying the coordinates of the hot-spot region in an\n`area`. Needs to be paired with a `shape` attribute to be meaningful.\n","type":"String.String -> Html.Attribute msg"},{"name":"datetime","comment":" Indicates the date and time associated with the element.\nFor `del`, `ins`, `time`.\n","type":"String.String -> Html.Attribute msg"},{"name":"default","comment":" Indicates that the `track` should be enabled unless the user's preferences\nindicate something different.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"dir","comment":" Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl\n(Right-To-Left).\n","type":"String.String -> Html.Attribute msg"},{"name":"disabled","comment":" Indicates whether the user can interact with a `button`, `fieldset`,\n`input`, `optgroup`, `option`, `select` or `textarea`.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"download","comment":" Indicates that clicking an `a` and `area` will download the resource\ndirectly. The `String` argument determins the name of the downloaded file.\nSay the file you are serving is named `hats.json`.\n\n download \"\" -- hats.json\n download \"my-hats.json\" -- my-hats.json\n download \"snakes.json\" -- snakes.json\n\nThe empty `String` says to just name it whatever it was called on the server.\n","type":"String.String -> Html.Attribute msg"},{"name":"draggable","comment":" Defines whether the element can be dragged. ","type":"String.String -> Html.Attribute msg"},{"name":"dropzone","comment":" Indicates that the element accept the dropping of content on it. ","type":"String.String -> Html.Attribute msg"},{"name":"enctype","comment":" How `form` data should be encoded when submitted with the POST method.\nOptions include: application/x-www-form-urlencoded, multipart/form-data, and\ntext/plain.\n","type":"String.String -> Html.Attribute msg"},{"name":"for","comment":" The element ID described by this `label` or the element IDs that are used\nfor an `output`.\n","type":"String.String -> Html.Attribute msg"},{"name":"form","comment":" Indicates the element ID of the `form` that owns this particular `button`,\n`fieldset`, `input`, `label`, `meter`, `object`, `output`, `progress`,\n`select`, or `textarea`.\n","type":"String.String -> Html.Attribute msg"},{"name":"headers","comment":" A space separated list of element IDs indicating which `th` elements are\nheaders for this cell. For `td` and `th`.\n","type":"String.String -> Html.Attribute msg"},{"name":"height","comment":" Declare the height of a `canvas`, `embed`, `iframe`, `img`, `input`,\n`object`, or `video`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"hidden","comment":" Indicates the relevance of an element. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"href","comment":" The URL of a linked resource, such as `a`, `area`, `base`, or `link`. ","type":"String.String -> Html.Attribute msg"},{"name":"hreflang","comment":" Two-letter language code of the linked resource of an `a`, `area`, or `link`.\n","type":"String.String -> Html.Attribute msg"},{"name":"id","comment":" Often used with CSS to style a specific element. The value of this\nattribute must be unique.\n","type":"String.String -> Html.Attribute msg"},{"name":"ismap","comment":" When an `img` is a descendant of an `a` tag, the `ismap` attribute\nindicates that the click location should be added to the parent `a`'s href as\na query string.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"itemprop","comment":"","type":"String.String -> Html.Attribute msg"},{"name":"kind","comment":" Specifies the kind of text `track`. ","type":"String.String -> Html.Attribute msg"},{"name":"lang","comment":" Defines the language used in the element. ","type":"String.String -> Html.Attribute msg"},{"name":"list","comment":" Associates an `input` with a `datalist` tag. The datalist gives some\npre-defined options to suggest to the user as they interact with an input.\nThe value of the list attribute must match the id of a `datalist` node.\nFor `input`.\n","type":"String.String -> Html.Attribute msg"},{"name":"loop","comment":" Indicates whether the `audio` or `video` should start playing from the\nstart when it's finished.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"manifest","comment":" Specifies the URL of the cache manifest for an `html` tag. ","type":"String.String -> Html.Attribute msg"},{"name":"map","comment":" Transform the messages produced by an `Attribute`.\n","type":"(a -> msg) -> Html.Attribute a -> Html.Attribute msg"},{"name":"max","comment":" Indicates the maximum value allowed. When using an input of type number or\ndate, the max value must be a number or date. For `input`, `meter`, and `progress`.\n","type":"String.String -> Html.Attribute msg"},{"name":"maxlength","comment":" Defines the maximum number of characters allowed in an `input` or\n`textarea`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"media","comment":" Specifies a hint of the target media of a `a`, `area`, `link`, `source`,\nor `style`.\n","type":"String.String -> Html.Attribute msg"},{"name":"method","comment":" Defines which HTTP method to use when submitting a `form`. Can be GET\n(default) or POST.\n","type":"String.String -> Html.Attribute msg"},{"name":"min","comment":" Indicates the minimum value allowed. When using an input of type number or\ndate, the min value must be a number or date. For `input` and `meter`.\n","type":"String.String -> Html.Attribute msg"},{"name":"minlength","comment":" Defines the minimum number of characters allowed in an `input` or\n`textarea`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"multiple","comment":" Indicates whether multiple values can be entered in an `input` of type\nemail or file. Can also indicate that you can `select` many options.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"name","comment":" Name of the element. For example used by the server to identify the fields\nin form submits. For `button`, `form`, `fieldset`, `iframe`, `input`,\n`object`, `output`, `select`, `textarea`, `map`, `meta`, and `param`.\n","type":"String.String -> Html.Attribute msg"},{"name":"novalidate","comment":" This attribute indicates that a `form` shouldn't be validated when\nsubmitted.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"pattern","comment":" Defines a regular expression which an `input`'s value will be validated\nagainst.\n","type":"String.String -> Html.Attribute msg"},{"name":"ping","comment":" Specify a URL to send a short POST request to when the user clicks on an\n`a` or `area`. Useful for monitoring and tracking.\n","type":"String.String -> Html.Attribute msg"},{"name":"placeholder","comment":" Provides a hint to the user of what can be entered into an `input` or\n`textarea`.\n","type":"String.String -> Html.Attribute msg"},{"name":"poster","comment":" A URL indicating a poster frame to show until the user plays or seeks the\n`video`.\n","type":"String.String -> Html.Attribute msg"},{"name":"preload","comment":" Control how much of an `audio` or `video` resource should be preloaded. ","type":"String.String -> Html.Attribute msg"},{"name":"property","comment":" Create *properties*, like saying `domNode.className = 'greeting'` in\nJavaScript.\n\n import Json.Encode as Encode\n\n class : String -> Attribute msg\n class name =\n property \"className\" (Encode.string name)\n\nRead more about the difference between properties and attributes [here][].\n\n[here]: https://github.com/elm/html/blob/master/properties-vs-attributes.md\n","type":"String.String -> Json.Encode.Value -> Html.Attribute msg"},{"name":"pubdate","comment":" Indicates whether this date and time is the date of the nearest `article`\nancestor element. For `time`.\n","type":"String.String -> Html.Attribute msg"},{"name":"readonly","comment":" Indicates whether an `input` or `textarea` can be edited. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"rel","comment":" Specifies the relationship of the target object to the link object.\nFor `a`, `area`, `link`.\n","type":"String.String -> Html.Attribute msg"},{"name":"required","comment":" Indicates whether this element is required to fill out or not.\nFor `input`, `select`, and `textarea`.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"reversed","comment":" Indicates whether an ordered list `ol` should be displayed in a descending\norder instead of a ascending.\n","type":"Basics.Bool -> Html.Attribute msg"},{"name":"rows","comment":" Defines the number of rows in a `textarea`. ","type":"Basics.Int -> Html.Attribute msg"},{"name":"rowspan","comment":" Defines the number of rows a table cell should span over.\nFor `td` and `th`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"sandbox","comment":" A space separated list of security restrictions you'd like to lift for an\n`iframe`.\n","type":"String.String -> Html.Attribute msg"},{"name":"scope","comment":" Specifies the scope of a header cell `th`. Possible values are: col, row,\ncolgroup, rowgroup.\n","type":"String.String -> Html.Attribute msg"},{"name":"selected","comment":" Defines which `option` will be selected on page load. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"shape","comment":" Declare the shape of the clickable area in an `a` or `area`. Valid values\ninclude: default, rect, circle, poly. This attribute can be paired with\n`coords` to create more particular shapes.\n","type":"String.String -> Html.Attribute msg"},{"name":"size","comment":" For `input` specifies the width of an input in characters.\n\nFor `select` specifies the number of visible options in a drop-down list.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"spellcheck","comment":" Indicates whether spell checking is allowed for the element. ","type":"Basics.Bool -> Html.Attribute msg"},{"name":"src","comment":" The URL of the embeddable content. For `audio`, `embed`, `iframe`, `img`,\n`input`, `script`, `source`, `track`, and `video`.\n","type":"String.String -> Html.Attribute msg"},{"name":"srcdoc","comment":" An HTML document that will be displayed as the body of an `iframe`. It will\noverride the content of the `src` attribute if it has been specified.\n","type":"String.String -> Html.Attribute msg"},{"name":"srclang","comment":" A two letter language code indicating the language of the `track` text data.\n","type":"String.String -> Html.Attribute msg"},{"name":"start","comment":" Defines the first number of an ordered list if you want it to be something\nbesides 1.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"step","comment":" Add a step size to an `input`. Use `step \"any\"` to allow any floating-point\nnumber to be used in the input.\n","type":"String.String -> Html.Attribute msg"},{"name":"style","comment":" Specify a style.\n\n greeting : Node msg\n greeting =\n div\n [ style \"background-color\" \"red\"\n , style \"height\" \"90px\"\n , style \"width\" \"100%\"\n ]\n [ text \"Hello!\"\n ]\n\nThere is no `Html.Styles` module because best practices for working with HTML\nsuggest that this should primarily be specified in CSS files. So the general\nrecommendation is to use this function lightly.\n","type":"String.String -> String.String -> Html.Attribute msg"},{"name":"tabindex","comment":" Overrides the browser's default tab order and follows the one specified\ninstead.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"target","comment":" Specify where the results of clicking an `a`, `area`, `base`, or `form`\nshould appear. Possible special values include:\n\n * _blank &mdash; a new window or tab\n * _self &mdash; the same frame (this is default)\n * _parent &mdash; the parent frame\n * _top &mdash; the full body of the window\n\nYou can also give the name of any `frame` you have created.\n","type":"String.String -> Html.Attribute msg"},{"name":"title","comment":" Text to be displayed in a tooltip when hovering over the element. ","type":"String.String -> Html.Attribute msg"},{"name":"type_","comment":" Defines the type of a `button`, `input`, `embed`, `object`, `script`,\n`source`, `style`, or `menu`.\n","type":"String.String -> Html.Attribute msg"},{"name":"usemap","comment":" Specify the hash name reference of a `map` that should be used for an `img`\nor `object`. A hash name reference is a hash symbol followed by the element's name or id.\nE.g. `\"#planet-map\"`.\n","type":"String.String -> Html.Attribute msg"},{"name":"value","comment":" Defines a default value which will be displayed in a `button`, `option`,\n`input`, `li`, `meter`, `progress`, or `param`.\n","type":"String.String -> Html.Attribute msg"},{"name":"width","comment":" Declare the width of a `canvas`, `embed`, `iframe`, `img`, `input`,\n`object`, or `video`.\n","type":"Basics.Int -> Html.Attribute msg"},{"name":"wrap","comment":" Indicates whether the text should be wrapped in a `textarea`. Possible\nvalues are \"hard\" and \"soft\".\n","type":"String.String -> Html.Attribute msg"}],"binops":[]},{"name":"Html.Events","comment":"\nIt is often helpful to create an [Union Type][] so you can have many different kinds\nof events as seen in the [TodoMVC][] example.\n\n[Union Type]: https://elm-lang.org/learn/Union-Types.elm\n[TodoMVC]: https://github.com/evancz/elm-todomvc/blob/master/Todo.elm\n\n# Mouse\n@docs onClick, onDoubleClick,\n onMouseDown, onMouseUp,\n onMouseEnter, onMouseLeave,\n onMouseOver, onMouseOut\n\n# Forms\n@docs onInput, onCheck, onSubmit\n\n# Focus\n@docs onBlur, onFocus\n\n# Custom\n@docs on, stopPropagationOn, preventDefaultOn, custom\n\n## Custom Decoders\n@docs targetValue, targetChecked, keyCode\n","unions":[],"aliases":[],"values":[{"name":"custom","comment":" Create an event listener that may [`stopPropagation`][stop] or\n[`preventDefault`][prevent].\n\n[stop]: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation\n[prevent]: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault\n\n**Note:** If you need something even more custom (like capture phase) check\nout the lower-level event API in `elm/virtual-dom`.\n","type":"String.String -> Json.Decode.Decoder { message : msg, stopPropagation : Basics.Bool, preventDefault : Basics.Bool } -> Html.Attribute msg"},{"name":"keyCode","comment":" A `Json.Decoder` for grabbing `event.keyCode`. This helps you define\nkeyboard listeners like this:\n\n import Json.Decode as Json\n\n onKeyUp : (Int -> msg) -> Attribute msg\n onKeyUp tagger =\n on \"keyup\" (Json.map tagger keyCode)\n\n**Note:** It looks like the spec is moving away from `event.keyCode` and\ntowards `event.key`. Once this is supported in more browsers, we may add\nhelpers here for `onKeyUp`, `onKeyDown`, `onKeyPress`, etc.\n","type":"Json.Decode.Decoder Basics.Int"},{"name":"on","comment":" Create a custom event listener. Normally this will not be necessary, but\nyou have the power! Here is how `onClick` is defined for example:\n\n import Json.Decode as Decode\n\n onClick : msg -> Attribute msg\n onClick message =\n on \"click\" (Decode.succeed message)\n\nThe first argument is the event name in the same format as with JavaScript's\n[`addEventListener`][aEL] function.\n\nThe second argument is a JSON decoder. Read more about these [here][decoder].\nWhen an event occurs, the decoder tries to turn the event object into an Elm\nvalue. If successful, the value is routed to your `update` function. In the\ncase of `onClick` we always just succeed with the given `message`.\n\nIf this is confusing, work through the [Elm Architecture Tutorial][tutorial].\nIt really helps!\n\n[aEL]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n[decoder]: /packages/elm/json/latest/Json-Decode\n[tutorial]: https://github.com/evancz/elm-architecture-tutorial/\n\n**Note:** This creates a [passive][] event listener, enabling optimizations for\ntouch, scroll, and wheel events in some browsers.\n\n[passive]: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n","type":"String.String -> Json.Decode.Decoder msg -> Html.Attribute msg"},{"name":"onBlur","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onCheck","comment":" Detect [change](https://developer.mozilla.org/en-US/docs/Web/Events/change)\nevents on checkboxes. It will grab the boolean value from `event.target.checked`\non any input event.\n\nCheck out [`targetChecked`](#targetChecked) for more details on how this works.\n","type":"(Basics.Bool -> msg) -> Html.Attribute msg"},{"name":"onClick","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onDoubleClick","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onFocus","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onInput","comment":" Detect [input](https://developer.mozilla.org/en-US/docs/Web/Events/input)\nevents for things like text fields or text areas.\n\nFor more details on how `onInput` works, check out [`targetValue`](#targetValue).\n\n**Note 1:** It grabs the **string** value at `event.target.value`, so it will\nnot work if you need some other information. For example, if you want to track\ninputs on a range slider, make a custom handler with [`on`](#on).\n\n**Note 2:** It uses `stopPropagationOn` internally to always stop propagation\nof the event. This is important for complicated reasons explained [here][1] and\n[here][2].\n\n[1]: /packages/elm/virtual-dom/latest/VirtualDom#Handler\n[2]: https://github.com/elm/virtual-dom/issues/125\n","type":"(String.String -> msg) -> Html.Attribute msg"},{"name":"onMouseDown","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onMouseEnter","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onMouseLeave","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onMouseOut","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onMouseOver","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onMouseUp","comment":"","type":"msg -> Html.Attribute msg"},{"name":"onSubmit","comment":" Detect a [submit](https://developer.mozilla.org/en-US/docs/Web/Events/submit)\nevent with [`preventDefault`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\nin order to prevent the form from changing the page’s location. If you need\ndifferent behavior, create a custom event handler.\n","type":"msg -> Html.Attribute msg"},{"name":"preventDefaultOn","comment":" Create an event listener that may [`preventDefault`][prevent]. Your decoder\nmust produce a message and a `Bool` that decides if `preventDefault` should\nbe called.\n\nFor example, the `onSubmit` function in this library *always* prevents the\ndefault behavior:\n\n[prevent]: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault\n\n onSubmit : msg -> Attribute msg\n onSubmit msg =\n preventDefaultOn \"submit\" (Json.map alwaysPreventDefault (Json.succeed msg))\n\n alwaysPreventDefault : msg -> ( msg, Bool )\n alwaysPreventDefault msg =\n ( msg, True )\n","type":"String.String -> Json.Decode.Decoder ( msg, Basics.Bool ) -> Html.Attribute msg"},{"name":"stopPropagationOn","comment":" Create an event listener that may [`stopPropagation`][stop]. Your decoder\nmust produce a message and a `Bool` that decides if `stopPropagation` should\nbe called.\n\n[stop]: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation\n\n**Note:** This creates a [passive][] event listener, enabling optimizations for\ntouch, scroll, and wheel events in some browsers.\n\n[passive]: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n","type":"String.String -> Json.Decode.Decoder ( msg, Basics.Bool ) -> Html.Attribute msg"},{"name":"targetChecked","comment":" A `Json.Decoder` for grabbing `event.target.checked`. We use this to define\n`onCheck` as follows:\n\n import Json.Decode as Json\n\n onCheck : (Bool -> msg) -> Attribute msg\n onCheck tagger =\n on \"input\" (Json.map tagger targetChecked)\n","type":"Json.Decode.Decoder Basics.Bool"},{"name":"targetValue","comment":" A `Json.Decoder` for grabbing `event.target.value`. We use this to define\n`onInput` as follows:\n\n import Json.Decode as Json\n\n onInput : (String -> msg) -> Attribute msg\n onInput tagger =\n stopPropagationOn \"input\" <|\n Json.map alwaysStop (Json.map tagger targetValue)\n\n alwaysStop : a -> (a, Bool)\n alwaysStop x =\n (x, True)\n\nYou probably will never need this, but hopefully it gives some insights into\nhow to make custom event handlers.\n","type":"Json.Decode.Decoder String.String"}],"binops":[]},{"name":"Html.Keyed","comment":" A keyed node helps optimize cases where children are getting added, moved,\nremoved, etc. Common examples include:\n\n - The user can delete items from a list.\n - The user can create new items in a list.\n - You can sort a list based on name or date or whatever.\n\nWhen you use a keyed node, every child is paired with a string identifier. This\nmakes it possible for the underlying diffing algorithm to reuse nodes more\nefficiently.\n\n# Keyed Nodes\n@docs node\n\n# Commonly Keyed Nodes\n@docs ol, ul\n","unions":[],"aliases":[],"values":[{"name":"node","comment":" Works just like `Html.node`, but you add a unique identifier to each child\nnode. You want this when you have a list of nodes that is changing: adding\nnodes, removing nodes, etc. In these cases, the unique identifiers help make\nthe DOM modifications more efficient.\n","type":"String.String -> List.List (Html.Attribute msg) -> List.List ( String.String, Html.Html msg ) -> Html.Html msg"},{"name":"ol","comment":"","type":"List.List (Html.Attribute msg) -> List.List ( String.String, Html.Html msg ) -> Html.Html msg"},{"name":"ul","comment":"","type":"List.List (Html.Attribute msg) -> List.List ( String.String, Html.Html msg ) -> Html.Html msg"}],"binops":[]},{"name":"Html.Lazy","comment":" Since all Elm functions are pure we have a guarantee that the same input\nwill always result in the same output. This module gives us tools to be lazy\nabout building `Html` that utilize this fact.\n\nRather than immediately applying functions to their arguments, the `lazy`\nfunctions just bundle the function and arguments up for later. When diffing\nthe old and new virtual DOM, it checks to see if all the arguments are equal\nby reference. If so, it skips calling the function!\n\nThis is a really cheap test and often makes things a lot faster, but definitely\nbenchmark to be sure!\n\n@docs lazy, lazy2, lazy3, lazy4, lazy5, lazy6, lazy7, lazy8\n\n","unions":[],"aliases":[],"values":[{"name":"lazy","comment":" A performance optimization that delays the building of virtual DOM nodes.\n\nCalling `(view model)` will definitely build some virtual DOM, perhaps a lot of\nit. Calling `(lazy view model)` delays the call until later. During diffing, we\ncan check to see if `model` is referentially equal to the previous value used,\nand if so, we just stop. No need to build up the tree structure and diff it,\nwe know if the input to `view` is the same, the output must be the same!\n","type":"(a -> Html.Html msg) -> a -> Html.Html msg"},{"name":"lazy2","comment":" Same as `lazy` but checks on two arguments.\n","type":"(a -> b -> Html.Html msg) -> a -> b -> Html.Html msg"},{"name":"lazy3","comment":" Same as `lazy` but checks on three arguments.\n","type":"(a -> b -> c -> Html.Html msg) -> a -> b -> c -> Html.Html msg"},{"name":"lazy4","comment":" Same as `lazy` but checks on four arguments.\n","type":"(a -> b -> c -> d -> Html.Html msg) -> a -> b -> c -> d -> Html.Html msg"},{"name":"lazy5","comment":" Same as `lazy` but checks on five arguments.\n","type":"(a -> b -> c -> d -> e -> Html.Html msg) -> a -> b -> c -> d -> e -> Html.Html msg"},{"name":"lazy6","comment":" Same as `lazy` but checks on six arguments.\n","type":"(a -> b -> c -> d -> e -> f -> Html.Html msg) -> a -> b -> c -> d -> e -> f -> Html.Html msg"},{"name":"lazy7","comment":" Same as `lazy` but checks on seven arguments.\n","type":"(a -> b -> c -> d -> e -> f -> g -> Html.Html msg) -> a -> b -> c -> d -> e -> f -> g -> Html.Html msg"},{"name":"lazy8","comment":" Same as `lazy` but checks on eight arguments.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h -> Html.Html msg) -> a -> b -> c -> d -> e -> f -> g -> h -> Html.Html msg"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2016-present, 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.
@@ -1,36 +0,0 @@
1
- # HTTP
2
-
3
- Make HTTP requests in Elm. Talk to servers.
4
-
5
- **I very highly recommend reading through [The Official Guide](https://guide.elm-lang.org) to understand how to use this package!**
6
-
7
-
8
- ## Examples
9
-
10
- Here are some commands you might create to send HTTP requests with this package:
11
-
12
- ```elm
13
- import Http
14
- import Json.Decode as D
15
-
16
- type Msg
17
- = GotBook (Result Http.Error String)
18
- | GotItems (Result Http.Error (List String))
19
-
20
- getBook : Cmd Msg
21
- getBook =
22
- Http.get
23
- { url = "https://elm-lang.org/assets/public-opinion.txt"
24
- , expect = Http.expectString GotBook
25
- }
26
-
27
- fetchItems : Cmd Msg
28
- fetchItems =
29
- Http.post
30
- { url = "https://example.com/items.json"
31
- , body = Http.emptyBody
32
- , expect = Http.expectJson GotItems (D.list (D.field "name" D.string))
33
- }
34
- ```
35
-
36
- But again, to really understand what is going on here, **read through [The Official Guide](https://guide.elm-lang.org).** It has sections describing how HTTP works and how to use it with JSON data. Reading through will take less time overall than trying to figure everything out by trial and error!
@@ -1 +0,0 @@
1
- [{"name":"Http","comment":" Send HTTP requests.\n\n# Requests\n@docs get, post, request\n\n# Header\n@docs Header, header\n\n# Body\n@docs Body, emptyBody, stringBody, jsonBody, fileBody, bytesBody\n\n# Body Parts\n@docs multipartBody, Part, stringPart, filePart, bytesPart\n\n# Expect\n@docs Expect, expectString, expectJson, expectBytes, expectWhatever, Error\n\n# Progress\n@docs track, Progress, fractionSent, fractionReceived\n\n# Cancel\n@docs cancel\n\n# Risky Requests\n@docs riskyRequest\n\n# Elaborate Expectations\n@docs expectStringResponse, expectBytesResponse, Response, Metadata\n\n# Tasks\n@docs task, Resolver, stringResolver, bytesResolver, riskyTask\n","unions":[{"name":"Body","comment":" Represents the body of a `Request`.\n","args":[],"cases":[]},{"name":"Error","comment":" A `Request` can fail in a couple ways:\n\n- `BadUrl` means you did not provide a valid URL.\n- `Timeout` means it took too long to get a response.\n- `NetworkError` means the user turned off their wifi, went in a cave, etc.\n- `BadStatus` means you got a response back, but the status code indicates failure.\n- `BadBody` means you got a response back with a nice status code, but the body\nof the response was something unexpected. The `String` in this case is a\ndebugging message that explains what went wrong with your JSON decoder or\nwhatever.\n\n**Note:** You can use [`expectStringResponse`](#expectStringResponse) and\n[`expectBytesResponse`](#expectBytesResponse) to get more flexibility on this.\n","args":[],"cases":[["BadUrl",["String.String"]],["Timeout",[]],["NetworkError",[]],["BadStatus",["Basics.Int"]],["BadBody",["String.String"]]]},{"name":"Expect","comment":" Logic for interpreting a response body.\n","args":["msg"],"cases":[]},{"name":"Header","comment":" An HTTP header for configuring requests. See a bunch of common headers\n[here](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields).\n","args":[],"cases":[]},{"name":"Part","comment":" One part of a `multipartBody`.\n","args":[],"cases":[]},{"name":"Progress","comment":" There are two phases to HTTP requests. First you **send** a bunch of data,\nthen you **receive** a bunch of data. For example, say you use `fileBody` to\nupload a file of 262144 bytes. From there, progress will go like this:\n\n```\nSending { sent = 0, size = 262144 } -- 0.0\nSending { sent = 65536, size = 262144 } -- 0.25\nSending { sent = 131072, size = 262144 } -- 0.5\nSending { sent = 196608, size = 262144 } -- 0.75\nSending { sent = 262144, size = 262144 } -- 1.0\nReceiving { received = 0, size = Just 16 } -- 0.0\nReceiving { received = 16, size = Just 16 } -- 1.0\n```\n\nWith file uploads, the **send** phase is expensive. That is what we saw in our\nexample. But with file downloads, the **receive** phase is expensive.\n\nUse [`fractionSent`](#fractionSent) and [`fractionReceived`](#fractionReceived)\nto turn this progress information into specific fractions!\n\n**Note:** The `size` of the response is based on the [`Content-Length`][cl]\nheader, and in rare and annoying cases, a server may not include that header.\nThat is why the `size` is a `Maybe Int` in `Receiving`.\n\n[cl]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length\n","args":[],"cases":[["Sending",["{ sent : Basics.Int, size : Basics.Int }"]],["Receiving",["{ received : Basics.Int, size : Maybe.Maybe Basics.Int }"]]]},{"name":"Resolver","comment":" Describes how to resolve an HTTP task. You can create a resolver with\n[`stringResolver`](#stringResolver) and [`bytesResolver`](#bytesResolver).\n","args":["x","a"],"cases":[]},{"name":"Response","comment":" A `Response` can come back a couple different ways:\n\n- `BadUrl_` means you did not provide a valid URL.\n- `Timeout_` means it took too long to get a response.\n- `NetworkError_` means the user turned off their wifi, went in a cave, etc.\n- `BadResponse_` means you got a response back, but the status code indicates failure.\n- `GoodResponse_` means you got a response back with a nice status code!\n\nThe type of the `body` depends on whether you use\n[`expectStringResponse`](#expectStringResponse)\nor [`expectBytesResponse`](#expectBytesResponse).\n","args":["body"],"cases":[["BadUrl_",["String.String"]],["Timeout_",[]],["NetworkError_",[]],["BadStatus_",["Http.Metadata","body"]],["GoodStatus_",["Http.Metadata","body"]]]}],"aliases":[{"name":"Metadata","comment":" Extra information about the response:\n\n- `url` of the server that actually responded (so you can detect redirects)\n- `statusCode` like `200` or `404`\n- `statusText` describing what the `statusCode` means a little\n- `headers` like `Content-Length` and `Expires`\n\n**Note:** It is possible for a response to have the same header multiple times.\nIn that case, all the values end up in a single entry in the `headers`\ndictionary. The values are separated by commas, following the rules outlined\n[here](https://stackoverflow.com/questions/4371328/are-duplicate-http-response-headers-acceptable).\n","args":[],"type":"{ url : String.String, statusCode : Basics.Int, statusText : String.String, headers : Dict.Dict String.String String.String }"}],"values":[{"name":"bytesBody","comment":" Put some `Bytes` in the body of your `Request`. This allows you to use\n[`elm/bytes`](/packages/elm/bytes/latest) to have full control over the binary\nrepresentation of the data you are sending. For example, you could create an\n`archive.zip` file and send it along like this:\n\n import Bytes exposing (Bytes)\n\n zipBody : Bytes -> Body\n zipBody bytes =\n bytesBody \"application/zip\" bytes\n\nThe first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type)\nof the body. In other scenarios you may want to use MIME types like `image/png`\nor `image/jpeg` instead.\n\n**Note:** Use [`track`](#track) to track upload progress.\n","type":"String.String -> Bytes.Bytes -> Http.Body"},{"name":"bytesPart","comment":" A part that contains bytes, allowing you to use\n[`elm/bytes`](/packages/elm/bytes/latest) to encode data exactly in the format\nyou need.\n\n multipartBody\n [ stringPart \"title\" \"Tom\"\n , bytesPart \"photo\" \"image/png\" bytes\n ]\n\n**Note:** You must provide a MIME type so that the receiver has clues about\nhow to interpret the bytes.\n","type":"String.String -> String.String -> Bytes.Bytes -> Http.Part"},{"name":"bytesResolver","comment":" Turn a response with a `Bytes` body into a result.\nSimilar to [`expectBytesResponse`](#expectBytesResponse).\n","type":"(Http.Response Bytes.Bytes -> Result.Result x a) -> Http.Resolver x a"},{"name":"cancel","comment":" Try to cancel an ongoing request based on a `tracker`.\n","type":"String.String -> Platform.Cmd.Cmd msg"},{"name":"emptyBody","comment":" Create an empty body for your `Request`. This is useful for GET requests\nand POST requests where you are not sending any data.\n","type":"Http.Body"},{"name":"expectBytes","comment":" Expect the response body to be binary data. For example, maybe you are\ntalking to an endpoint that gives back ProtoBuf data:\n\n import Bytes.Decode as Bytes\n import Http\n\n type Msg\n = GotData (Result Http.Error Data)\n\n getData : Cmd Msg\n getData =\n Http.get\n { url = \"/data\"\n , expect = Http.expectBytes GotData dataDecoder\n }\n\n -- dataDecoder : Bytes.Decoder Data\n\nYou would use [`elm/bytes`](/packages/elm/bytes/latest/) to decode the binary\ndata according to a proto definition file like `example.proto`.\n\nIf the decoder fails, you get a `BadBody` error that just indicates that\n_something_ went wrong. It probably makes sense to debug by peeking at the\nbytes you are getting in the browser developer tools or something.\n","type":"(Result.Result Http.Error a -> msg) -> Bytes.Decode.Decoder a -> Http.Expect msg"},{"name":"expectBytesResponse","comment":" Expect a [`Response`](#Response) with a `Bytes` body.\n\nIt works just like [`expectStringResponse`](#expectStringResponse), giving you\nmore access to headers and more leeway in defining your own errors.\n","type":"(Result.Result x a -> msg) -> (Http.Response Bytes.Bytes -> Result.Result x a) -> Http.Expect msg"},{"name":"expectJson","comment":" Expect the response body to be JSON. Like if you want to get a random cat\nGIF you might say:\n\n import Http\n import Json.Decode exposing (Decoder, field, string)\n\n type Msg\n = GotGif (Result Http.Error String)\n\n getRandomCatGif : Cmd Msg\n getRandomCatGif =\n Http.get\n { url = \"https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cat\"\n , expect = Http.expectJson GotGif gifDecoder\n }\n\n gifDecoder : Decoder String\n gifDecoder =\n field \"data\" (field \"image_url\" string)\n\nThe official guide goes through this particular example [here][]. That page\nalso introduces [`elm/json`][json] to help you get started turning JSON into\nElm values in other situations.\n\n[here]: https://guide.elm-lang.org/interop/json.html\n[json]: /packages/elm/json/latest/\n\nIf the JSON decoder fails, you get a `BadBody` error that tries to explain\nwhat went wrong.\n","type":"(Result.Result Http.Error a -> msg) -> Json.Decode.Decoder a -> Http.Expect msg"},{"name":"expectString","comment":" Expect the response body to be a `String`. Like when getting the full text\nof a book:\n\n import Http\n\n type Msg\n = GotText (Result Http.Error String)\n\n getPublicOpinion : Cmd Msg\n getPublicOpinion =\n Http.get\n { url = \"https://elm-lang.org/assets/public-opinion.txt\"\n , expect = Http.expectString GotText\n }\n\nThe response body is always some sequence of bytes, but in this case, we\nexpect it to be UTF-8 encoded text that can be turned into a `String`.\n","type":"(Result.Result Http.Error String.String -> msg) -> Http.Expect msg"},{"name":"expectStringResponse","comment":" Expect a [`Response`](#Response) with a `String` body. So you could define\nyour own [`expectJson`](#expectJson) like this:\n\n import Http\n import Json.Decode as D\n\n expectJson : (Result Http.Error a -> msg) -> D.Decoder a -> Expect msg\n expectJson toMsg decoder =\n expectStringResponse toMsg <|\n \\response ->\n case response of\n Http.BadUrl_ url ->\n Err (Http.BadUrl url)\n\n Http.Timeout_ ->\n Err Http.Timeout\n\n Http.NetworkError_ ->\n Err Http.NetworkError\n\n Http.BadStatus_ metadata body ->\n Err (Http.BadStatus metadata.statusCode)\n\n Http.GoodStatus_ metadata body ->\n case D.decodeString decoder body of\n Ok value ->\n Ok value\n\n Err err ->\n BadBody (D.errorToString err)\n\nThis function is great for fancier error handling and getting response headers.\nFor example, maybe when your sever gives a 404 status code (not found) it also\nprovides a helpful JSON message in the response body. This function lets you\nadd logic to the `BadStatus_` branch so you can parse that JSON and give users\na more helpful message! Or make your own custom error type for your particular\napplication!\n","type":"(Result.Result x a -> msg) -> (Http.Response String.String -> Result.Result x a) -> Http.Expect msg"},{"name":"expectWhatever","comment":" Expect the response body to be whatever. It does not matter. Ignore it!\nFor example, you might want this when uploading files:\n\n import Http\n\n type Msg\n = Uploaded (Result Http.Error ())\n\n upload : File -> Cmd Msg\n upload file =\n Http.post\n { url = \"/upload\"\n , body = Http.fileBody file\n , expect = Http.expectWhatever Uploaded\n }\n\nThe server may be giving back a response body, but we do not care about it.\n","type":"(Result.Result Http.Error () -> msg) -> Http.Expect msg"},{"name":"fileBody","comment":" Use a file as the body of your `Request`. When someone uploads an image\ninto the browser with [`elm/file`](/packages/elm/file/latest) you can forward\nit to a server.\n\nThis will automatically set the `Content-Type` to the MIME type of the file.\n\n**Note:** Use [`track`](#track) to track upload progress.\n","type":"File.File -> Http.Body"},{"name":"filePart","comment":" A part that contains a file. You can use\n[`elm/file`](/packages/elm/file/latest) to get files loaded into the\nbrowser. From there, you can send it along to a server like this:\n\n multipartBody\n [ stringPart \"product\" \"Ikea Bekant\"\n , stringPart \"description\" \"Great desk for home office.\"\n , filePart \"image[]\" file1\n , filePart \"image[]\" file2\n , filePart \"image[]\" file3\n ]\n","type":"String.String -> File.File -> Http.Part"},{"name":"fractionReceived","comment":" Turn `Receiving` progress into a useful fraction for progress bars.\n\n fractionReceived { received = 0, size = Just 1024 } == 0.0\n fractionReceived { received = 256, size = Just 1024 } == 0.25\n fractionReceived { received = 512, size = Just 1024 } == 0.5\n\n -- fractionReceived { received = 0, size = Nothing } == 0.0\n -- fractionReceived { received = 256, size = Nothing } == 0.0\n -- fractionReceived { received = 512, size = Nothing } == 0.0\n\nThe `size` here is based on the [`Content-Length`][cl] header which may be\nmissing in some cases. A server may be misconfigured or it may be streaming\ndata and not actually know the final size. Whatever the case, this function\nwill always give `0.0` when the final size is unknown.\n\nFurthermore, the `Content-Length` header may be incorrect! The implementation\nclamps the fraction between `0.0` and `1.0`, so you will just get `1.0` if\nyou ever receive more bytes than promised.\n\n**Note:** If you are streaming something, you can write a custom version of\nthis function that just tracks bytes received. Maybe you show that 22kb or 83kb\nhave been downloaded, without a specific fraction. If you do this, be wary of\ndivide-by-zero errors because `size` can always be zero!\n\n[cl]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length\n","type":"{ received : Basics.Int, size : Maybe.Maybe Basics.Int } -> Basics.Float"},{"name":"fractionSent","comment":" Turn `Sending` progress into a useful fraction.\n\n fractionSent { sent = 0, size = 1024 } == 0.0\n fractionSent { sent = 256, size = 1024 } == 0.25\n fractionSent { sent = 512, size = 1024 } == 0.5\n\n -- fractionSent { sent = 0, size = 0 } == 1.0\n\nThe result is always between `0.0` and `1.0`, ensuring that any progress bar\nanimations never go out of bounds.\n\nAnd notice that `size` can be zero. That means you are sending a request with\nan empty body. Very common! When `size` is zero, the result is always `1.0`.\n\n**Note:** If you create your own function to compute this fraction, watch out\nfor divide-by-zero errors!\n","type":"{ sent : Basics.Int, size : Basics.Int } -> Basics.Float"},{"name":"get","comment":" Create a `GET` request.\n\n import Http\n\n type Msg\n = GotText (Result Http.Error String)\n\n getPublicOpinion : Cmd Msg\n getPublicOpinion =\n Http.get\n { url = \"https://elm-lang.org/assets/public-opinion.txt\"\n , expect = Http.expectString GotText\n }\n\nYou can use functions like [`expectString`](#expectString) and\n[`expectJson`](#expectJson) to interpret the response in different ways. In\nthis example, we are expecting the response body to be a `String` containing\nthe full text of _Public Opinion_ by Walter Lippmann.\n\n**Note:** Use [`elm/url`](/packages/elm/url/latest) to build reliable URLs.\n","type":"{ url : String.String, expect : Http.Expect msg } -> Platform.Cmd.Cmd msg"},{"name":"header","comment":" Create a `Header`.\n\n header \"If-Modified-Since\" \"Sat 29 Oct 1994 19:43:31 GMT\"\n header \"Max-Forwards\" \"10\"\n header \"X-Requested-With\" \"XMLHttpRequest\"\n","type":"String.String -> String.String -> Http.Header"},{"name":"jsonBody","comment":" Put some JSON value in the body of your `Request`. This will automatically\nadd the `Content-Type: application/json` header.\n","type":"Json.Encode.Value -> Http.Body"},{"name":"multipartBody","comment":" When someone clicks submit on the `<form>`, browsers send a special HTTP\nrequest with all the form data. Something like this:\n\n```\nPOST /test.html HTTP/1.1\nHost: example.org\nContent-Type: multipart/form-data;boundary=\"7MA4YWxkTrZu0gW\"\n\n--7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"title\"\n\nTrip to London\n--7MA4YWxkTrZu0gW\nContent-Disposition: form-data; name=\"album[]\"; filename=\"parliment.jpg\"\n\n...RAW...IMAGE...BITS...\n--7MA4YWxkTrZu0gW--\n```\n\nThis was the only way to send files for a long time, so many servers expect\ndata in this format. **The `multipartBody` function lets you create these\nrequests.** For example, to upload a photo album all at once, you could create\na body like this:\n\n multipartBody\n [ stringPart \"title\" \"Trip to London\"\n , filePart \"album[]\" file1\n , filePart \"album[]\" file2\n , filePart \"album[]\" file3\n ]\n\nAll of the body parts need to have a name. Names can be repeated. Adding the\n`[]` on repeated names is a convention from PHP. It seems weird, but I see it\nenough to mention it. You do not have to do it that way, especially if your\nserver uses some other convention!\n\nThe `Content-Type: multipart/form-data` header is automatically set when\ncreating a body this way.\n\n**Note:** Use [`track`](#track) to track upload progress.\n","type":"List.List Http.Part -> Http.Body"},{"name":"post","comment":" Create a `POST` request. So imagine we want to send a POST request for\nsome JSON data. It might look like this:\n\n import Http\n import Json.Decode exposing (list, string)\n\n type Msg\n = GotBooks (Result Http.Error (List String))\n\n postBooks : Cmd Msg\n postBooks =\n Http.post\n { url = \"https://example.com/books\"\n , body = Http.emptyBody\n , expect = Http.expectJson GotBooks (list string)\n }\n\nNotice that we are using [`expectJson`](#expectJson) to interpret the response\nas JSON. You can learn more about how JSON decoders work [here][] in the guide.\n\nWe did not put anything in the body of our request, but you can use functions\nlike [`stringBody`](#stringBody) and [`jsonBody`](#jsonBody) if you need to\nsend information to the server.\n\n[here]: https://guide.elm-lang.org/interop/json.html\n","type":"{ url : String.String, body : Http.Body, expect : Http.Expect msg } -> Platform.Cmd.Cmd msg"},{"name":"request","comment":" Create a custom request. For example, a PUT for files might look like this:\n\n import File\n import Http\n\n type Msg = Uploaded (Result Http.Error ())\n\n upload : File.File -> Cmd Msg\n upload file =\n Http.request\n { method = \"PUT\"\n , headers = []\n , url = \"https://example.com/publish\"\n , body = Http.fileBody file\n , expect = Http.expectWhatever Uploaded\n , timeout = Nothing\n , tracker = Nothing\n }\n\nIt lets you set custom `headers` as needed. The `timeout` is the number of\nmilliseconds you are willing to wait before giving up. The `tracker` lets you\n[`cancel`](#cancel) and [`track`](#track) requests.\n","type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, expect : Http.Expect msg, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String } -> Platform.Cmd.Cmd msg"},{"name":"riskyRequest","comment":" Create a request with a risky security policy. Things like:\n\n- Allow responses from other domains to set cookies.\n- Include cookies in requests to other domains.\n\nThis is called [`withCredentials`][wc] in JavaScript, and it allows a couple\nother risky things as well. It can be useful if `www.example.com` needs to\ntalk to `uploads.example.com`, but it should be used very carefully!\n\nFor example, every HTTP request includes a `Host` header revealing the domain,\nso any request to `facebook.com` reveals the website that sent it. From there,\ncookies can be used to correlate browsing habits with specific users. “Oh, it\nlooks like they visited `example.com`. Maybe they want ads about examples!”\nThis is why you can get shoe ads for months without saying anything about it\non any social networks. **This risk exists even for people who do not have an\naccount.** Servers can set a new cookie to uniquely identify the browser and\nbuild a profile around that. Same kind of tricks for logged out users.\n\n**Context:** A significantly worse version of this can happen when trying to\nadd integrations with Google, Facebook, Pinterest, Twitter, etc. “Add our share\nbutton. It is super easy. Just add this `<script>` tag!” But the goal here is\nto get _arbitrary_ access to the executing context. Now they can track clicks,\nread page content, use time zones to approximate location, etc. As of this\nwriting, suggesting that developers just embed `<script>` tags is the default\nfor Google Analytics, Facebook Like Buttons, Twitter Follow Buttons, Pinterest\nSave Buttons, and Instagram Embeds.\n\n[ah]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization\n[wc]: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials\n","type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, expect : Http.Expect msg, timeout : Maybe.Maybe Basics.Float, tracker : Maybe.Maybe String.String } -> Platform.Cmd.Cmd msg"},{"name":"riskyTask","comment":" Just like [`riskyRequest`](#riskyRequest), but it creates a `Task`. **Use\nwith caution!** This has all the same security concerns as `riskyRequest`.\n","type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, resolver : Http.Resolver x a, timeout : Maybe.Maybe Basics.Float } -> Task.Task x a"},{"name":"stringBody","comment":" Put some string in the body of your `Request`. Defining `jsonBody` looks\nlike this:\n\n import Json.Encode as Encode\n\n jsonBody : Encode.Value -> Body\n jsonBody value =\n stringBody \"application/json\" (Encode.encode 0 value)\n\nThe first argument is a [MIME type](https://en.wikipedia.org/wiki/Media_type)\nof the body. Some servers are strict about this!\n","type":"String.String -> String.String -> Http.Body"},{"name":"stringPart","comment":" A part that contains `String` data.\n\n multipartBody\n [ stringPart \"title\" \"Tom\"\n , filePart \"photo\" tomPng\n ]\n","type":"String.String -> String.String -> Http.Part"},{"name":"stringResolver","comment":" Turn a response with a `String` body into a result.\nSimilar to [`expectStringResponse`](#expectStringResponse).\n","type":"(Http.Response String.String -> Result.Result x a) -> Http.Resolver x a"},{"name":"task","comment":" Just like [`request`](#request), but it creates a `Task`. This makes it\npossible to pair your HTTP request with `Time.now` if you need timestamps for\nsome reason. **This should be quite rare.**\n","type":"{ method : String.String, headers : List.List Http.Header, url : String.String, body : Http.Body, resolver : Http.Resolver x a, timeout : Maybe.Maybe Basics.Float } -> Task.Task x a"},{"name":"track","comment":" Track the progress of a request. Create a [`request`](#request) where\n`tracker = Just \"form.pdf\"` and you can track it with a subscription like\n`track \"form.pdf\" GotProgress`.\n","type":"String.String -> (Http.Progress -> msg) -> Platform.Sub.Sub msg"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2014-present, 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.
@@ -1,63 +0,0 @@
1
- # JSON in Elm
2
-
3
- This package helps you convert between Elm values and JSON values.
4
-
5
- This package is usually used alongside [`elm/http`](http://package.elm-lang.org/packages/elm/http/latest) to talk to servers or [ports](https://guide.elm-lang.org/interop/ports.html) to talk to JavaScript.
6
-
7
-
8
- ## Example
9
-
10
- Have you seen this [causes of death](https://en.wikipedia.org/wiki/List_of_causes_of_death_by_rate) table? Did you know that in 2002, war accounted for 0.3% of global deaths whereas road traffic accidents accounted for 2.09% and diarrhea accounted for 3.15%?
11
-
12
- The table is interesting, but say we want to visualize this data in a nicer way. We will need some way to get the cause-of-death data from our server, so we create encoders and decoders:
13
-
14
- ```elm
15
- module Cause exposing (Cause, encode, decoder)
16
-
17
- import Json.Decode as D
18
- import Json.Encode as E
19
-
20
-
21
- -- CAUSE OF DEATH
22
-
23
- type alias Cause =
24
- { name : String
25
- , percent : Float
26
- , per100k : Float
27
- }
28
-
29
-
30
- -- ENCODE
31
-
32
- encode : Cause -> E.Value
33
- encode cause =
34
- E.object
35
- [ ("name", E.string cause.name)
36
- , ("percent", E.float cause.percent)
37
- , ("per100k", E.float cause.per100k)
38
- ]
39
-
40
-
41
- -- DECODER
42
-
43
- decoder : D.Decoder Cause
44
- decoder =
45
- D.map3 Cause
46
- (D.field "name" D.string)
47
- (D.field "percent" D.float)
48
- (D.field "per100k" D.float)
49
- ```
50
-
51
- Now in some other code we can use `Cause.encode` and `Cause.decoder` as building blocks. So if we want to decode a list of causes, saying `Decode.list Cause.decoder` will handle it!
52
-
53
- Point is, the goal should be:
54
-
55
- 1. Make small JSON decoders and encoders.
56
- 2. Snap together these building blocks as needed.
57
-
58
- So say you decide to make the `name` field more precise. Instead of a `String`, you want to use codes from the [International Classification of Diseases](http://www.who.int/classifications/icd/en/) recommended by the World Health Organization. These [codes](http://apps.who.int/classifications/icd10/browse/2016/en) are used in a lot of mortality data sets. So it may make sense to make a separate `IcdCode` module with its own `IcdCode.encode` and `IcdCode.decoder` that ensure you are working with valid codes. From there, you can use them as building blocks in the `Cause` module!
59
-
60
-
61
- ## Future Plans
62
-
63
- It is easy to get focused on how to optimize the use of JSON, but I think this is missing the bigger picture. Instead, I would like to head towards [this vision](https://gist.github.com/evancz/1c5f2cf34939336ecb79b97bb89d9da6) of data interchange.
@@ -1 +0,0 @@
1
- [{"name":"Json.Decode","comment":" Turn JSON values into Elm values. Definitely check out this [intro to\nJSON decoders][guide] to get a feel for how this library works!\n\n[guide]: https://guide.elm-lang.org/effects/json.html\n\n# Primitives\n@docs Decoder, string, bool, int, float\n\n# Data Structures\n@docs nullable, list, array, dict, keyValuePairs, oneOrMore\n\n# Object Primitives\n@docs field, at, index\n\n# Inconsistent Structure\n@docs maybe, oneOf\n\n# Run Decoders\n@docs decodeString, decodeValue, Value, Error, errorToString\n\n# Mapping\n\n**Note:** If you run out of map functions, take a look at [elm-json-decode-pipeline][pipe]\nwhich makes it easier to handle large objects, but produces lower quality type\nerrors.\n\n[pipe]: /packages/NoRedInk/elm-json-decode-pipeline/latest\n\n@docs map, map2, map3, map4, map5, map6, map7, map8\n\n# Fancy Decoding\n@docs lazy, value, null, succeed, fail, andThen\n","unions":[{"name":"Decoder","comment":" A value that knows how to decode JSON values.\n\nThere is a whole section in `guide.elm-lang.org` about decoders, so [check it\nout](https://guide.elm-lang.org/interop/json.html) for a more comprehensive\nintroduction!\n","args":["a"],"cases":[]},{"name":"Error","comment":" A structured error describing exactly how the decoder failed. You can use\nthis to create more elaborate visualizations of a decoder problem. For example,\nyou could show the entire JSON object and show the part causing the failure in\nred.\n","args":[],"cases":[["Field",["String.String","Json.Decode.Error"]],["Index",["Basics.Int","Json.Decode.Error"]],["OneOf",["List.List Json.Decode.Error"]],["Failure",["String.String","Json.Decode.Value"]]]}],"aliases":[{"name":"Value","comment":" Represents a JavaScript value.\n","args":[],"type":"Json.Encode.Value"}],"values":[{"name":"andThen","comment":" Create decoders that depend on previous results. If you are creating\nversioned data, you might do something like this:\n\n info : Decoder Info\n info =\n field \"version\" int\n |> andThen infoHelp\n\n infoHelp : Int -> Decoder Info\n infoHelp version =\n case version of\n 4 ->\n infoDecoder4\n\n 3 ->\n infoDecoder3\n\n _ ->\n fail <|\n \"Trying to decode info, but version \"\n ++ toString version ++ \" is not supported.\"\n\n -- infoDecoder4 : Decoder Info\n -- infoDecoder3 : Decoder Info\n","type":"(a -> Json.Decode.Decoder b) -> Json.Decode.Decoder a -> Json.Decode.Decoder b"},{"name":"array","comment":" Decode a JSON array into an Elm `Array`.\n\n decodeString (array int) \"[1,2,3]\" == Ok (Array.fromList [1,2,3])\n decodeString (array bool) \"[true,false]\" == Ok (Array.fromList [True,False])\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Array.Array a)"},{"name":"at","comment":" Decode a nested JSON object, requiring certain fields.\n\n json = \"\"\"{ \"person\": { \"name\": \"tom\", \"age\": 42 } }\"\"\"\n\n decodeString (at [\"person\", \"name\"] string) json == Ok \"tom\"\n decodeString (at [\"person\", \"age\" ] int ) json == Ok \"42\n\nThis is really just a shorthand for saying things like:\n\n field \"person\" (field \"name\" string) == at [\"person\",\"name\"] string\n","type":"List.List String.String -> Json.Decode.Decoder a -> Json.Decode.Decoder a"},{"name":"bool","comment":" Decode a JSON boolean into an Elm `Bool`.\n\n decodeString bool \"true\" == Ok True\n decodeString bool \"42\" == Err ...\n decodeString bool \"3.14\" == Err ...\n decodeString bool \"\\\"hello\\\"\" == Err ...\n decodeString bool \"{ \\\"hello\\\": 42 }\" == Err ...\n","type":"Json.Decode.Decoder Basics.Bool"},{"name":"decodeString","comment":" Parse the given string into a JSON value and then run the `Decoder` on it.\nThis will fail if the string is not well-formed JSON or if the `Decoder`\nfails for some reason.\n\n decodeString int \"4\" == Ok 4\n decodeString int \"1 + 2\" == Err ...\n","type":"Json.Decode.Decoder a -> String.String -> Result.Result Json.Decode.Error a"},{"name":"decodeValue","comment":" Run a `Decoder` on some JSON `Value`. You can send these JSON values\nthrough ports, so that is probably the main time you would use this function.\n","type":"Json.Decode.Decoder a -> Json.Decode.Value -> Result.Result Json.Decode.Error a"},{"name":"dict","comment":" Decode a JSON object into an Elm `Dict`.\n\n decodeString (dict int) \"{ \\\"alice\\\": 42, \\\"bob\\\": 99 }\"\n == Ok (Dict.fromList [(\"alice\", 42), (\"bob\", 99)])\n\nIf you need the keys (like `\"alice\"` and `\"bob\"`) available in the `Dict`\nvalues as well, I recommend using a (private) intermediate data structure like\n`Info` in this example:\n\n module User exposing (User, decoder)\n\n import Dict\n import Json.Decode exposing (..)\n\n type alias User =\n { name : String\n , height : Float\n , age : Int\n }\n\n decoder : Decoder (Dict.Dict String User)\n decoder =\n map (Dict.map infoToUser) (dict infoDecoder)\n\n type alias Info =\n { height : Float\n , age : Int\n }\n\n infoDecoder : Decoder Info\n infoDecoder =\n map2 Info\n (field \"height\" float)\n (field \"age\" int)\n\n infoToUser : String -> Info -> User\n infoToUser name { height, age } =\n User name height age\n\nSo now JSON like `{ \"alice\": { height: 1.6, age: 33 }}` are turned into\ndictionary values like `Dict.singleton \"alice\" (User \"alice\" 1.6 33)` if\nyou need that.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Dict.Dict String.String a)"},{"name":"errorToString","comment":" Convert a decoding error into a `String` that is nice for debugging.\n\nIt produces multiple lines of output, so you may want to peek at it with\nsomething like this:\n\n import Html\n import Json.Decode as Decode\n\n errorToHtml : Decode.Error -> Html.Html msg\n errorToHtml error =\n Html.pre [] [ Html.text (Decode.errorToString error) ]\n\n**Note:** It would be cool to do nicer coloring and fancier HTML, but I wanted\nto avoid having an `elm/html` dependency for now. It is totally possible to\ncrawl the `Error` structure and create this separately though!\n","type":"Json.Decode.Error -> String.String"},{"name":"fail","comment":" Ignore the JSON and make the decoder fail. This is handy when used with\n`oneOf` or `andThen` where you want to give a custom error message in some\ncase.\n\nSee the [`andThen`](#andThen) docs for an example.\n","type":"String.String -> Json.Decode.Decoder a"},{"name":"field","comment":" Decode a JSON object, requiring a particular field.\n\n decodeString (field \"x\" int) \"{ \\\"x\\\": 3 }\" == Ok 3\n decodeString (field \"x\" int) \"{ \\\"x\\\": 3, \\\"y\\\": 4 }\" == Ok 3\n decodeString (field \"x\" int) \"{ \\\"x\\\": true }\" == Err ...\n decodeString (field \"x\" int) \"{ \\\"y\\\": 4 }\" == Err ...\n\n decodeString (field \"name\" string) \"{ \\\"name\\\": \\\"tom\\\" }\" == Ok \"tom\"\n\nThe object *can* have other fields. Lots of them! The only thing this decoder\ncares about is if `x` is present and that the value there is an `Int`.\n\nCheck out [`map2`](#map2) to see how to decode multiple fields!\n","type":"String.String -> Json.Decode.Decoder a -> Json.Decode.Decoder a"},{"name":"float","comment":" Decode a JSON number into an Elm `Float`.\n\n decodeString float \"true\" == Err ..\n decodeString float \"42\" == Ok 42\n decodeString float \"3.14\" == Ok 3.14\n decodeString float \"\\\"hello\\\"\" == Err ...\n decodeString float \"{ \\\"hello\\\": 42 }\" == Err ...\n","type":"Json.Decode.Decoder Basics.Float"},{"name":"index","comment":" Decode a JSON array, requiring a particular index.\n\n json = \"\"\"[ \"alice\", \"bob\", \"chuck\" ]\"\"\"\n\n decodeString (index 0 string) json == Ok \"alice\"\n decodeString (index 1 string) json == Ok \"bob\"\n decodeString (index 2 string) json == Ok \"chuck\"\n decodeString (index 3 string) json == Err ...\n","type":"Basics.Int -> Json.Decode.Decoder a -> Json.Decode.Decoder a"},{"name":"int","comment":" Decode a JSON number into an Elm `Int`.\n\n decodeString int \"true\" == Err ...\n decodeString int \"42\" == Ok 42\n decodeString int \"3.14\" == Err ...\n decodeString int \"\\\"hello\\\"\" == Err ...\n decodeString int \"{ \\\"hello\\\": 42 }\" == Err ...\n","type":"Json.Decode.Decoder Basics.Int"},{"name":"keyValuePairs","comment":" Decode a JSON object into an Elm `List` of pairs.\n\n decodeString (keyValuePairs int) \"{ \\\"alice\\\": 42, \\\"bob\\\": 99 }\"\n == Ok [(\"alice\", 42), (\"bob\", 99)]\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (List.List ( String.String, a ))"},{"name":"lazy","comment":" Sometimes you have JSON with recursive structure, like nested comments.\nYou can use `lazy` to make sure your decoder unrolls lazily.\n\n type alias Comment =\n { message : String\n , responses : Responses\n }\n\n type Responses = Responses (List Comment)\n\n comment : Decoder Comment\n comment =\n map2 Comment\n (field \"message\" string)\n (field \"responses\" (map Responses (list (lazy (\\_ -> comment)))))\n\nIf we had said `list comment` instead, we would start expanding the value\ninfinitely. What is a `comment`? It is a decoder for objects where the\n`responses` field contains comments. What is a `comment` though? Etc.\n\nBy using `list (lazy (\\_ -> comment))` we make sure the decoder only expands\nto be as deep as the JSON we are given. You can read more about recursive data\nstructures [here][].\n\n[here]: https://github.com/elm/compiler/blob/master/hints/recursive-alias.md\n","type":"(() -> Json.Decode.Decoder a) -> Json.Decode.Decoder a"},{"name":"list","comment":" Decode a JSON array into an Elm `List`.\n\n decodeString (list int) \"[1,2,3]\" == Ok [1,2,3]\n decodeString (list bool) \"[true,false]\" == Ok [True,False]\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (List.List a)"},{"name":"map","comment":" Transform a decoder. Maybe you just want to know the length of a string:\n\n import String\n\n stringLength : Decoder Int\n stringLength =\n map String.length string\n\nIt is often helpful to use `map` with `oneOf`, like when defining `nullable`:\n\n nullable : Decoder a -> Decoder (Maybe a)\n nullable decoder =\n oneOf\n [ null Nothing\n , map Just decoder\n ]\n","type":"(a -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder value"},{"name":"map2","comment":" Try two decoders and then combine the result. We can use this to decode\nobjects with many fields:\n\n type alias Point = { x : Float, y : Float }\n\n point : Decoder Point\n point =\n map2 Point\n (field \"x\" float)\n (field \"y\" float)\n\n -- decodeString point \"\"\"{ \"x\": 3, \"y\": 4 }\"\"\" == Ok { x = 3, y = 4 }\n\nIt tries each individual decoder and puts the result together with the `Point`\nconstructor.\n","type":"(a -> b -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder value"},{"name":"map3","comment":" Try three decoders and then combine the result. We can use this to decode\nobjects with many fields:\n\n type alias Person = { name : String, age : Int, height : Float }\n\n person : Decoder Person\n person =\n map3 Person\n (at [\"name\"] string)\n (at [\"info\",\"age\"] int)\n (at [\"info\",\"height\"] float)\n\n -- json = \"\"\"{ \"name\": \"tom\", \"info\": { \"age\": 42, \"height\": 1.8 } }\"\"\"\n -- decodeString person json == Ok { name = \"tom\", age = 42, height = 1.8 }\n\nLike `map2` it tries each decoder in order and then give the results to the\n`Person` constructor. That can be any function though!\n","type":"(a -> b -> c -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder value"},{"name":"map4","comment":"","type":"(a -> b -> c -> d -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder d -> Json.Decode.Decoder value"},{"name":"map5","comment":"","type":"(a -> b -> c -> d -> e -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder d -> Json.Decode.Decoder e -> Json.Decode.Decoder value"},{"name":"map6","comment":"","type":"(a -> b -> c -> d -> e -> f -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder d -> Json.Decode.Decoder e -> Json.Decode.Decoder f -> Json.Decode.Decoder value"},{"name":"map7","comment":"","type":"(a -> b -> c -> d -> e -> f -> g -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder d -> Json.Decode.Decoder e -> Json.Decode.Decoder f -> Json.Decode.Decoder g -> Json.Decode.Decoder value"},{"name":"map8","comment":"","type":"(a -> b -> c -> d -> e -> f -> g -> h -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder b -> Json.Decode.Decoder c -> Json.Decode.Decoder d -> Json.Decode.Decoder e -> Json.Decode.Decoder f -> Json.Decode.Decoder g -> Json.Decode.Decoder h -> Json.Decode.Decoder value"},{"name":"maybe","comment":" Helpful for dealing with optional fields. Here are a few slightly different\nexamples:\n\n json = \"\"\"{ \"name\": \"tom\", \"age\": 42 }\"\"\"\n\n decodeString (maybe (field \"age\" int )) json == Ok (Just 42)\n decodeString (maybe (field \"name\" int )) json == Ok Nothing\n decodeString (maybe (field \"height\" float)) json == Ok Nothing\n\n decodeString (field \"age\" (maybe int )) json == Ok (Just 42)\n decodeString (field \"name\" (maybe int )) json == Ok Nothing\n decodeString (field \"height\" (maybe float)) json == Err ...\n\nNotice the last example! It is saying we *must* have a field named `height` and\nthe content *may* be a float. There is no `height` field, so the decoder fails.\n\nPoint is, `maybe` will make exactly what it contains conditional. For optional\nfields, this means you probably want it *outside* a use of `field` or `at`.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Maybe.Maybe a)"},{"name":"null","comment":" Decode a `null` value into some Elm value.\n\n decodeString (null False) \"null\" == Ok False\n decodeString (null 42) \"null\" == Ok 42\n decodeString (null 42) \"42\" == Err ..\n decodeString (null 42) \"false\" == Err ..\n\nSo if you ever see a `null`, this will return whatever value you specified.\n","type":"a -> Json.Decode.Decoder a"},{"name":"nullable","comment":" Decode a nullable JSON value into an Elm value.\n\n decodeString (nullable int) \"13\" == Ok (Just 13)\n decodeString (nullable int) \"42\" == Ok (Just 42)\n decodeString (nullable int) \"null\" == Ok Nothing\n decodeString (nullable int) \"true\" == Err ..\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Maybe.Maybe a)"},{"name":"oneOf","comment":" Try a bunch of different decoders. This can be useful if the JSON may come\nin a couple different formats. For example, say you want to read an array of\nnumbers, but some of them are `null`.\n\n import String\n\n badInt : Decoder Int\n badInt =\n oneOf [ int, null 0 ]\n\n -- decodeString (list badInt) \"[1,2,null,4]\" == Ok [1,2,0,4]\n\nWhy would someone generate JSON like this? Questions like this are not good\nfor your health. The point is that you can use `oneOf` to handle situations\nlike this!\n\nYou could also use `oneOf` to help version your data. Try the latest format,\nthen a few older ones that you still support. You could use `andThen` to be\neven more particular if you wanted.\n","type":"List.List (Json.Decode.Decoder a) -> Json.Decode.Decoder a"},{"name":"oneOrMore","comment":" Decode a JSON array that has one or more elements. This comes up if you\nwant to enable drag-and-drop of files into your application. You would pair\nthis function with [`elm/file`]() to write a `dropDecoder` like this:\n\n import File exposing (File)\n import Json.Decoder as D\n\n type Msg\n = GotFiles File (List Files)\n\n inputDecoder : D.Decoder Msg\n inputDecoder =\n D.at [\"dataTransfer\",\"files\"] (D.oneOrMore GotFiles File.decoder)\n\nThis captures the fact that you can never drag-and-drop zero files.\n","type":"(a -> List.List a -> value) -> Json.Decode.Decoder a -> Json.Decode.Decoder value"},{"name":"string","comment":" Decode a JSON string into an Elm `String`.\n\n decodeString string \"true\" == Err ...\n decodeString string \"42\" == Err ...\n decodeString string \"3.14\" == Err ...\n decodeString string \"\\\"hello\\\"\" == Ok \"hello\"\n decodeString string \"{ \\\"hello\\\": 42 }\" == Err ...\n","type":"Json.Decode.Decoder String.String"},{"name":"succeed","comment":" Ignore the JSON and produce a certain Elm value.\n\n decodeString (succeed 42) \"true\" == Ok 42\n decodeString (succeed 42) \"[1,2,3]\" == Ok 42\n decodeString (succeed 42) \"hello\" == Err ... -- this is not a valid JSON string\n\nThis is handy when used with `oneOf` or `andThen`.\n","type":"a -> Json.Decode.Decoder a"},{"name":"value","comment":" Do not do anything with a JSON value, just bring it into Elm as a `Value`.\nThis can be useful if you have particularly complex data that you would like to\ndeal with later. Or if you are going to send it out a port and do not care\nabout its structure.\n","type":"Json.Decode.Decoder Json.Decode.Value"}],"binops":[]},{"name":"Json.Encode","comment":" Library for turning Elm values into Json values.\n\n# Encoding\n@docs encode, Value\n\n# Primitives\n@docs string, int, float, bool, null\n\n# Arrays\n@docs list, array, set\n\n# Objects\n@docs object, dict\n","unions":[{"name":"Value","comment":" Represents a JavaScript value.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"array","comment":" Turn an `Array` into a JSON array.\n","type":"(a -> Json.Encode.Value) -> Array.Array a -> Json.Encode.Value"},{"name":"bool","comment":" Turn a `Bool` into a JSON boolean.\n\n import Json.Encode exposing (encode, bool)\n\n -- encode 0 (bool True) == \"true\"\n -- encode 0 (bool False) == \"false\"\n","type":"Basics.Bool -> Json.Encode.Value"},{"name":"dict","comment":" Turn a `Dict` into a JSON object.\n\n import Dict exposing (Dict)\n import Json.Encode as Encode\n\n people : Dict String Int\n people =\n Dict.fromList [ (\"Tom\",42), (\"Sue\", 38) ]\n\n -- Encode.encode 0 (Encode.dict identity Encode.int people)\n -- == \"\"\"{\"Tom\":42,\"Sue\":38}\"\"\"\n","type":"(k -> String.String) -> (v -> Json.Encode.Value) -> Dict.Dict k v -> Json.Encode.Value"},{"name":"encode","comment":" Convert a `Value` into a prettified string. The first argument specifies\nthe amount of indentation in the resulting string.\n\n import Json.Encode as Encode\n\n tom : Encode.Value\n tom =\n Encode.object\n [ ( \"name\", Encode.string \"Tom\" )\n , ( \"age\", Encode.int 42 )\n ]\n\n compact = Encode.encode 0 tom\n -- {\"name\":\"Tom\",\"age\":42}\n\n readable = Encode.encode 4 tom\n -- {\n -- \"name\": \"Tom\",\n -- \"age\": 42\n -- }\n","type":"Basics.Int -> Json.Encode.Value -> String.String"},{"name":"float","comment":" Turn a `Float` into a JSON number.\n\n import Json.Encode exposing (encode, float)\n\n -- encode 0 (float 3.14) == \"3.14\"\n -- encode 0 (float 1.618) == \"1.618\"\n -- encode 0 (float -42) == \"-42\"\n -- encode 0 (float NaN) == \"null\"\n -- encode 0 (float Infinity) == \"null\"\n\n**Note:** Floating point numbers are defined in the [IEEE 754 standard][ieee]\nwhich is hardcoded into almost all CPUs. This standard allows `Infinity` and\n`NaN`. [The JSON spec][json] does not include these values, so we encode them\nboth as `null`.\n\n[ieee]: https://en.wikipedia.org/wiki/IEEE_754\n[json]: https://www.json.org/\n","type":"Basics.Float -> Json.Encode.Value"},{"name":"int","comment":" Turn an `Int` into a JSON number.\n\n import Json.Encode exposing (encode, int)\n\n -- encode 0 (int 42) == \"42\"\n -- encode 0 (int -7) == \"-7\"\n -- encode 0 (int 0) == \"0\"\n","type":"Basics.Int -> Json.Encode.Value"},{"name":"list","comment":" Turn a `List` into a JSON array.\n\n import Json.Encode as Encode exposing (bool, encode, int, list, string)\n\n -- encode 0 (list int [1,3,4]) == \"[1,3,4]\"\n -- encode 0 (list bool [True,False]) == \"[true,false]\"\n -- encode 0 (list string [\"a\",\"b\"]) == \"\"\"[\"a\",\"b\"]\"\"\"\n\n","type":"(a -> Json.Encode.Value) -> List.List a -> Json.Encode.Value"},{"name":"null","comment":" Create a JSON `null` value.\n\n import Json.Encode exposing (encode, null)\n\n -- encode 0 null == \"null\"\n","type":"Json.Encode.Value"},{"name":"object","comment":" Create a JSON object.\n\n import Json.Encode as Encode\n\n tom : Encode.Value\n tom =\n Encode.object\n [ ( \"name\", Encode.string \"Tom\" )\n , ( \"age\", Encode.int 42 )\n ]\n\n -- Encode.encode 0 tom == \"\"\"{\"name\":\"Tom\",\"age\":42}\"\"\"\n","type":"List.List ( String.String, Json.Encode.Value ) -> Json.Encode.Value"},{"name":"set","comment":" Turn an `Set` into a JSON array.\n","type":"(a -> Json.Encode.Value) -> Set.Set a -> Json.Encode.Value"},{"name":"string","comment":" Turn a `String` into a JSON string.\n\n import Json.Encode exposing (encode, string)\n\n -- encode 0 (string \"\") == \"\\\"\\\"\"\n -- encode 0 (string \"abc\") == \"\\\"abc\\\"\"\n -- encode 0 (string \"hello\") == \"\\\"hello\\\"\"\n","type":"String.String -> Json.Encode.Value"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2018-present, 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.
@@ -1,46 +0,0 @@
1
- # Randomness
2
-
3
- Need to generate random numbers? How about random game boards? Or random positions in 3D space? This is the package for you!
4
-
5
-
6
- ## Example
7
-
8
- This package will help you build a random `Generator` like this:
9
-
10
- ```elm
11
- import Random
12
-
13
- probability : Random.Generator Float
14
- probability =
15
- Random.float 0 1
16
-
17
- roll : Random.Generator Int
18
- roll =
19
- Random.int 1 6
20
-
21
- usuallyTrue : Random.Generator Bool
22
- usuallyTrue =
23
- Random.weighted (80, True) [ (20, False) ]
24
- ```
25
-
26
- In each of these defines _how_ to generate random values. The most interesting case is `usuallyTrue` which generates `True` 80% of the time and `False` 20% of the time!
27
-
28
- Now look at this [working example](https://elm-lang.org/examples/random) to see a `Generator` used in an application.
29
-
30
-
31
- ## Mindset Shift
32
-
33
- If you are coming from JavaScript, this package is usually quite surprising at first. Why not just call `Math.random()` and get random floats whenever you want? Well, all Elm functions have this “same input, same output” guarantee. That is part of what makes Elm so reliable and easy to test! But if we could generate random values anytime we want, we would have to throw that guarantee out.
34
-
35
- So instead, we create a `Generator` and hand it to the Elm runtime system to do the dirty work of generating values. We get to keep our guarantees _and_ we get random values. Great! And once people become familiar with generators, they often report that it is _easier_ than the traditional imperative APIs for most cases. For example, jump to the docs for [`Random.map4`](Random#map4) for an example of generating random [quadtrees](https://en.wikipedia.org/wiki/Quadtree) and think about what it would look like to do that in JavaScript!
36
-
37
- Point is, this library takes some learning, but we really think it is worth it. So hang in there, and do not hesitate to ask for help on [Slack](https://elmlang.herokuapp.com/) or [Discourse](https://discourse.elm-lang.org/)!
38
-
39
-
40
- ## Future Plans
41
-
42
- There are a ton of useful helper functions in the [`elm-community/random-extra`][extra] package. Do you need random `String` values? Random dictionaries? Etc.
43
-
44
- We will probably do an API review and merge the results into this package someday. Not sure when, but it would be kind of nice to have it all in one place. But in the meantime, just do `elm install elm-community/random-extra` if you need stuff from there!
45
-
46
- [extra]: /packages/elm-community/random-extra/latest
@@ -1 +0,0 @@
1
- [{"name":"Random","comment":" This library helps you generate pseudo-random values.\n\nIt is an implementation of [Permuted Congruential Generators][pcg]\nby M. E. O'Neil. It is not cryptographically secure.\n\n[extra]: /packages/elm-community/random-extra/latest\n[pcg]: http://www.pcg-random.org/\n\n\n# Generators\n@docs Generator, generate\n\n# Primitives\n@docs int, float, uniform, weighted, constant\n\n# Data Structures\n@docs pair, list\n\n# Mapping\n@docs map, map2, map3, map4, map5\n\n# Fancy Stuff\n@docs andThen, lazy\n\n# Constants\n@docs maxInt, minInt\n\n# Generate Values Manually\n@docs Seed, step, initialSeed, independentSeed\n\n","unions":[{"name":"Generator","comment":" A `Generator` is a **recipe** for generating random values. For example,\nhere is a generator for numbers between 1 and 10 inclusive:\n\n import Random\n\n oneToTen : Random.Generator Int\n oneToTen =\n Random.int 1 10\n\nNotice that we are not actually generating any numbers yet! We are describing\nwhat kind of values we want. To actually get random values, you create a\ncommand with the [`generate`](#generate) function:\n\n type Msg = NewNumber Int\n\n newNumber : Cmd Msg\n newNumber =\n Random.generate NewNumber oneToTen\n\nEach time you run this command, it runs the `oneToTen` generator and produces\nrandom integers between one and ten.\n\n**Note 1:** If you are not familiar with commands yet, start working through\n[guide.elm-lang.org][guide]. It builds up to an example that generates\nrandom numbers. Commands are one of the core concepts in Elm, and it will\nbe faster overall to invest in understanding them _now_ rather than copy/pasting\nyour way to frustration! And if you feel stuck on something, definitely ask\nabout it in [the Elm slack][slack]. Folks are happy to help!\n\n**Note 2:** The random `Generator` API is quite similar to the JSON `Decoder` API.\nBoth are building blocks that snap together with `map`, `map2`, etc. You can read\nmore about JSON decoders [here][json] to see the similarity.\n\n[guide]: https://guide.elm-lang.org/\n[slack]: https://elmlang.herokuapp.com/\n[json]: https://guide.elm-lang.org/interop/json.html\n","args":["a"],"cases":[]},{"name":"Seed","comment":" Maybe you do not want to use [`generate`](#generate) for some reason? Maybe\nyou need to be able to exactly reproduce a sequence of random values?\n\nIn that case, you can work with a `Seed` of randomness and [`step`](#step) it\nforward by hand.\n","args":[],"cases":[]}],"aliases":[],"values":[{"name":"andThen","comment":" Generate fancy random values.\n\nWe have seen examples of how `andThen` can be used to generate variable length\nlists in the [`list`](#list) and [`map2`](#map2) docs. We saw how it could help\ngenerate a quadtree in the [`map4`](#map4) docs.\n\nAnything you could ever want can be defined using this operator! As one last\nexample, here is how you can define `map` using `andThen`:\n\n import Random\n\n map : (a -> b) -> Random.Generator a -> Random.Generator b\n map func generator =\n generator\n |> Random.andThen (\\value -> Random.constant (func value))\n\nThe `andThen` function gets used a lot in [`elm-community/random-extra`][extra],\nso it may be helpful to look through the implementation there for more examples.\n\n[extra]: /packages/elm-community/random-extra/latest\n","type":"(a -> Random.Generator b) -> Random.Generator a -> Random.Generator b"},{"name":"constant","comment":" Generate the same value every time.\n\n import Random\n\n alwaysFour : Random.Generator Int\n alwaysFour =\n Random.constant 4\n\nThink of it as picking from a hat with only one thing in it. It is weird,\nbut it can be useful with [`elm-community/random-extra`][extra] which has\ntons of nice helpers.\n\n[extra]: /packages/elm-community/random-extra/latest\n","type":"a -> Random.Generator a"},{"name":"float","comment":" Generate floats in a given range.\n\n import Random\n\n probability : Random.Generator Float\n probability =\n Random.float 0 1\n\nThe `probability` generator will produce values between zero and one with\na uniform distribution. Say it produces a value `p`. We can then check if\n`p < 0.4` if we want something to happen 40% of the time.\n\nThis becomes very powerful when paired with functions like [`map`](#map) and\n[`andThen`](#andThen). Rather than dealing with twenty random float messages\nin your `update`, you can build up sophisticated logic in the `Generator`\nitself!\n","type":"Basics.Float -> Basics.Float -> Random.Generator Basics.Float"},{"name":"generate","comment":" Create a command that produces random values. Say you want to generate\nrandom points:\n\n import Random\n\n point : Random.Generator (Int, Int)\n point =\n Random.pair (Random.int -100 100) (Random.int -100 100)\n\n type Msg = NewPoint (Int, Int)\n\n newPoint : Cmd Msg\n newPoint =\n Random.generate NewPoint point\n\nEach time you run the `newPoint` command, it will produce a new 2D point like\n`(57, 18)` or `(-82, 6)`.\n\n**Note:** Read through [guide.elm-lang.org][guide] to learn how commands work.\nIf you are coming from JS it can be hopelessly frustrating if you just try to\nwing it. And definitely ask around on Slack if you feel stuck! Investing in\nunderstanding generators is really worth it, and once it clicks, folks often\ndread going back to `Math.random()` in JavaScript.\n\n[guide]: https://guide.elm-lang.org/\n","type":"(a -> msg) -> Random.Generator a -> Platform.Cmd.Cmd msg"},{"name":"independentSeed","comment":" A generator that produces a seed that is independent of any other seed in\nthe program. These seeds will generate their own unique sequences of random\nvalues. They are useful when you need an unknown amount of randomness *later*\nbut can request only a fixed amount of randomness *now*.\n\nThe independent seeds are extremely likely to be distinct for all practical\npurposes. However, it is not proven that there are no pathological cases.\n","type":"Random.Generator Random.Seed"},{"name":"initialSeed","comment":" Create a `Seed` for _reproducable_ randomness.\n\n import Random\n\n seed0 : Random.Seed\n seed0 =\n Random.initialSeed 42\n\nIf you hard-code your `Seed` like this, every run will be the same. This can\nbe useful if you are testing a game with randomness and want it to be easy to\nreproduce past games.\n\nIn practice, you may want to get the initial seed by (1) sending it to Elm\nthrough flags or (2) using `Time.now` to get a number that the user has not\nseen before. (Flags are described on [this page][flags].)\n\n[flags]: https://guide.elm-lang.org/interop/javascript.html\n","type":"Basics.Int -> Random.Seed"},{"name":"int","comment":" Generate 32-bit integers in a given range.\n\n import Random\n\n singleDigit : Random.Generator Int\n singleDigit =\n Random.int 0 9\n\n closeToZero : Random.Generator Int\n closeToZero =\n Random.int -5 5\n\n anyInt : Random.Generator Int\n anyInt =\n Random.int Random.minInt Random.maxInt\n\nThis generator *can* produce values outside of the range [[`minInt`](#minInt),\n[`maxInt`](#maxInt)] but sufficient randomness is not guaranteed.\n","type":"Basics.Int -> Basics.Int -> Random.Generator Basics.Int"},{"name":"lazy","comment":" Helper for defining self-recursive generators. Say we want to generate a\nrandom number of probabilities:\n\n import Random\n\n probabilities : Random.Generator (List Float)\n probabilities =\n Random.andThen identity <|\n Random.uniform\n [ Random.constant []\n , Random.map2 (::)\n (Random.float 0 1)\n (Random.lazy (\\_ -> probabilities))\n ]\n\nIn 50% of cases we end the list. In 50% of cases we generate a probability and\nadd it onto a random number of probabilities. The `lazy` call is crucial\nbecause it means we do not unroll the generator unless we need to.\n\nThis is a pretty subtle issue, so I recommend reading more about it\n[here](https://elm-lang.org/hints/0.19.0/bad-recursion)!\n\n**Note:** You can delay evaluation with `andThen` too. The thing that matters\nis that you have a function call that delays the creation of the generator!\n","type":"(() -> Random.Generator a) -> Random.Generator a"},{"name":"list","comment":" Generate a list of random values.\n\n import Random\n\n tenFractions : Random.Generator (List Float)\n tenFractions =\n Random.list 10 (Random.float 0 1)\n\n fiveGrades : Random.Generator (List Int)\n fiveGrades =\n Random.list 5 (int 0 100)\n\nIf you want to generate a list with a random length, you need to use\n[`andThen`](#andThen) like this:\n\n fiveToTenDigits : Random.Generator (List Int)\n fiveToTenDigits =\n Random.int 5 10\n |> Random.andThen (\\len -> Random.list len (Random.int 0 9))\n\nThis generator gets a random integer between five and ten **and then**\nuses that to generate a random list of digits.\n","type":"Basics.Int -> Random.Generator a -> Random.Generator (List.List a)"},{"name":"map","comment":" Transform the values produced by a generator. For example, we can\ngenerate random boolean values:\n\n import Random\n\n bool : Random.Generator Bool\n bool =\n Random.map (\\n -> n < 20) (Random.int 1 100)\n\nThe `bool` generator first picks a number between 1 and 100. From there\nit checks if the number is less than twenty. So the resulting `Bool` will\nbe `True` about 20% of the time.\n\nYou could also do this for lower case ASCII letters:\n\n letter : Random.Generator Char\n letter =\n Random.map (\\n -> Char.fromCode (n + 97)) (Random.int 0 25)\n\nThe `letter` generator first picks a number between 0 and 25 inclusive.\nIt then uses `Char.fromCode` to turn [ASCII codes][ascii] into `Char` values.\n\n**Note:** Instead of making these yourself, always check if the\n[`random-extra`][extra] package has what you need!\n\n[ascii]: https://en.wikipedia.org/wiki/ASCII#Printable_characters\n[extra]: /packages/elm-community/random-extra/latest\n","type":"(a -> b) -> Random.Generator a -> Random.Generator b"},{"name":"map2","comment":" Combine two generators. Maybe we have a space invaders game and want to\ngenerate enemy ships with a random location:\n\n import Random\n\n type alias Enemy\n { health : Float\n , rotation : Float\n , x : Float\n , y : Float\n }\n\n enemy : Random.Generator Enemy\n enemy =\n Random.map2\n (\\x y -> Enemy 100 0 x y)\n (Random.float 0 100)\n (Random.float 0 100)\n\nNow whenever we run the `enemy` generator we get an enemy with full health,\nno rotation, and a random position! Now say we want to start with between\nfive and ten enemies on screen:\n\n initialEnemies : Random.Generator (List Enemy)\n initialEnemies =\n Random.int 5 10\n |> Random.andThen (\\num -> Random.list num enemy)\n\nWe will generate a number between five and ten, **and then** generate\nthat number of enimies!\n\n**Note:** Snapping generators together like this is very important! Always\nstart by with generators for each `type` you need, and then snap them\ntogether.\n","type":"(a -> b -> c) -> Random.Generator a -> Random.Generator b -> Random.Generator c"},{"name":"map3","comment":" Combine three generators. Maybe you want to make a simple slot machine?\n\n import Random\n\n type alias Spin =\n { one : Symbol\n , two : Symbol\n , three : Symbol\n }\n\n type Symbol = Cherry | Seven | Bar | Grapes\n\n spin : Random.Generator Spin\n spin =\n Random.map3 Spin symbol symbol symbol\n\n symbol : Random.Generator Symbol\n symbol =\n Random.uniform Cherry [ Seven, Bar, Grapes ]\n\n**Note:** Always start with the types. Make a generator for each thing you need\nand then put them all together with one of these `map` functions.\n","type":"(a -> b -> c -> d) -> Random.Generator a -> Random.Generator b -> Random.Generator c -> Random.Generator d"},{"name":"map4","comment":" Combine four generators.\n\nSay you are making game and want to place enemies or terrain randomly. You\n_could_ generate a [quadtree](https://en.wikipedia.org/wiki/Quadtree)!\n\n import Random\n\n type QuadTree a\n = Empty\n | Leaf a\n | Node (QuadTree a) (QuadTree a) (QuadTree a) (QuadTree a)\n\n quadTree : Random.Generator a -> Random.Generator (QuadTree a)\n quadTree leafGen =\n let\n subQuads =\n Random.lazy (\\_ -> quadTree leafGen)\n in\n Random.andThen identity <|\n Random.uniform\n (Random.constant Empty)\n [ Random.map Leaf leafGen\n , Random.map4 Node subQuad subQuad subQuad subQuad\n ]\n\nWe start by creating a `QuadTree` type where each quadrant is either `Empty`, a\n`Leaf` containing something interesting, or a `Node` with four sub-quadrants.\n\nNext the `quadTree` definition describes how to generate these values. A third\nof a time you get an `Empty` tree. A third of the time you get a `Leaf` with\nsome interesting value. And a third of the time you get a `Node` full of more\n`QuadTree` values. How are those subtrees generated though? Well, we use our\n`quadTree` generator!\n\n**Exercises:** Can `quadTree` generate infinite `QuadTree` values? Is there\nsome way to limit the depth of the `QuadTree`? Can you render the `QuadTree`\nto HTML using absolute positions and fractional dimensions? Can you render\nthe `QuadTree` to SVG?\n\n**Note:** Check out the docs for [`lazy`](#lazy) to learn why that is needed\nto define a recursive `Generator` like this one.\n","type":"(a -> b -> c -> d -> e) -> Random.Generator a -> Random.Generator b -> Random.Generator c -> Random.Generator d -> Random.Generator e"},{"name":"map5","comment":" Combine five generators.\n\nIf you need to combine more things, you can always do it by chaining\n[`andThen`](#andThen). There are also some additional helpers for this\nin [`elm-community/random-extra`][extra].\n\n[extra]: /packages/elm-community/random-extra/latest\n","type":"(a -> b -> c -> d -> e -> f) -> Random.Generator a -> Random.Generator b -> Random.Generator c -> Random.Generator d -> Random.Generator e -> Random.Generator f"},{"name":"maxInt","comment":" The underlying algorithm works well in a specific range of integers.\nIt can generate values outside of that range, but they are “not as random”.\n\nThe `maxInt` that works well is `2147483647`.\n","type":"Basics.Int"},{"name":"minInt","comment":" The underlying algorithm works well in a specific range of integers.\nIt can generate values outside of that range, but they are “not as random”.\n\nThe `minInt` that works well is `-2147483648`.\n","type":"Basics.Int"},{"name":"pair","comment":" Generate a pair of random values. A common use of this might be to generate\na point in a certain 2D space:\n\n import Random\n\n randomPoint : Random.Generator (Float, Float)\n randomPoint =\n Random.pair (Random.float -200 200) (Random.float -100 100)\n\nMaybe you are doing an animation with SVG and want to randomly generate some\nentities?\n","type":"Random.Generator a -> Random.Generator b -> Random.Generator ( a, b )"},{"name":"step","comment":" So you need _reproducable_ randomness for some reason.\n\nThis `step` function lets you use a `Generator` without commands. It is a\nnormal Elm function. Same input, same output! So to get a 3D point you could\nsay:\n\n import Random\n\n type alias Point3D = { x : Float, y : Float, z : Float }\n\n point3D : Random.Seed -> (Point3D, Random.Seed)\n point3D seed0 =\n let\n (x, seed1) = Random.step (Random.int 0 100) seed0\n (y, seed2) = Random.step (Random.int 0 100) seed1\n (z, seed3) = Random.step (Random.int 0 100) seed2\n in\n ( Point3D x y z, seed3 )\n\nNotice that we use different seeds on each line! If we instead used `seed0`\nfor everything, the `x`, `y`, and `z` values would always be exactly the same!\nSame input, same output!\n\nThreading seeds around is not super fun, so if you really need this, it is\nbest to build your `Generator` like normal and then just `step` it all at\nonce at the top of your program.\n","type":"Random.Generator a -> Random.Seed -> ( a, Random.Seed )"},{"name":"uniform","comment":" Generate values with equal probability. Say we want a random suit for some\ncards:\n\n import Random\n\n type Suit = Diamond | Club | Heart | Spade\n\n suit : Random.Generator Suit\n suit =\n Random.uniform Diamond [ Club, Heart, Spade ]\n\nThat generator produces all `Suit` values with equal probability, 25% each.\n\n**Note:** Why not have `uniform : List a -> Generator a` as the API? It looks\na little prettier in code, but it leads to an awkward question. What do you do\nwith `uniform []`? How can it produce an `Int` or `Float`? The current API\nguarantees that we always have *at least* one value, so we never run into that\nquestion!\n","type":"a -> List.List a -> Random.Generator a"},{"name":"weighted","comment":" Generate values with a _weighted_ probability. Say we want to simulate a\n[loaded die](https://en.wikipedia.org/wiki/Dice#Loaded_dice) that lands\non ⚄ and ⚅ more often than the other faces:\n\n import Random\n\n type Face = One | Two | Three | Four | Five | Six\n\n roll : Random.Generator Face\n roll =\n Random.weighted\n (10, One)\n [ (10, Two)\n , (10, Three)\n , (10, Four)\n , (20, Five)\n , (40, Six)\n ]\n\nSo there is a 40% chance of getting `Six`, a 20% chance of getting `Five`, and\nthen a 10% chance for each of the remaining faces.\n\n**Note:** I made the weights add up to 100, but that is not necessary. I always\nadd up your weights into a `total`, and from there, the probablity of each case\nis `weight / total`. Negative weights do not really make sense, so I just flip\nthem to be positive.\n","type":"( Basics.Float, a ) -> List.List ( Basics.Float, a ) -> Random.Generator a"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2017-present, 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.