git.iko.soy/rowtype-yoga/purescript-yoga-currency
on main help sign in
Initial: Currency ADT (ISO 4217) with BoundedEnum, Intl sync tests
commitb33eabf78093475ddfd36c2135d2a1e004319e18 authorMark <mark.eibes@gmail.com> dateMon 2 Mar 2026, 20:47 (7 months ago)
8 files changed+3244
.gitignore+4 codegen.mjs+93 package.json+1 spago.lock+1876 spago.yaml+23 src/Data/Currency.purs+1187 test/Test/Main.js+1 test/Test/Main.purs+59
.gitignorenew file+4
@@ -0,0 +1,4 @@
1+output/
2+.spago/
3+node_modules/
4+.psci_modules/
codegen.mjsnew file+93
@@ -0,0 +1,93 @@
1+// Generates src/Data/Currency.purs from Intl.supportedValuesOf('currency')
2+
3+const currencies = Intl.supportedValuesOf("currency").sort()
4+const n = currencies.length
5+const lines = []
6+
7+lines.push(`module Data.Currency where`)
8+lines.push(``)
9+lines.push(`import Prelude`)
10+lines.push(``)
11+lines.push(`import Control.Monad.Except (throwError)`)
12+lines.push(`import Data.Enum (class Enum, class BoundedEnum, Cardinality(..), enumFromTo)`)
13+lines.push(`import Data.Maybe (Maybe(..))`)
14+lines.push(`import Foreign (ForeignError(..))`)
15+lines.push(`import Yoga.JSON (class ReadForeign, class WriteForeign, readImpl, writeImpl)`)
16+lines.push(``)
17+
18+// ADT
19+lines.push(`data Currency`)
20+currencies.forEach((c, i) => {
21+ const prefix = i === 0 ? " = " : " | "
22+ lines.push(`${prefix}${c}`)
23+})
24+lines.push(``)
25+lines.push(`derive instance Eq Currency`)
26+lines.push(`derive instance Ord Currency`)
27+lines.push(``)
28+lines.push(`instance Show Currency where`)
29+lines.push(` show = toString`)
30+lines.push(``)
31+
32+// Bounded
33+lines.push(`instance Bounded Currency where`)
34+lines.push(` bottom = ${currencies[0]}`)
35+lines.push(` top = ${currencies[n - 1]}`)
36+lines.push(``)
37+
38+// Enum
39+lines.push(`instance Enum Currency where`)
40+lines.push(` succ = case _ of`)
41+currencies.forEach((c, i) => {
42+ if (i < n - 1) lines.push(` ${c} -> Just ${currencies[i + 1]}`)
43+ else lines.push(` ${c} -> Nothing`)
44+})
45+lines.push(` pred = case _ of`)
46+currencies.forEach((c, i) => {
47+ if (i === 0) lines.push(` ${c} -> Nothing`)
48+ else lines.push(` ${c} -> Just ${currencies[i - 1]}`)
49+})
50+lines.push(``)
51+
52+// BoundedEnum
53+lines.push(`instance BoundedEnum Currency where`)
54+lines.push(` cardinality = Cardinality ${n}`)
55+lines.push(` toEnum = case _ of`)
56+currencies.forEach((c, i) => lines.push(` ${i} -> Just ${c}`))
57+lines.push(` _ -> Nothing`)
58+lines.push(` fromEnum = case _ of`)
59+currencies.forEach((c, i) => lines.push(` ${c} -> ${i}`))
60+lines.push(``)
61+
62+// toString
63+lines.push(`toString :: Currency -> String`)
64+lines.push(`toString = case _ of`)
65+currencies.forEach(c => lines.push(` ${c} -> "${c}"`))
66+lines.push(``)
67+
68+// fromString
69+lines.push(`fromString :: String -> Maybe Currency`)
70+lines.push(`fromString = case _ of`)
71+currencies.forEach(c => lines.push(` "${c}" -> Just ${c}`))
72+lines.push(` _ -> Nothing`)
73+lines.push(``)
74+
75+// allCurrencies
76+lines.push(`allCurrencies :: Array Currency`)
77+lines.push(`allCurrencies = enumFromTo bottom top`)
78+lines.push(``)
79+
80+// ReadForeign / WriteForeign
81+lines.push(`instance WriteForeign Currency where`)
82+lines.push(` writeImpl = toString >>> writeImpl`)
83+lines.push(``)
84+lines.push(`instance ReadForeign Currency where`)
85+lines.push(` readImpl f = do`)
86+lines.push(` let parse s = case fromString s of`)
87+lines.push(` Just c -> pure c`)
88+lines.push(` Nothing -> throwError $ pure $ ForeignError $ "Unknown currency: " <> s`)
89+lines.push(` s <- readImpl f`)
90+lines.push(` parse s`)
91+lines.push(``)
92+
93+process.stdout.write(lines.join("\n") + "\n")
package.jsonnew file+1
@@ -0,0 +1 @@
1+{"dependencies": {}}
spago.locknew file+1876
@@ -0,0 +1,1876 @@
1+{
2+ "workspace": {
3+ "packages": {
4+ "iso4217": {
5+ "path": "./",
6+ "core": {
7+ "dependencies": [
8+ "control",
9+ "enums",
10+ "foreign",
11+ "maybe",
12+ "prelude",
13+ "yoga-json"
14+ ],
15+ "build_plan": [
16+ "arrays",
17+ "bifunctors",
18+ "catenable-lists",
19+ "const",
20+ "contravariant",
21+ "control",
22+ "datetime",
23+ "distributive",
24+ "effect",
25+ "either",
26+ "enums",
27+ "exceptions",
28+ "exists",
29+ "foldable-traversable",
30+ "foreign",
31+ "foreign-object",
32+ "free",
33+ "functions",
34+ "functors",
35+ "gen",
36+ "identity",
37+ "integers",
38+ "invariant",
39+ "js-bigints",
40+ "js-date",
41+ "lazy",
42+ "lists",
43+ "maybe",
44+ "newtype",
45+ "nonempty",
46+ "nullable",
47+ "numbers",
48+ "ordered-collections",
49+ "orders",
50+ "partial",
51+ "prelude",
52+ "profunctor",
53+ "record",
54+ "refs",
55+ "safe-coerce",
56+ "st",
57+ "strings",
58+ "tailrec",
59+ "transformers",
60+ "tuples",
61+ "type-equality",
62+ "typelevel-prelude",
63+ "unfoldable",
64+ "unsafe-coerce",
65+ "variant",
66+ "yoga-json",
67+ "yoga-tree"
68+ ]
69+ },
70+ "test": {
71+ "dependencies": [
72+ "aff",
73+ "arrays",
74+ "foldable-traversable",
75+ "quickcheck",
76+ "spec",
77+ "spec-discovery",
78+ "spec-quickcheck"
79+ ],
80+ "build_plan": [
81+ "aff",
82+ "ansi",
83+ "argonaut-codecs",
84+ "argonaut-core",
85+ "arraybuffer-types",
86+ "arrays",
87+ "avar",
88+ "bifunctors",
89+ "catenable-lists",
90+ "console",
91+ "const",
92+ "contravariant",
93+ "control",
94+ "datetime",
95+ "distributive",
96+ "effect",
97+ "either",
98+ "enums",
99+ "exceptions",
100+ "exists",
101+ "exitcodes",
102+ "foldable-traversable",
103+ "foreign",
104+ "foreign-object",
105+ "fork",
106+ "free",
107+ "functions",
108+ "functors",
109+ "gen",
110+ "identity",
111+ "integers",
112+ "invariant",
113+ "js-date",
114+ "lazy",
115+ "lcg",
116+ "lists",
117+ "maybe",
118+ "mmorph",
119+ "newtype",
120+ "node-buffer",
121+ "node-event-emitter",
122+ "node-fs",
123+ "node-path",
124+ "node-process",
125+ "node-streams",
126+ "nonempty",
127+ "now",
128+ "nullable",
129+ "numbers",
130+ "open-memoize",
131+ "optparse",
132+ "ordered-collections",
133+ "orders",
134+ "parallel",
135+ "partial",
136+ "pipes",
137+ "posix-types",
138+ "prelude",
139+ "profunctor",
140+ "quickcheck",
141+ "random",
142+ "record",
143+ "refs",
144+ "safe-coerce",
145+ "spec",
146+ "spec-discovery",
147+ "spec-node",
148+ "spec-quickcheck",
149+ "st",
150+ "strings",
151+ "tailrec",
152+ "transformers",
153+ "tuples",
154+ "type-equality",
155+ "typelevel-prelude",
156+ "unfoldable",
157+ "unsafe-coerce"
158+ ]
159+ }
160+ }
161+ },
162+ "package_set": {
163+ "address": {
164+ "registry": "61.2.0"
165+ },
166+ "compiler": ">=0.15.15 <0.16.0",
167+ "content": {
168+ "abc-parser": "2.0.1",
169+ "ace": "9.1.0",
170+ "address-rfc2821": "0.1.1",
171+ "aff": "8.0.0",
172+ "aff-bus": "6.0.0",
173+ "aff-coroutines": "9.0.0",
174+ "aff-promise": "4.0.0",
175+ "aff-retry": "2.0.0",
176+ "affjax": "13.0.0",
177+ "affjax-node": "1.0.0",
178+ "affjax-web": "1.0.0",
179+ "ansi": "7.0.0",
180+ "apexcharts": "0.5.0",
181+ "applicative-phases": "1.0.0",
182+ "argonaut": "9.0.0",
183+ "argonaut-aeson-generic": "0.4.1",
184+ "argonaut-codecs": "9.1.0",
185+ "argonaut-core": "7.0.0",
186+ "argonaut-generic": "8.0.0",
187+ "argonaut-traversals": "10.0.0",
188+ "argparse-basic": "2.0.0",
189+ "array-builder": "0.1.2",
190+ "array-search": "0.6.0",
191+ "arraybuffer": "13.2.0",
192+ "arraybuffer-builder": "3.1.0",
193+ "arraybuffer-types": "3.0.2",
194+ "arrays": "7.3.0",
195+ "arrays-extra": "0.6.1",
196+ "arrays-zipper": "2.0.1",
197+ "ask": "1.0.0",
198+ "assert": "6.0.0",
199+ "assert-multiple": "0.4.0",
200+ "avar": "5.0.0",
201+ "b64": "0.0.8",
202+ "barbies": "1.0.1",
203+ "barlow-lens": "0.9.0",
204+ "bifunctors": "6.0.0",
205+ "bigints": "7.0.1",
206+ "bolson": "0.3.9",
207+ "bookhound": "0.1.7",
208+ "bower-json": "3.0.0",
209+ "call-by-name": "4.0.1",
210+ "canvas": "6.0.0",
211+ "canvas-action": "9.0.0",
212+ "cartesian": "1.0.6",
213+ "catenable-lists": "7.0.0",
214+ "cbor-stream": "1.3.0",
215+ "chameleon": "1.0.0",
216+ "chameleon-halogen": "1.0.3",
217+ "chameleon-react-basic": "1.1.0",
218+ "chameleon-styled": "2.5.0",
219+ "chameleon-transformers": "1.0.0",
220+ "channel": "1.0.0",
221+ "checked-exceptions": "3.1.1",
222+ "choku": "1.0.2",
223+ "classless": "0.1.1",
224+ "classless-arbitrary": "0.1.1",
225+ "classless-decode-json": "0.1.1",
226+ "classless-encode-json": "0.1.3",
227+ "classnames": "2.0.0",
228+ "codec": "6.1.0",
229+ "codec-argonaut": "10.0.0",
230+ "codec-json": "2.0.0",
231+ "colors": "7.0.1",
232+ "concur-core": "0.5.0",
233+ "concur-react": "0.5.0",
234+ "concurrent-queues": "3.0.0",
235+ "console": "6.1.0",
236+ "const": "6.0.0",
237+ "contravariant": "6.0.0",
238+ "control": "6.0.0",
239+ "convertable-options": "1.0.0",
240+ "coroutines": "7.0.0",
241+ "css": "6.0.0",
242+ "css-frameworks": "1.0.1",
243+ "csv-stream": "2.3.0",
244+ "data-mvc": "0.0.2",
245+ "datetime": "6.1.0",
246+ "datetime-parsing": "0.2.0",
247+ "debounce": "0.1.0",
248+ "debug": "6.0.2",
249+ "decimals": "7.1.0",
250+ "default-values": "1.0.1",
251+ "deku": "0.9.23",
252+ "deno": "0.0.5",
253+ "dissect": "1.0.0",
254+ "distributive": "6.0.0",
255+ "dom-filereader": "7.0.0",
256+ "dom-indexed": "12.0.0",
257+ "dom-simple": "0.4.0",
258+ "dotenv": "4.0.3",
259+ "droplet": "0.6.0",
260+ "dts": "1.0.0",
261+ "dual-numbers": "1.0.3",
262+ "dynamic-buffer": "3.0.1",
263+ "echarts-simple": "0.0.1",
264+ "effect": "4.0.0",
265+ "either": "6.1.0",
266+ "elmish": "0.13.0",
267+ "elmish-enzyme": "0.1.1",
268+ "elmish-hooks": "0.10.3",
269+ "elmish-html": "0.9.0",
270+ "elmish-testing-library": "0.3.2",
271+ "email-validate": "7.0.0",
272+ "encoding": "0.0.9",
273+ "enums": "6.0.1",
274+ "env-names": "0.4.0",
275+ "error": "2.0.0",
276+ "eta-conversion": "0.3.2",
277+ "exceptions": "6.1.0",
278+ "exists": "6.0.0",
279+ "exitcodes": "4.0.0",
280+ "expect-inferred": "3.0.0",
281+ "ezfetch": "1.1.0",
282+ "fahrtwind": "2.0.0",
283+ "fallback": "0.1.0",
284+ "fast-vect": "1.2.0",
285+ "fetch": "4.1.0",
286+ "fetch-argonaut": "1.0.1",
287+ "fetch-core": "5.1.0",
288+ "fetch-yoga-json": "1.1.0",
289+ "ffi-simple": "0.5.1",
290+ "fft-js": "0.1.0",
291+ "filterable": "5.0.0",
292+ "fix-functor": "0.1.0",
293+ "fixed-points": "7.0.0",
294+ "fixed-precision": "5.0.0",
295+ "flame": "1.3.0",
296+ "float32": "2.0.0",
297+ "fmt": "0.2.1",
298+ "foldable-traversable": "6.0.0",
299+ "foldable-traversable-extra": "0.0.6",
300+ "foreign": "7.0.0",
301+ "foreign-object": "4.1.0",
302+ "foreign-readwrite": "3.4.0",
303+ "forgetmenot": "0.1.0",
304+ "fork": "6.0.0",
305+ "form-urlencoded": "7.0.0",
306+ "formatters": "7.0.0",
307+ "framer-motion": "1.0.1",
308+ "free": "7.1.0",
309+ "freeap": "7.0.0",
310+ "freer-free": "0.0.1",
311+ "freet": "7.0.0",
312+ "functions": "6.0.0",
313+ "functor1": "3.0.0",
314+ "functors": "5.0.0",
315+ "fuzzy": "0.4.0",
316+ "gen": "4.0.0",
317+ "generate-values": "1.0.1",
318+ "generic-router": "0.0.1",
319+ "geojson": "0.0.5",
320+ "geometria": "2.2.0",
321+ "gojs": "0.1.1",
322+ "grain": "3.0.0",
323+ "grain-router": "3.0.0",
324+ "grain-virtualized": "3.0.0",
325+ "graphs": "8.1.0",
326+ "group": "4.1.1",
327+ "halogen": "7.0.0",
328+ "halogen-bootstrap5": "5.3.2",
329+ "halogen-canvas": "1.0.0",
330+ "halogen-css": "10.0.0",
331+ "halogen-echarts-simple": "0.0.4",
332+ "halogen-formless": "4.0.3",
333+ "halogen-helix": "1.0.1",
334+ "halogen-hooks": "0.6.3",
335+ "halogen-hooks-extra": "0.9.0",
336+ "halogen-infinite-scroll": "1.1.0",
337+ "halogen-store": "0.5.4",
338+ "halogen-storybook": "2.0.0",
339+ "halogen-subscriptions": "2.0.0",
340+ "halogen-svg-elems": "8.0.0",
341+ "halogen-typewriter": "1.0.4",
342+ "halogen-vdom": "8.0.0",
343+ "halogen-vdom-string-renderer": "0.5.0",
344+ "halogen-xterm": "2.0.0",
345+ "heckin": "2.0.1",
346+ "heterogeneous": "0.6.0",
347+ "homogeneous": "0.4.0",
348+ "http-methods": "6.0.0",
349+ "httpurple": "4.0.0",
350+ "huffman": "0.4.0",
351+ "humdrum": "0.0.1",
352+ "hyrule": "2.3.8",
353+ "identity": "6.0.0",
354+ "identy": "4.0.1",
355+ "indexed-db": "1.0.0",
356+ "indexed-monad": "3.0.0",
357+ "int64": "3.0.0",
358+ "integers": "6.0.0",
359+ "interpolate": "5.0.2",
360+ "intersection-observer": "1.0.1",
361+ "invariant": "6.0.0",
362+ "jarilo": "1.0.1",
363+ "jelly": "0.10.0",
364+ "jelly-router": "0.3.0",
365+ "jelly-signal": "0.4.0",
366+ "jest": "1.0.0",
367+ "js-abort-controller": "1.0.0",
368+ "js-bigints": "2.2.1",
369+ "js-date": "8.0.0",
370+ "js-fetch": "0.2.1",
371+ "js-fileio": "3.0.0",
372+ "js-intl": "1.1.4",
373+ "js-iterators": "0.1.1",
374+ "js-maps": "0.1.2",
375+ "js-promise": "1.0.0",
376+ "js-promise-aff": "1.0.0",
377+ "js-timers": "6.1.0",
378+ "js-uri": "3.1.0",
379+ "jsdom": "1.0.0",
380+ "json": "1.1.0",
381+ "json-codecs": "5.0.0",
382+ "justifill": "0.5.0",
383+ "jwt": "0.0.9",
384+ "labeled-data": "0.2.0",
385+ "language-cst-parser": "0.14.0",
386+ "lazy": "6.0.0",
387+ "lazy-joe": "1.0.0",
388+ "lcg": "4.0.0",
389+ "leibniz": "5.0.0",
390+ "leveldb": "1.0.1",
391+ "liminal": "1.0.1",
392+ "linalg": "6.0.0",
393+ "lists": "7.0.0",
394+ "literals": "1.0.2",
395+ "logging": "3.0.0",
396+ "logging-journald": "0.4.0",
397+ "lumi-components": "18.0.0",
398+ "machines": "7.0.0",
399+ "maps-eager": "0.5.0",
400+ "marionette": "1.0.0",
401+ "marionette-react-basic-hooks": "0.1.1",
402+ "marked": "0.1.0",
403+ "matrices": "5.0.1",
404+ "matryoshka": "1.0.0",
405+ "maybe": "6.0.0",
406+ "media-types": "6.0.0",
407+ "meowclient": "1.0.0",
408+ "midi": "4.0.0",
409+ "milkis": "9.0.0",
410+ "minibench": "4.0.1",
411+ "mmorph": "7.0.0",
412+ "monad-control": "5.0.0",
413+ "monad-logger": "1.3.1",
414+ "monad-loops": "0.5.0",
415+ "monad-unlift": "1.0.1",
416+ "monoid-extras": "0.0.1",
417+ "monoidal": "0.16.0",
418+ "morello": "0.4.0",
419+ "mote": "3.0.0",
420+ "motsunabe": "2.0.0",
421+ "mvc": "0.0.1",
422+ "mysql": "6.0.1",
423+ "n3": "0.1.0",
424+ "nano-id": "1.1.0",
425+ "nanoid": "0.1.0",
426+ "naturals": "3.0.0",
427+ "nested-functor": "0.2.1",
428+ "newtype": "5.0.0",
429+ "nextjs": "0.1.1",
430+ "nextui": "0.2.0",
431+ "node-buffer": "9.0.0",
432+ "node-child-process": "11.1.0",
433+ "node-event-emitter": "3.0.0",
434+ "node-execa": "5.0.0",
435+ "node-fs": "9.2.0",
436+ "node-glob-basic": "1.3.0",
437+ "node-http": "9.1.0",
438+ "node-http2": "1.1.1",
439+ "node-human-signals": "1.0.0",
440+ "node-net": "5.1.0",
441+ "node-os": "5.1.0",
442+ "node-path": "5.0.0",
443+ "node-process": "11.2.0",
444+ "node-readline": "8.1.1",
445+ "node-sqlite3": "8.0.0",
446+ "node-stream-pipes": "2.1.6",
447+ "node-streams": "9.0.0",
448+ "node-tls": "0.3.1",
449+ "node-url": "7.0.1",
450+ "node-zlib": "0.4.0",
451+ "nonempty": "7.0.0",
452+ "now": "6.0.0",
453+ "npm-package-json": "2.0.0",
454+ "nullable": "6.0.0",
455+ "numberfield": "0.2.2",
456+ "numbers": "9.0.1",
457+ "oak": "3.1.1",
458+ "oak-debug": "1.2.2",
459+ "object-maps": "0.3.0",
460+ "ocarina": "1.5.4",
461+ "oooooooooorrrrrrrmm-lib": "0.0.1",
462+ "open-colors-scales-and-schemes": "1.0.0",
463+ "open-folds": "6.4.0",
464+ "open-foreign-generic": "11.0.3",
465+ "open-memoize": "6.2.0",
466+ "open-mkdirp-aff": "1.2.0",
467+ "open-pairing": "6.2.0",
468+ "open-smolder": "12.0.2",
469+ "options": "7.0.0",
470+ "optparse": "5.0.1",
471+ "ordered-collections": "3.2.0",
472+ "ordered-set": "0.4.0",
473+ "orders": "6.0.0",
474+ "owoify": "1.2.0",
475+ "pairs": "9.0.1",
476+ "parallel": "7.0.0",
477+ "parsing": "10.2.0",
478+ "parsing-dataview": "3.2.4",
479+ "partial": "4.0.0",
480+ "pathy": "9.0.0",
481+ "pha": "0.13.0",
482+ "phaser": "0.7.0",
483+ "phylio": "1.1.2",
484+ "pipes": "8.0.0",
485+ "pirates-charm": "0.0.1",
486+ "pmock": "0.9.0",
487+ "point-free": "1.0.0",
488+ "pointed-list": "0.5.1",
489+ "polymorphic-vectors": "4.0.0",
490+ "posix-types": "6.0.0",
491+ "postgresql": "2.0.20",
492+ "precise": "6.0.0",
493+ "precise-datetime": "7.0.0",
494+ "prelude": "6.0.1",
495+ "prettier-printer": "3.0.0",
496+ "printf": "0.1.0",
497+ "priority-queue": "0.1.2",
498+ "profunctor": "6.0.1",
499+ "profunctor-lenses": "8.0.0",
500+ "protobuf": "4.4.0",
501+ "psa-utils": "8.0.0",
502+ "psci-support": "6.0.0",
503+ "punycode": "1.0.0",
504+ "qualified-do": "2.2.0",
505+ "quantities": "12.2.0",
506+ "quickcheck": "8.0.1",
507+ "quickcheck-combinators": "0.1.3",
508+ "quickcheck-laws": "7.0.0",
509+ "quickcheck-utf8": "0.0.0",
510+ "random": "6.0.0",
511+ "rationals": "6.0.0",
512+ "rdf": "0.1.0",
513+ "react": "11.0.0",
514+ "react-aria": "0.2.0",
515+ "react-basic": "17.0.0",
516+ "react-basic-classic": "3.0.0",
517+ "react-basic-dnd": "10.1.0",
518+ "react-basic-dom": "7.0.0",
519+ "react-basic-dom-beta": "0.1.1",
520+ "react-basic-emotion": "7.1.0",
521+ "react-basic-hooks": "8.2.0",
522+ "react-basic-storybook": "2.0.0",
523+ "react-dom": "8.0.0",
524+ "react-halo": "3.0.0",
525+ "react-icons": "1.1.5",
526+ "react-markdown": "0.1.0",
527+ "react-testing-library": "4.0.1",
528+ "react-virtuoso": "1.0.0",
529+ "reactix": "0.6.1",
530+ "read": "1.0.1",
531+ "recharts": "1.1.0",
532+ "record": "4.0.0",
533+ "record-extra": "5.0.1",
534+ "record-ptional-fields": "0.1.2",
535+ "record-studio": "1.0.4",
536+ "refs": "6.0.0",
537+ "remotedata": "5.0.1",
538+ "repr": "0.5.0",
539+ "resize-observer": "1.0.0",
540+ "resource": "2.0.1",
541+ "resourcet": "1.0.0",
542+ "result": "1.0.3",
543+ "return": "0.2.0",
544+ "ring-modules": "5.0.1",
545+ "rito": "0.3.4",
546+ "roman": "0.4.0",
547+ "rough-notation": "1.0.2",
548+ "routing": "11.0.0",
549+ "routing-duplex": "0.7.0",
550+ "run": "5.0.0",
551+ "safe-coerce": "2.0.0",
552+ "safely": "4.0.1",
553+ "school-of-music": "1.3.0",
554+ "selection-foldable": "0.2.0",
555+ "selective-functors": "1.0.1",
556+ "semirings": "7.0.0",
557+ "signal": "13.0.0",
558+ "simple-emitter": "3.0.1",
559+ "simple-i18n": "2.0.1",
560+ "simple-json": "9.0.0",
561+ "simple-json-generics": "0.2.1",
562+ "simple-ulid": "3.0.0",
563+ "sized-matrices": "1.0.0",
564+ "sized-vectors": "5.0.2",
565+ "slug": "3.1.0",
566+ "small-ffi": "4.0.1",
567+ "soundfonts": "4.1.0",
568+ "sparse-matrices": "2.0.1",
569+ "sparse-polynomials": "3.0.1",
570+ "spec": "8.1.1",
571+ "spec-discovery": "8.4.0",
572+ "spec-mocha": "5.1.1",
573+ "spec-node": "0.0.3",
574+ "spec-quickcheck": "5.0.2",
575+ "spec-reporter-xunit": "0.7.1",
576+ "splitmix": "2.1.0",
577+ "ssrs": "1.0.0",
578+ "st": "6.2.0",
579+ "statistics": "0.3.2",
580+ "strictlypositiveint": "1.0.1",
581+ "string-parsers": "8.0.0",
582+ "strings": "6.0.1",
583+ "strings-extra": "4.0.0",
584+ "stringutils": "0.0.12",
585+ "substitute": "0.2.3",
586+ "supply": "0.2.0",
587+ "svg-parser": "3.0.0",
588+ "systemd-journald": "0.3.0",
589+ "tagged": "4.0.2",
590+ "tailrec": "6.1.0",
591+ "tecton": "0.2.1",
592+ "tecton-halogen": "0.2.0",
593+ "test-unit": "17.0.0",
594+ "thermite": "6.3.1",
595+ "thermite-dom": "0.3.1",
596+ "these": "6.0.0",
597+ "threading": "0.0.3",
598+ "tldr": "0.0.0",
599+ "toestand": "0.9.0",
600+ "transformation-matrix": "1.0.1",
601+ "transformers": "6.1.0",
602+ "tree-rose": "4.0.2",
603+ "ts-bridge": "4.0.0",
604+ "tuples": "7.0.0",
605+ "two-or-more": "1.0.0",
606+ "type-equality": "4.0.1",
607+ "typedenv": "2.0.1",
608+ "typelevel": "6.0.0",
609+ "typelevel-lists": "2.1.0",
610+ "typelevel-peano": "1.0.1",
611+ "typelevel-prelude": "7.0.0",
612+ "typelevel-regex": "0.0.3",
613+ "typelevel-rows": "0.1.0",
614+ "typisch": "0.4.0",
615+ "uint": "7.0.0",
616+ "ulid": "3.0.1",
617+ "uncurried-transformers": "1.1.0",
618+ "undefined": "2.0.0",
619+ "undefined-is-not-a-problem": "1.1.0",
620+ "unfoldable": "6.0.0",
621+ "unicode": "6.0.0",
622+ "unique": "0.6.1",
623+ "unlift": "1.0.1",
624+ "unordered-collections": "3.1.0",
625+ "unsafe-coerce": "6.0.0",
626+ "unsafe-reference": "5.0.0",
627+ "untagged-to-tagged": "0.1.4",
628+ "untagged-union": "1.0.0",
629+ "uri": "9.0.0",
630+ "url-immutable": "1.0.0",
631+ "uuid": "9.0.0",
632+ "uuidv4": "1.0.0",
633+ "validation": "6.0.0",
634+ "variant": "8.0.0",
635+ "variant-encodings": "2.0.0",
636+ "vectorfield": "1.0.1",
637+ "vectors": "2.1.0",
638+ "versions": "7.0.0",
639+ "visx": "0.0.2",
640+ "web-clipboard": "6.0.0",
641+ "web-cssom": "2.0.0",
642+ "web-cssom-view": "0.1.0",
643+ "web-dom": "6.0.0",
644+ "web-dom-parser": "8.0.0",
645+ "web-dom-xpath": "3.0.0",
646+ "web-encoding": "3.0.0",
647+ "web-events": "4.0.0",
648+ "web-fetch": "4.0.1",
649+ "web-file": "4.0.0",
650+ "web-geometry": "0.1.0",
651+ "web-html": "4.1.0",
652+ "web-pointerevents": "2.0.0",
653+ "web-proletarian": "1.0.0",
654+ "web-promise": "3.2.0",
655+ "web-resize-observer": "2.1.0",
656+ "web-router": "1.0.0",
657+ "web-socket": "4.0.0",
658+ "web-storage": "5.0.0",
659+ "web-streams": "4.0.0",
660+ "web-touchevents": "4.0.0",
661+ "web-uievents": "5.0.0",
662+ "web-url": "2.0.0",
663+ "web-workers": "1.1.0",
664+ "web-xhr": "5.0.1",
665+ "webextension-polyfill": "0.1.0",
666+ "webgpu": "0.0.1",
667+ "which": "2.0.0",
668+ "xterm": "1.0.0",
669+ "yoga-fetch": "1.0.1",
670+ "yoga-json": "5.1.0",
671+ "yoga-om": "0.1.0",
672+ "yoga-postgres": "6.0.0",
673+ "yoga-subtlecrypto": "0.1.0",
674+ "yoga-tree": "1.0.0",
675+ "z3": "0.0.2",
676+ "zipperarray": "2.0.0"
677+ }
678+ },
679+ "extra_packages": {}
680+ },
681+ "packages": {
682+ "aff": {
683+ "type": "registry",
684+ "version": "8.0.0",
685+ "integrity": "sha256-9BRIrSdRoYybfiUmBqgKJ66cPqxYHb277bVWQMn/9sg=",
686+ "dependencies": [
687+ "control",
688+ "datetime",
689+ "effect",
690+ "either",
691+ "exceptions",
692+ "functions",
693+ "newtype",
694+ "parallel",
695+ "partial",
696+ "prelude",
697+ "st",
698+ "tailrec",
699+ "transformers",
700+ "unsafe-coerce"
701+ ]
702+ },
703+ "ansi": {
704+ "type": "registry",
705+ "version": "7.0.0",
706+ "integrity": "sha256-tOUaXJFzPSfBVAqLI8hc+Tz2M1rg16cXqyHaK/3SmFg=",
707+ "dependencies": [
708+ "foldable-traversable",
709+ "lists",
710+ "prelude"
711+ ]
712+ },
713+ "argonaut-codecs": {
714+ "type": "registry",
715+ "version": "9.1.0",
716+ "integrity": "sha256-K910SBrmYallESsm8pxJYThs7lig6hxX3M4PW33Cgew=",
717+ "dependencies": [
718+ "argonaut-core",
719+ "arrays",
720+ "bifunctors",
721+ "either",
722+ "foldable-traversable",
723+ "foreign-object",
724+ "identity",
725+ "integers",
726+ "lists",
727+ "maybe",
728+ "nonempty",
729+ "ordered-collections",
730+ "prelude",
731+ "record",
732+ "strings",
733+ "tuples"
734+ ]
735+ },
736+ "argonaut-core": {
737+ "type": "registry",
738+ "version": "7.0.0",
739+ "integrity": "sha256-gYZihtBIKthVuXXoiPphMookSf8M5aHyFYkcIWqlxTM=",
740+ "dependencies": [
741+ "arrays",
742+ "control",
743+ "either",
744+ "foreign-object",
745+ "functions",
746+ "gen",
747+ "maybe",
748+ "nonempty",
749+ "prelude",
750+ "strings",
751+ "tailrec"
752+ ]
753+ },
754+ "arraybuffer-types": {
755+ "type": "registry",
756+ "version": "3.0.2",
757+ "integrity": "sha256-p05cJnSkyeoB7VHzMyc2Eb1RwUaB7Nl0sQSqEGNEUD8=",
758+ "dependencies": []
759+ },
760+ "arrays": {
761+ "type": "registry",
762+ "version": "7.3.0",
763+ "integrity": "sha256-GD4z7LCi9wzi7FCQqbWhvs8paoUK9NO+HwgXZ+KP8Rk=",
764+ "dependencies": [
765+ "bifunctors",
766+ "control",
767+ "foldable-traversable",
768+ "functions",
769+ "maybe",
770+ "nonempty",
771+ "partial",
772+ "prelude",
773+ "safe-coerce",
774+ "st",
775+ "tailrec",
776+ "tuples",
777+ "unfoldable",
778+ "unsafe-coerce"
779+ ]
780+ },
781+ "avar": {
782+ "type": "registry",
783+ "version": "5.0.0",
784+ "integrity": "sha256-9tAeYrHAFSPkbJ7UCtpyLq7QawSrwf/nwLT9BcmfUx8=",
785+ "dependencies": [
786+ "aff",
787+ "effect",
788+ "either",
789+ "exceptions",
790+ "functions",
791+ "maybe",
792+ "prelude"
793+ ]
794+ },
795+ "bifunctors": {
796+ "type": "registry",
797+ "version": "6.0.0",
798+ "integrity": "sha256-tXhmlMiyVy6mbUreVZQt/2EGEsPr0T1PjJi+YCG5J7E=",
799+ "dependencies": [
800+ "const",
801+ "either",
802+ "newtype",
803+ "prelude",
804+ "tuples"
805+ ]
806+ },
807+ "catenable-lists": {
808+ "type": "registry",
809+ "version": "7.0.0",
810+ "integrity": "sha256-7+i/MHBLIRh604iCNT4ENWRWE/wuHIotER4kpdX9Ve0=",
811+ "dependencies": [
812+ "control",
813+ "foldable-traversable",
814+ "lists",
815+ "maybe",
816+ "prelude",
817+ "tuples",
818+ "unfoldable"
819+ ]
820+ },
821+ "console": {
822+ "type": "registry",
823+ "version": "6.1.0",
824+ "integrity": "sha256-3T5PPz1mATZmV0C4GzkCkpLlCa5xG7u8ZNgnLrrrI1Q=",
825+ "dependencies": [
826+ "effect",
827+ "prelude"
828+ ]
829+ },
830+ "const": {
831+ "type": "registry",
832+ "version": "6.0.0",
833+ "integrity": "sha256-S+m0lQsxnji0z1XRUmkn+3RFuWJ5CXWuIr1u3i8Bfoc=",
834+ "dependencies": [
835+ "invariant",
836+ "newtype",
837+ "prelude"
838+ ]
839+ },
840+ "contravariant": {
841+ "type": "registry",
842+ "version": "6.0.0",
843+ "integrity": "sha256-nuckEWqL80NaPmR/l9AUyrfycNh18XcvlZV9PAamwqc=",
844+ "dependencies": [
845+ "const",
846+ "either",
847+ "newtype",
848+ "prelude",
849+ "tuples"
850+ ]
851+ },
852+ "control": {
853+ "type": "registry",
854+ "version": "6.0.0",
855+ "integrity": "sha256-0vxyYh5FL+ilxgLo954w1LqCUC0RSIivNNlb9CaNUQg=",
856+ "dependencies": [
857+ "newtype",
858+ "prelude"
859+ ]
860+ },
861+ "datetime": {
862+ "type": "registry",
863+ "version": "6.1.0",
864+ "integrity": "sha256-tbv6eDXy6QOD7YSknxYSbsDF32OC2JrNbSBpzMs7Doc=",
865+ "dependencies": [
866+ "bifunctors",
867+ "control",
868+ "either",
869+ "enums",
870+ "foldable-traversable",
871+ "functions",
872+ "gen",
873+ "integers",
874+ "lists",
875+ "maybe",
876+ "newtype",
877+ "numbers",
878+ "ordered-collections",
879+ "partial",
880+ "prelude",
881+ "tuples"
882+ ]
883+ },
884+ "distributive": {
885+ "type": "registry",
886+ "version": "6.0.0",
887+ "integrity": "sha256-netyJK4B32PDYHD0tF2AenKgo3urzbI770ycM0pArAo=",
888+ "dependencies": [
889+ "identity",
890+ "newtype",
891+ "prelude",
892+ "tuples",
893+ "type-equality"
894+ ]
895+ },
896+ "effect": {
897+ "type": "registry",
898+ "version": "4.0.0",
899+ "integrity": "sha256-DdqU3bncRTjgMVPPRlAuGHVeajSPEcRaRhNuio7if6s=",
900+ "dependencies": [
901+ "prelude"
902+ ]
903+ },
904+ "either": {
905+ "type": "registry",
906+ "version": "6.1.0",
907+ "integrity": "sha256-tBHx3PgtH4GZOApZCDkcM7szRTYJinrUrVGWazQCUUg=",
908+ "dependencies": [
909+ "control",
910+ "invariant",
911+ "maybe",
912+ "prelude"
913+ ]
914+ },
915+ "enums": {
916+ "type": "registry",
917+ "version": "6.0.1",
918+ "integrity": "sha256-sdZOmLX5+5pASGpvVyT0vSD5BBYQjZiayjV5XiPutso=",
919+ "dependencies": [
920+ "control",
921+ "either",
922+ "gen",
923+ "maybe",
924+ "newtype",
925+ "nonempty",
926+ "partial",
927+ "prelude",
928+ "tuples",
929+ "unfoldable"
930+ ]
931+ },
932+ "exceptions": {
933+ "type": "registry",
934+ "version": "6.1.0",
935+ "integrity": "sha256-nRrr+N0wk0TUFOWLR7e1n1oxcXo/X345bQUtoY9lW6A=",
936+ "dependencies": [
937+ "effect",
938+ "either",
939+ "maybe",
940+ "prelude"
941+ ]
942+ },
943+ "exists": {
944+ "type": "registry",
945+ "version": "6.0.0",
946+ "integrity": "sha256-vtLbrWNaI+pzx/2fw2AQnCovoLtcosClIhjO26QKkh8=",
947+ "dependencies": [
948+ "unsafe-coerce"
949+ ]
950+ },
951+ "exitcodes": {
952+ "type": "registry",
953+ "version": "4.0.0",
954+ "integrity": "sha256-xBl4aFSEQ05Owp1ZvO6OxxvLK3LVzU35RSbj79SsePQ=",
955+ "dependencies": [
956+ "enums",
957+ "maybe",
958+ "prelude"
959+ ]
960+ },
961+ "foldable-traversable": {
962+ "type": "registry",
963+ "version": "6.0.0",
964+ "integrity": "sha256-NGGWyCio/xjce6fPP7y3wwg7CheqllID6aJudDxbWhA=",
965+ "dependencies": [
966+ "bifunctors",
967+ "const",
968+ "control",
969+ "either",
970+ "functors",
971+ "identity",
972+ "maybe",
973+ "newtype",
974+ "orders",
975+ "prelude",
976+ "tuples"
977+ ]
978+ },
979+ "foreign": {
980+ "type": "registry",
981+ "version": "7.0.0",
982+ "integrity": "sha256-jiDRMVQfovGsbbA/FzbzYf6iWk9i2b5gNrIjz+gFfsI=",
983+ "dependencies": [
984+ "either",
985+ "functions",
986+ "integers",
987+ "lists",
988+ "maybe",
989+ "prelude",
990+ "strings",
991+ "transformers",
992+ "unsafe-coerce"
993+ ]
994+ },
995+ "foreign-object": {
996+ "type": "registry",
997+ "version": "4.1.0",
998+ "integrity": "sha256-x/Q7r80z/vmHRKvPwhYmHP/DnJciPtsyGfRTMzayKIU=",
999+ "dependencies": [
1000+ "arrays",
1001+ "foldable-traversable",
1002+ "functions",
1003+ "gen",
1004+ "lists",
1005+ "maybe",
1006+ "prelude",
1007+ "st",
1008+ "tailrec",
1009+ "tuples",
1010+ "typelevel-prelude",
1011+ "unfoldable",
1012+ "unsafe-coerce"
1013+ ]
1014+ },
1015+ "fork": {
1016+ "type": "registry",
1017+ "version": "6.0.0",
1018+ "integrity": "sha256-0keBVeZZg1eCZEy/En1CohVW829gQUqKtqBNIRa93/A=",
1019+ "dependencies": [
1020+ "aff",
1021+ "prelude",
1022+ "transformers"
1023+ ]
1024+ },
1025+ "free": {
1026+ "type": "registry",
1027+ "version": "7.1.0",
1028+ "integrity": "sha256-tUBInfUpRQEw4u94GWcYW7EYdmSdDHSRn88a+C0eltU=",
1029+ "dependencies": [
1030+ "catenable-lists",
1031+ "control",
1032+ "distributive",
1033+ "either",
1034+ "exists",
1035+ "foldable-traversable",
1036+ "invariant",
1037+ "lazy",
1038+ "maybe",
1039+ "prelude",
1040+ "tailrec",
1041+ "transformers",
1042+ "tuples",
1043+ "unsafe-coerce"
1044+ ]
1045+ },
1046+ "functions": {
1047+ "type": "registry",
1048+ "version": "6.0.0",
1049+ "integrity": "sha256-0jgtOr+SFO4UScKc40oA/9Vdcf2rLn3h3vZlY0KfqVo=",
1050+ "dependencies": [
1051+ "prelude"
1052+ ]
1053+ },
1054+ "functors": {
1055+ "type": "registry",
1056+ "version": "5.0.0",
1057+ "integrity": "sha256-W1o/4wcp6S3chodYL8uixlXK2mfr1L+SzM1R+whqUco=",
1058+ "dependencies": [
1059+ "bifunctors",
1060+ "const",
1061+ "contravariant",
1062+ "control",
1063+ "distributive",
1064+ "either",
1065+ "invariant",
1066+ "maybe",
1067+ "newtype",
1068+ "prelude",
1069+ "profunctor",
1070+ "tuples",
1071+ "unsafe-coerce"
1072+ ]
1073+ },
1074+ "gen": {
1075+ "type": "registry",
1076+ "version": "4.0.0",
1077+ "integrity": "sha256-kyOateeOtQa07vfTMYeSuCKdelgKE1R65fwKkZ10wsY=",
1078+ "dependencies": [
1079+ "either",
1080+ "foldable-traversable",
1081+ "identity",
1082+ "maybe",
1083+ "newtype",
1084+ "nonempty",
1085+ "prelude",
1086+ "tailrec",
1087+ "tuples",
1088+ "unfoldable"
1089+ ]
1090+ },
1091+ "identity": {
1092+ "type": "registry",
1093+ "version": "6.0.0",
1094+ "integrity": "sha256-RY/iXPpxpqvKHYfJeFVNI1J06kohB9rbtWYuha8t0LE=",
1095+ "dependencies": [
1096+ "control",
1097+ "invariant",
1098+ "newtype",
1099+ "prelude"
1100+ ]
1101+ },
1102+ "integers": {
1103+ "type": "registry",
1104+ "version": "6.0.0",
1105+ "integrity": "sha256-Y8yozC1uHRLcruobEyv5/bMKzE1BoKJ/olHv6o+bgm8=",
1106+ "dependencies": [
1107+ "maybe",
1108+ "numbers",
1109+ "prelude"
1110+ ]
1111+ },
1112+ "invariant": {
1113+ "type": "registry",
1114+ "version": "6.0.0",
1115+ "integrity": "sha256-HyoT1I5qIHRq8RSZji6zZDvqnpVjLw748utrKwZtqsw=",
1116+ "dependencies": [
1117+ "control",
1118+ "prelude"
1119+ ]
1120+ },
1121+ "js-bigints": {
1122+ "type": "registry",
1123+ "version": "2.2.1",
1124+ "integrity": "sha256-r1rE6Olv5b3JrP32lY2uKJ+eBRTsrVnC983K8VWwqe4=",
1125+ "dependencies": [
1126+ "integers",
1127+ "maybe",
1128+ "prelude"
1129+ ]
1130+ },
1131+ "js-date": {
1132+ "type": "registry",
1133+ "version": "8.0.0",
1134+ "integrity": "sha256-DNQrp4xYc8o80jtxo0aOkUeXGi6h0Xidkk2ZQ8Y4l5Y=",
1135+ "dependencies": [
1136+ "datetime",
1137+ "effect",
1138+ "enums",
1139+ "foreign",
1140+ "functions",
1141+ "integers",
1142+ "maybe",
1143+ "prelude"
1144+ ]
1145+ },
1146+ "lazy": {
1147+ "type": "registry",
1148+ "version": "6.0.0",
1149+ "integrity": "sha256-MHRC+1Pc+AjortBp4b/e1e6KpEpsDwaJBNBB7TOL+1I=",
1150+ "dependencies": [
1151+ "control",
1152+ "foldable-traversable",
1153+ "invariant",
1154+ "prelude"
1155+ ]
1156+ },
1157+ "lcg": {
1158+ "type": "registry",
1159+ "version": "4.0.0",
1160+ "integrity": "sha256-bUYyfXYmjTn7zSpj2hTiePywzsuD80fCjkonsrpdGOw=",
1161+ "dependencies": [
1162+ "effect",
1163+ "integers",
1164+ "maybe",
1165+ "numbers",
1166+ "partial",
1167+ "prelude",
1168+ "random"
1169+ ]
1170+ },
1171+ "lists": {
1172+ "type": "registry",
1173+ "version": "7.0.0",
1174+ "integrity": "sha256-/mGd7wLoU+wsTcqii7SSUByxsvwvjnu2PjwAD47yYb4=",
1175+ "dependencies": [
1176+ "bifunctors",
1177+ "control",
1178+ "foldable-traversable",
1179+ "lazy",
1180+ "maybe",
1181+ "newtype",
1182+ "nonempty",
1183+ "partial",
1184+ "prelude",
1185+ "tailrec",
1186+ "tuples",
1187+ "unfoldable"
1188+ ]
1189+ },
1190+ "maybe": {
1191+ "type": "registry",
1192+ "version": "6.0.0",
1193+ "integrity": "sha256-8X6XEgtZ5lqfkEuc1hWOofnL6mwhk8gSJTxwvbR/SbY=",
1194+ "dependencies": [
1195+ "control",
1196+ "invariant",
1197+ "newtype",
1198+ "prelude"
1199+ ]
1200+ },
1201+ "mmorph": {
1202+ "type": "registry",
1203+ "version": "7.0.0",
1204+ "integrity": "sha256-Cfltaq+tfYjuSoSBN/b8cSQZbvZTqIRs6ebQewbIkGs=",
1205+ "dependencies": [
1206+ "bifunctors",
1207+ "either",
1208+ "free",
1209+ "functors",
1210+ "identity",
1211+ "maybe",
1212+ "newtype",
1213+ "prelude",
1214+ "transformers",
1215+ "tuples"
1216+ ]
1217+ },
1218+ "newtype": {
1219+ "type": "registry",
1220+ "version": "5.0.0",
1221+ "integrity": "sha256-dt6w0cty4OS+Pjt9fsh3iU6ottqSU83mdAZkaEEvo6c=",
1222+ "dependencies": [
1223+ "prelude",
1224+ "safe-coerce"
1225+ ]
1226+ },
1227+ "node-buffer": {
1228+ "type": "registry",
1229+ "version": "9.0.0",
1230+ "integrity": "sha256-RdQjilmEHqsT4fwpCr8Mavw8KTafYrS3ZM6zeAAVAl8=",
1231+ "dependencies": [
1232+ "arraybuffer-types",
1233+ "effect",
1234+ "functions",
1235+ "maybe",
1236+ "nullable",
1237+ "partial",
1238+ "prelude",
1239+ "st",
1240+ "unsafe-coerce"
1241+ ]
1242+ },
1243+ "node-event-emitter": {
1244+ "type": "registry",
1245+ "version": "3.0.0",
1246+ "integrity": "sha256-wodx71NxJBPXOaawFn01V1ByYB2vT+I3RuV2giOVKMg=",
1247+ "dependencies": [
1248+ "effect",
1249+ "either",
1250+ "functions",
1251+ "maybe",
1252+ "nullable",
1253+ "prelude",
1254+ "unsafe-coerce"
1255+ ]
1256+ },
1257+ "node-fs": {
1258+ "type": "registry",
1259+ "version": "9.2.0",
1260+ "integrity": "sha256-fxioTSm9y47WuYs9F/7nxCh/RVDCl3Kr3Hg779J4SJA=",
1261+ "dependencies": [
1262+ "aff",
1263+ "datetime",
1264+ "effect",
1265+ "either",
1266+ "enums",
1267+ "exceptions",
1268+ "functions",
1269+ "integers",
1270+ "js-date",
1271+ "maybe",
1272+ "node-buffer",
1273+ "node-path",
1274+ "node-streams",
1275+ "nullable",
1276+ "partial",
1277+ "prelude",
1278+ "strings"
1279+ ]
1280+ },
1281+ "node-path": {
1282+ "type": "registry",
1283+ "version": "5.0.0",
1284+ "integrity": "sha256-ki3WfT2DT1mj6wECNmhJ99d/a9aqohne3Gj48yH53Tk=",
1285+ "dependencies": [
1286+ "effect"
1287+ ]
1288+ },
1289+ "node-process": {
1290+ "type": "registry",
1291+ "version": "11.2.0",
1292+ "integrity": "sha256-onzKeNmaeYfN3HSDPqSFTrrP2Yl9tnVsfKKhnf2plxM=",
1293+ "dependencies": [
1294+ "effect",
1295+ "exceptions",
1296+ "foreign",
1297+ "foreign-object",
1298+ "maybe",
1299+ "node-event-emitter",
1300+ "node-streams",
1301+ "nullable",
1302+ "posix-types",
1303+ "prelude",
1304+ "strings"
1305+ ]
1306+ },
1307+ "node-streams": {
1308+ "type": "registry",
1309+ "version": "9.0.0",
1310+ "integrity": "sha256-EUpw7EDZCHstxj0vqJUR4BXORmRBN2LTlHw6/te+jxs=",
1311+ "dependencies": [
1312+ "aff",
1313+ "arrays",
1314+ "effect",
1315+ "either",
1316+ "exceptions",
1317+ "maybe",
1318+ "node-buffer",
1319+ "node-event-emitter",
1320+ "nullable",
1321+ "prelude",
1322+ "refs",
1323+ "st",
1324+ "tailrec",
1325+ "unsafe-coerce"
1326+ ]
1327+ },
1328+ "nonempty": {
1329+ "type": "registry",
1330+ "version": "7.0.0",
1331+ "integrity": "sha256-Ctkq8/+KiGqCE53Y/LvibA/coy7ev9HtRZU+GYS7yfQ=",
1332+ "dependencies": [
1333+ "control",
1334+ "foldable-traversable",
1335+ "maybe",
1336+ "prelude",
1337+ "tuples",
1338+ "unfoldable"
1339+ ]
1340+ },
1341+ "now": {
1342+ "type": "registry",
1343+ "version": "6.0.0",
1344+ "integrity": "sha256-mTyG4s8tps3XIf0jjV/lME2/QlwMzrQly2wqfSSUM3o=",
1345+ "dependencies": [
1346+ "datetime",
1347+ "effect",
1348+ "prelude"
1349+ ]
1350+ },
1351+ "nullable": {
1352+ "type": "registry",
1353+ "version": "6.0.0",
1354+ "integrity": "sha256-CDAZk+L9Sc0GCFTkE8n+qdp4Ys8avvnkU+m2hVALt7M=",
1355+ "dependencies": [
1356+ "functions",
1357+ "maybe",
1358+ "prelude"
1359+ ]
1360+ },
1361+ "numbers": {
1362+ "type": "registry",
1363+ "version": "9.0.1",
1364+ "integrity": "sha256-ZydYckgwRAnRaFC7pu6fADhzdwX+UqHZrfJyet64zls=",
1365+ "dependencies": [
1366+ "functions",
1367+ "maybe",
1368+ "prelude"
1369+ ]
1370+ },
1371+ "open-memoize": {
1372+ "type": "registry",
1373+ "version": "6.2.0",
1374+ "integrity": "sha256-yJLuVYX8FocHIJ+6q7efH/Pj4S+e1Y57DZ5Dn7qf4ww=",
1375+ "dependencies": [
1376+ "either",
1377+ "integers",
1378+ "lazy",
1379+ "lists",
1380+ "maybe",
1381+ "partial",
1382+ "prelude",
1383+ "strings",
1384+ "tuples"
1385+ ]
1386+ },
1387+ "optparse": {
1388+ "type": "registry",
1389+ "version": "5.0.1",
1390+ "integrity": "sha256-2btDjHPRR0uujUQJuZAN9AzvVoXe7yG6IwnY5evERhQ=",
1391+ "dependencies": [
1392+ "arrays",
1393+ "bifunctors",
1394+ "control",
1395+ "effect",
1396+ "either",
1397+ "enums",
1398+ "exists",
1399+ "exitcodes",
1400+ "foldable-traversable",
1401+ "free",
1402+ "integers",
1403+ "lazy",
1404+ "lists",
1405+ "maybe",
1406+ "newtype",
1407+ "node-buffer",
1408+ "node-process",
1409+ "node-streams",
1410+ "nonempty",
1411+ "numbers",
1412+ "open-memoize",
1413+ "partial",
1414+ "prelude",
1415+ "strings",
1416+ "tailrec",
1417+ "transformers",
1418+ "tuples"
1419+ ]
1420+ },
1421+ "ordered-collections": {
1422+ "type": "registry",
1423+ "version": "3.2.0",
1424+ "integrity": "sha256-NaEXc2cz/7lJfxPWEja4XlZbGxuRqJwFKQJjsJf51kQ=",
1425+ "dependencies": [
1426+ "arrays",
1427+ "control",
1428+ "foldable-traversable",
1429+ "functions",
1430+ "gen",
1431+ "lists",
1432+ "maybe",
1433+ "newtype",
1434+ "partial",
1435+ "prelude",
1436+ "safe-coerce",
1437+ "tailrec",
1438+ "tuples",
1439+ "unfoldable"
1440+ ]
1441+ },
1442+ "orders": {
1443+ "type": "registry",
1444+ "version": "6.0.0",
1445+ "integrity": "sha256-nSMxZK7wxyDULkjZqvMyB71mVo6b0AyLLHosDVbv1XM=",
1446+ "dependencies": [
1447+ "newtype",
1448+ "prelude"
1449+ ]
1450+ },
1451+ "parallel": {
1452+ "type": "registry",
1453+ "version": "7.0.0",
1454+ "integrity": "sha256-bAGpVhrFz2IyHkA4MR7+tE/19FZ7dzYBdYPgK5svkqw=",
1455+ "dependencies": [
1456+ "control",
1457+ "effect",
1458+ "either",
1459+ "foldable-traversable",
1460+ "functors",
1461+ "maybe",
1462+ "newtype",
1463+ "prelude",
1464+ "profunctor",
1465+ "refs",
1466+ "transformers"
1467+ ]
1468+ },
1469+ "partial": {
1470+ "type": "registry",
1471+ "version": "4.0.0",
1472+ "integrity": "sha256-mdrlJBAgFMh79hNRW39uv7c+BwnnaOrAMmdh7+VhEhs=",
1473+ "dependencies": []
1474+ },
1475+ "pipes": {
1476+ "type": "registry",
1477+ "version": "8.0.0",
1478+ "integrity": "sha256-dtUNpG8BGVr7pu6mQZyAnUAftUHgNS7f0QH3Kw5UTpQ=",
1479+ "dependencies": [
1480+ "aff",
1481+ "control",
1482+ "effect",
1483+ "either",
1484+ "foldable-traversable",
1485+ "identity",
1486+ "lists",
1487+ "maybe",
1488+ "mmorph",
1489+ "newtype",
1490+ "prelude",
1491+ "tailrec",
1492+ "transformers",
1493+ "tuples"
1494+ ]
1495+ },
1496+ "posix-types": {
1497+ "type": "registry",
1498+ "version": "6.0.0",
1499+ "integrity": "sha256-Je5jG439F/SFO/IvVevZnWVxDIonrehlKuJkefP2lHE=",
1500+ "dependencies": [
1501+ "maybe",
1502+ "newtype",
1503+ "prelude"
1504+ ]
1505+ },
1506+ "prelude": {
1507+ "type": "registry",
1508+ "version": "6.0.1",
1509+ "integrity": "sha256-qicw3g9AkjIxyVp73o1dF9BiTCMWouPk9rYe6AASBCU=",
1510+ "dependencies": []
1511+ },
1512+ "profunctor": {
1513+ "type": "registry",
1514+ "version": "6.0.1",
1515+ "integrity": "sha256-Ow0mJC+PIIRq/a3mzCWY5vxuTgR/e+Ee68+mWeSRnWY=",
1516+ "dependencies": [
1517+ "control",
1518+ "distributive",
1519+ "either",
1520+ "exists",
1521+ "invariant",
1522+ "newtype",
1523+ "prelude",
1524+ "tuples"
1525+ ]
1526+ },
1527+ "quickcheck": {
1528+ "type": "registry",
1529+ "version": "8.0.1",
1530+ "integrity": "sha256-SfW+maesCt0jnnFhfrgJZGPcWLj8oFcGbcDIVklmdzc=",
1531+ "dependencies": [
1532+ "arrays",
1533+ "console",
1534+ "control",
1535+ "effect",
1536+ "either",
1537+ "enums",
1538+ "exceptions",
1539+ "foldable-traversable",
1540+ "gen",
1541+ "identity",
1542+ "integers",
1543+ "lazy",
1544+ "lcg",
1545+ "lists",
1546+ "maybe",
1547+ "newtype",
1548+ "nonempty",
1549+ "numbers",
1550+ "partial",
1551+ "prelude",
1552+ "record",
1553+ "st",
1554+ "strings",
1555+ "tailrec",
1556+ "transformers",
1557+ "tuples"
1558+ ]
1559+ },
1560+ "random": {
1561+ "type": "registry",
1562+ "version": "6.0.0",
1563+ "integrity": "sha256-7sZRo6P9UIiXDZ9s2QL9T8h3wlIwLdQrR4+oZKOijQw=",
1564+ "dependencies": [
1565+ "effect",
1566+ "integers",
1567+ "prelude"
1568+ ]
1569+ },
1570+ "record": {
1571+ "type": "registry",
1572+ "version": "4.0.0",
1573+ "integrity": "sha256-WQ8fqp4X1wTA70J4qUcPW4Z7DCwx6e5KJnT/EuTdWSc=",
1574+ "dependencies": [
1575+ "functions",
1576+ "prelude",
1577+ "unsafe-coerce"
1578+ ]
1579+ },
1580+ "refs": {
1581+ "type": "registry",
1582+ "version": "6.0.0",
1583+ "integrity": "sha256-KKD5G9dR2SauuDGULUJsxjqDOEi1Jqm+2Sq5U2mY8YU=",
1584+ "dependencies": [
1585+ "effect",
1586+ "prelude"
1587+ ]
1588+ },
1589+ "safe-coerce": {
1590+ "type": "registry",
1591+ "version": "2.0.0",
1592+ "integrity": "sha256-EJrxtKt5xC7TYjBZrSBO/J7Aw3DmtilYjt4olpAXWVc=",
1593+ "dependencies": [
1594+ "unsafe-coerce"
1595+ ]
1596+ },
1597+ "spec": {
1598+ "type": "registry",
1599+ "version": "8.1.1",
1600+ "integrity": "sha256-b6qjDb7lUJGLV+WEoywLu6BCXC4zGpfbN43mTL+vBeI=",
1601+ "dependencies": [
1602+ "aff",
1603+ "ansi",
1604+ "arrays",
1605+ "avar",
1606+ "bifunctors",
1607+ "control",
1608+ "datetime",
1609+ "effect",
1610+ "either",
1611+ "exceptions",
1612+ "foldable-traversable",
1613+ "fork",
1614+ "identity",
1615+ "integers",
1616+ "lists",
1617+ "maybe",
1618+ "newtype",
1619+ "now",
1620+ "ordered-collections",
1621+ "parallel",
1622+ "pipes",
1623+ "prelude",
1624+ "refs",
1625+ "strings",
1626+ "tailrec",
1627+ "transformers",
1628+ "tuples"
1629+ ]
1630+ },
1631+ "spec-discovery": {
1632+ "type": "registry",
1633+ "version": "8.4.0",
1634+ "integrity": "sha256-aFp8bllT/wrxQu8hMlDchQQY08dQAz+Xdq2hZi5z3yY=",
1635+ "dependencies": [
1636+ "aff",
1637+ "effect",
1638+ "foldable-traversable",
1639+ "prelude",
1640+ "spec",
1641+ "spec-node"
1642+ ]
1643+ },
1644+ "spec-node": {
1645+ "type": "registry",
1646+ "version": "0.0.3",
1647+ "integrity": "sha256-8/9+g0obbamV0YtqzmttbWs8HaWF7CEeW+eDtqzuAAo=",
1648+ "dependencies": [
1649+ "aff",
1650+ "argonaut-codecs",
1651+ "argonaut-core",
1652+ "arrays",
1653+ "control",
1654+ "datetime",
1655+ "effect",
1656+ "either",
1657+ "foldable-traversable",
1658+ "identity",
1659+ "integers",
1660+ "maybe",
1661+ "newtype",
1662+ "node-buffer",
1663+ "node-fs",
1664+ "node-process",
1665+ "now",
1666+ "numbers",
1667+ "optparse",
1668+ "ordered-collections",
1669+ "partial",
1670+ "prelude",
1671+ "spec",
1672+ "strings",
1673+ "tuples"
1674+ ]
1675+ },
1676+ "spec-quickcheck": {
1677+ "type": "registry",
1678+ "version": "5.0.2",
1679+ "integrity": "sha256-pmnLu9e9Yk+Yx4hi71XwbyuPS27ya4hjTOKk2KFK/Ns=",
1680+ "dependencies": [
1681+ "aff",
1682+ "arrays",
1683+ "effect",
1684+ "foldable-traversable",
1685+ "lists",
1686+ "maybe",
1687+ "prelude",
1688+ "quickcheck",
1689+ "tuples"
1690+ ]
1691+ },
1692+ "st": {
1693+ "type": "registry",
1694+ "version": "6.2.0",
1695+ "integrity": "sha256-WI4MEkkwUd4pnwZQ3G8VKWgX5t1RSNJludm5e9boaRo=",
1696+ "dependencies": [
1697+ "effect",
1698+ "partial",
1699+ "prelude",
1700+ "tailrec",
1701+ "unsafe-coerce"
1702+ ]
1703+ },
1704+ "strings": {
1705+ "type": "registry",
1706+ "version": "6.0.1",
1707+ "integrity": "sha256-FNto2hoNW5Da6W6crIk77YXMagBvOGHZE1kO7eZ1vLM=",
1708+ "dependencies": [
1709+ "arrays",
1710+ "control",
1711+ "either",
1712+ "enums",
1713+ "foldable-traversable",
1714+ "gen",
1715+ "integers",
1716+ "maybe",
1717+ "newtype",
1718+ "nonempty",
1719+ "partial",
1720+ "prelude",
1721+ "tailrec",
1722+ "tuples",
1723+ "unfoldable",
1724+ "unsafe-coerce"
1725+ ]
1726+ },
1727+ "tailrec": {
1728+ "type": "registry",
1729+ "version": "6.1.0",
1730+ "integrity": "sha256-xrorCfP0xV1wubs27idQCHQqdvSUuqmmL/am7Ji1wVU=",
1731+ "dependencies": [
1732+ "bifunctors",
1733+ "effect",
1734+ "either",
1735+ "identity",
1736+ "maybe",
1737+ "partial",
1738+ "prelude",
1739+ "refs"
1740+ ]
1741+ },
1742+ "transformers": {
1743+ "type": "registry",
1744+ "version": "6.1.0",
1745+ "integrity": "sha256-QJmgNT/y7ljPHSsXaW4zxF/982BFiQ90KNL1g/NtEOQ=",
1746+ "dependencies": [
1747+ "control",
1748+ "distributive",
1749+ "effect",
1750+ "either",
1751+ "exceptions",
1752+ "foldable-traversable",
1753+ "identity",
1754+ "lazy",
1755+ "maybe",
1756+ "newtype",
1757+ "prelude",
1758+ "st",
1759+ "tailrec",
1760+ "tuples",
1761+ "unfoldable"
1762+ ]
1763+ },
1764+ "tuples": {
1765+ "type": "registry",
1766+ "version": "7.0.0",
1767+ "integrity": "sha256-BKy7EfK8S1KeTCwyWqyW1wwcpSAQuh3IsczSVgS6fzY=",
1768+ "dependencies": [
1769+ "control",
1770+ "invariant",
1771+ "prelude"
1772+ ]
1773+ },
1774+ "type-equality": {
1775+ "type": "registry",
1776+ "version": "4.0.1",
1777+ "integrity": "sha256-BBqYOSnAKmayRvR5mtZoCf4SlYs2ipatD/+5nQx73aw=",
1778+ "dependencies": []
1779+ },
1780+ "typelevel-prelude": {
1781+ "type": "registry",
1782+ "version": "7.0.0",
1783+ "integrity": "sha256-+pHi14/40mTj/+lmCWqL0T7iXIXD1+NSg/KItyyoB0A=",
1784+ "dependencies": [
1785+ "prelude",
1786+ "type-equality"
1787+ ]
1788+ },
1789+ "unfoldable": {
1790+ "type": "registry",
1791+ "version": "6.0.0",
1792+ "integrity": "sha256-BK/6By1sKp/ztk+9CF3q43SV0QDTLVdsGqFerKHSmbg=",
1793+ "dependencies": [
1794+ "foldable-traversable",
1795+ "maybe",
1796+ "partial",
1797+ "prelude",
1798+ "tuples"
1799+ ]
1800+ },
1801+ "unsafe-coerce": {
1802+ "type": "registry",
1803+ "version": "6.0.0",
1804+ "integrity": "sha256-0L1QsaY20OILjfU5TV72d3U/tSjhmL9hJ32WMp857Lk=",
1805+ "dependencies": []
1806+ },
1807+ "variant": {
1808+ "type": "registry",
1809+ "version": "8.0.0",
1810+ "integrity": "sha256-Ydrgl8liWEwYQOWW76PdZtg3vxKpoKgsnmFyTLgZkoU=",
1811+ "dependencies": [
1812+ "control",
1813+ "enums",
1814+ "foldable-traversable",
1815+ "lists",
1816+ "maybe",
1817+ "partial",
1818+ "prelude",
1819+ "type-equality",
1820+ "unsafe-coerce"
1821+ ]
1822+ },
1823+ "yoga-json": {
1824+ "type": "registry",
1825+ "version": "5.1.0",
1826+ "integrity": "sha256-DK+KyaQ7YyWo8p3SuZPPEMoVKy6HF1iV4rGFPXgBygw=",
1827+ "dependencies": [
1828+ "arrays",
1829+ "bifunctors",
1830+ "control",
1831+ "datetime",
1832+ "effect",
1833+ "either",
1834+ "exceptions",
1835+ "foldable-traversable",
1836+ "foreign",
1837+ "foreign-object",
1838+ "free",
1839+ "identity",
1840+ "integers",
1841+ "js-bigints",
1842+ "js-date",
1843+ "lists",
1844+ "maybe",
1845+ "newtype",
1846+ "nullable",
1847+ "numbers",
1848+ "ordered-collections",
1849+ "partial",
1850+ "prelude",
1851+ "record",
1852+ "strings",
1853+ "transformers",
1854+ "tuples",
1855+ "typelevel-prelude",
1856+ "unsafe-coerce",
1857+ "variant",
1858+ "yoga-tree"
1859+ ]
1860+ },
1861+ "yoga-tree": {
1862+ "type": "registry",
1863+ "version": "1.0.0",
1864+ "integrity": "sha256-s8rIVEQkRi1VrMc92T9ceXcY0X6r5A4QqT6f7GgmDQI=",
1865+ "dependencies": [
1866+ "arrays",
1867+ "control",
1868+ "foldable-traversable",
1869+ "free",
1870+ "maybe",
1871+ "prelude",
1872+ "tailrec"
1873+ ]
1874+ }
1875+ }
1876+}
spago.yamlnew file+23
@@ -0,0 +1,23 @@
1+package:
2+ name: yoga-currency
3+ dependencies:
4+ - prelude
5+ - maybe
6+ - yoga-json
7+ - foreign
8+ - control
9+ - enums
10+ test:
11+ main: Test.Main
12+ dependencies:
13+ - spec
14+ - spec-discovery
15+ - spec-quickcheck
16+ - quickcheck
17+ - aff
18+ - arrays
19+ - foldable-traversable
20+workspace:
21+ packageSet:
22+ registry: 61.2.0
23+ extraPackages: {}
src/Data/Currency.pursnew file+1187
@@ -0,0 +1,1187 @@
1+module Data.Currency where
2+
3+import Prelude
4+
5+import Control.Monad.Except (throwError)
6+import Data.Enum (class Enum, class BoundedEnum, Cardinality(..), enumFromTo)
7+import Data.Maybe (Maybe(..))
8+import Foreign (ForeignError(..))
9+import Yoga.JSON (class ReadForeign, class WriteForeign, readImpl, writeImpl)
10+
11+data Currency
12+ = AED
13+ | AFN
14+ | ALL
15+ | AMD
16+ | ANG
17+ | AOA
18+ | ARS
19+ | AUD
20+ | AWG
21+ | AZN
22+ | BAM
23+ | BBD
24+ | BDT
25+ | BGN
26+ | BHD
27+ | BIF
28+ | BMD
29+ | BND
30+ | BOB
31+ | BRL
32+ | BSD
33+ | BTN
34+ | BWP
35+ | BYN
36+ | BZD
37+ | CAD
38+ | CDF
39+ | CHF
40+ | CLP
41+ | CNY
42+ | COP
43+ | CRC
44+ | CUC
45+ | CUP
46+ | CVE
47+ | CZK
48+ | DJF
49+ | DKK
50+ | DOP
51+ | DZD
52+ | EGP
53+ | ERN
54+ | ETB
55+ | EUR
56+ | FJD
57+ | FKP
58+ | GBP
59+ | GEL
60+ | GHS
61+ | GIP
62+ | GMD
63+ | GNF
64+ | GTQ
65+ | GYD
66+ | HKD
67+ | HNL
68+ | HRK
69+ | HTG
70+ | HUF
71+ | IDR
72+ | ILS
73+ | INR
74+ | IQD
75+ | IRR
76+ | ISK
77+ | JMD
78+ | JOD
79+ | JPY
80+ | KES
81+ | KGS
82+ | KHR
83+ | KMF
84+ | KPW
85+ | KRW
86+ | KWD
87+ | KYD
88+ | KZT
89+ | LAK
90+ | LBP
91+ | LKR
92+ | LRD
93+ | LSL
94+ | LYD
95+ | MAD
96+ | MDL
97+ | MGA
98+ | MKD
99+ | MMK
100+ | MNT
101+ | MOP
102+ | MRU
103+ | MUR
104+ | MVR
105+ | MWK
106+ | MXN
107+ | MYR
108+ | MZN
109+ | NAD
110+ | NGN
111+ | NIO
112+ | NOK
113+ | NPR
114+ | NZD
115+ | OMR
116+ | PAB
117+ | PEN
118+ | PGK
119+ | PHP
120+ | PKR
121+ | PLN
122+ | PYG
123+ | QAR
124+ | RON
125+ | RSD
126+ | RUB
127+ | RWF
128+ | SAR
129+ | SBD
130+ | SCR
131+ | SDG
132+ | SEK
133+ | SGD
134+ | SHP
135+ | SLE
136+ | SLL
137+ | SOS
138+ | SRD
139+ | SSP
140+ | STN
141+ | SVC
142+ | SYP
143+ | SZL
144+ | THB
145+ | TJS
146+ | TMT
147+ | TND
148+ | TOP
149+ | TRY
150+ | TTD
151+ | TWD
152+ | TZS
153+ | UAH
154+ | UGX
155+ | USD
156+ | UYU
157+ | UZS
158+ | VES
159+ | VND
160+ | VUV
161+ | WST
162+ | XAF
163+ | XCD
164+ | XCG
165+ | XDR
166+ | XOF
167+ | XPF
168+ | XSU
169+ | YER
170+ | ZAR
171+ | ZMW
172+ | ZWG
173+ | ZWL
174+
175+derive instance Eq Currency
176+derive instance Ord Currency
177+
178+instance Show Currency where
179+ show = toString
180+
181+instance Bounded Currency where
182+ bottom = AED
183+ top = ZWL
184+
185+instance Enum Currency where
186+ succ = case _ of
187+ AED -> Just AFN
188+ AFN -> Just ALL
189+ ALL -> Just AMD
190+ AMD -> Just ANG
191+ ANG -> Just AOA
192+ AOA -> Just ARS
193+ ARS -> Just AUD
194+ AUD -> Just AWG
195+ AWG -> Just AZN
196+ AZN -> Just BAM
197+ BAM -> Just BBD
198+ BBD -> Just BDT
199+ BDT -> Just BGN
200+ BGN -> Just BHD
201+ BHD -> Just BIF
202+ BIF -> Just BMD
203+ BMD -> Just BND
204+ BND -> Just BOB
205+ BOB -> Just BRL
206+ BRL -> Just BSD
207+ BSD -> Just BTN
208+ BTN -> Just BWP
209+ BWP -> Just BYN
210+ BYN -> Just BZD
211+ BZD -> Just CAD
212+ CAD -> Just CDF
213+ CDF -> Just CHF
214+ CHF -> Just CLP
215+ CLP -> Just CNY
216+ CNY -> Just COP
217+ COP -> Just CRC
218+ CRC -> Just CUC
219+ CUC -> Just CUP
220+ CUP -> Just CVE
221+ CVE -> Just CZK
222+ CZK -> Just DJF
223+ DJF -> Just DKK
224+ DKK -> Just DOP
225+ DOP -> Just DZD
226+ DZD -> Just EGP
227+ EGP -> Just ERN
228+ ERN -> Just ETB
229+ ETB -> Just EUR
230+ EUR -> Just FJD
231+ FJD -> Just FKP
232+ FKP -> Just GBP
233+ GBP -> Just GEL
234+ GEL -> Just GHS
235+ GHS -> Just GIP
236+ GIP -> Just GMD
237+ GMD -> Just GNF
238+ GNF -> Just GTQ
239+ GTQ -> Just GYD
240+ GYD -> Just HKD
241+ HKD -> Just HNL
242+ HNL -> Just HRK
243+ HRK -> Just HTG
244+ HTG -> Just HUF
245+ HUF -> Just IDR
246+ IDR -> Just ILS
247+ ILS -> Just INR
248+ INR -> Just IQD
249+ IQD -> Just IRR
250+ IRR -> Just ISK
251+ ISK -> Just JMD
252+ JMD -> Just JOD
253+ JOD -> Just JPY
254+ JPY -> Just KES
255+ KES -> Just KGS
256+ KGS -> Just KHR
257+ KHR -> Just KMF
258+ KMF -> Just KPW
259+ KPW -> Just KRW
260+ KRW -> Just KWD
261+ KWD -> Just KYD
262+ KYD -> Just KZT
263+ KZT -> Just LAK
264+ LAK -> Just LBP
265+ LBP -> Just LKR
266+ LKR -> Just LRD
267+ LRD -> Just LSL
268+ LSL -> Just LYD
269+ LYD -> Just MAD
270+ MAD -> Just MDL
271+ MDL -> Just MGA
272+ MGA -> Just MKD
273+ MKD -> Just MMK
274+ MMK -> Just MNT
275+ MNT -> Just MOP
276+ MOP -> Just MRU
277+ MRU -> Just MUR
278+ MUR -> Just MVR
279+ MVR -> Just MWK
280+ MWK -> Just MXN
281+ MXN -> Just MYR
282+ MYR -> Just MZN
283+ MZN -> Just NAD
284+ NAD -> Just NGN
285+ NGN -> Just NIO
286+ NIO -> Just NOK
287+ NOK -> Just NPR
288+ NPR -> Just NZD
289+ NZD -> Just OMR
290+ OMR -> Just PAB
291+ PAB -> Just PEN
292+ PEN -> Just PGK
293+ PGK -> Just PHP
294+ PHP -> Just PKR
295+ PKR -> Just PLN
296+ PLN -> Just PYG
297+ PYG -> Just QAR
298+ QAR -> Just RON
299+ RON -> Just RSD
300+ RSD -> Just RUB
301+ RUB -> Just RWF
302+ RWF -> Just SAR
303+ SAR -> Just SBD
304+ SBD -> Just SCR
305+ SCR -> Just SDG
306+ SDG -> Just SEK
307+ SEK -> Just SGD
308+ SGD -> Just SHP
309+ SHP -> Just SLE
310+ SLE -> Just SLL
311+ SLL -> Just SOS
312+ SOS -> Just SRD
313+ SRD -> Just SSP
314+ SSP -> Just STN
315+ STN -> Just SVC
316+ SVC -> Just SYP
317+ SYP -> Just SZL
318+ SZL -> Just THB
319+ THB -> Just TJS
320+ TJS -> Just TMT
321+ TMT -> Just TND
322+ TND -> Just TOP
323+ TOP -> Just TRY
324+ TRY -> Just TTD
325+ TTD -> Just TWD
326+ TWD -> Just TZS
327+ TZS -> Just UAH
328+ UAH -> Just UGX
329+ UGX -> Just USD
330+ USD -> Just UYU
331+ UYU -> Just UZS
332+ UZS -> Just VES
333+ VES -> Just VND
334+ VND -> Just VUV
335+ VUV -> Just WST
336+ WST -> Just XAF
337+ XAF -> Just XCD
338+ XCD -> Just XCG
339+ XCG -> Just XDR
340+ XDR -> Just XOF
341+ XOF -> Just XPF
342+ XPF -> Just XSU
343+ XSU -> Just YER
344+ YER -> Just ZAR
345+ ZAR -> Just ZMW
346+ ZMW -> Just ZWG
347+ ZWG -> Just ZWL
348+ ZWL -> Nothing
349+ pred = case _ of
350+ AED -> Nothing
351+ AFN -> Just AED
352+ ALL -> Just AFN
353+ AMD -> Just ALL
354+ ANG -> Just AMD
355+ AOA -> Just ANG
356+ ARS -> Just AOA
357+ AUD -> Just ARS
358+ AWG -> Just AUD
359+ AZN -> Just AWG
360+ BAM -> Just AZN
361+ BBD -> Just BAM
362+ BDT -> Just BBD
363+ BGN -> Just BDT
364+ BHD -> Just BGN
365+ BIF -> Just BHD
366+ BMD -> Just BIF
367+ BND -> Just BMD
368+ BOB -> Just BND
369+ BRL -> Just BOB
370+ BSD -> Just BRL
371+ BTN -> Just BSD
372+ BWP -> Just BTN
373+ BYN -> Just BWP
374+ BZD -> Just BYN
375+ CAD -> Just BZD
376+ CDF -> Just CAD
377+ CHF -> Just CDF
378+ CLP -> Just CHF
379+ CNY -> Just CLP
380+ COP -> Just CNY
381+ CRC -> Just COP
382+ CUC -> Just CRC
383+ CUP -> Just CUC
384+ CVE -> Just CUP
385+ CZK -> Just CVE
386+ DJF -> Just CZK
387+ DKK -> Just DJF
388+ DOP -> Just DKK
389+ DZD -> Just DOP
390+ EGP -> Just DZD
391+ ERN -> Just EGP
392+ ETB -> Just ERN
393+ EUR -> Just ETB
394+ FJD -> Just EUR
395+ FKP -> Just FJD
396+ GBP -> Just FKP
397+ GEL -> Just GBP
398+ GHS -> Just GEL
399+ GIP -> Just GHS
400+ GMD -> Just GIP
401+ GNF -> Just GMD
402+ GTQ -> Just GNF
403+ GYD -> Just GTQ
404+ HKD -> Just GYD
405+ HNL -> Just HKD
406+ HRK -> Just HNL
407+ HTG -> Just HRK
408+ HUF -> Just HTG
409+ IDR -> Just HUF
410+ ILS -> Just IDR
411+ INR -> Just ILS
412+ IQD -> Just INR
413+ IRR -> Just IQD
414+ ISK -> Just IRR
415+ JMD -> Just ISK
416+ JOD -> Just JMD
417+ JPY -> Just JOD
418+ KES -> Just JPY
419+ KGS -> Just KES
420+ KHR -> Just KGS
421+ KMF -> Just KHR
422+ KPW -> Just KMF
423+ KRW -> Just KPW
424+ KWD -> Just KRW
425+ KYD -> Just KWD
426+ KZT -> Just KYD
427+ LAK -> Just KZT
428+ LBP -> Just LAK
429+ LKR -> Just LBP
430+ LRD -> Just LKR
431+ LSL -> Just LRD
432+ LYD -> Just LSL
433+ MAD -> Just LYD
434+ MDL -> Just MAD
435+ MGA -> Just MDL
436+ MKD -> Just MGA
437+ MMK -> Just MKD
438+ MNT -> Just MMK
439+ MOP -> Just MNT
440+ MRU -> Just MOP
441+ MUR -> Just MRU
442+ MVR -> Just MUR
443+ MWK -> Just MVR
444+ MXN -> Just MWK
445+ MYR -> Just MXN
446+ MZN -> Just MYR
447+ NAD -> Just MZN
448+ NGN -> Just NAD
449+ NIO -> Just NGN
450+ NOK -> Just NIO
451+ NPR -> Just NOK
452+ NZD -> Just NPR
453+ OMR -> Just NZD
454+ PAB -> Just OMR
455+ PEN -> Just PAB
456+ PGK -> Just PEN
457+ PHP -> Just PGK
458+ PKR -> Just PHP
459+ PLN -> Just PKR
460+ PYG -> Just PLN
461+ QAR -> Just PYG
462+ RON -> Just QAR
463+ RSD -> Just RON
464+ RUB -> Just RSD
465+ RWF -> Just RUB
466+ SAR -> Just RWF
467+ SBD -> Just SAR
468+ SCR -> Just SBD
469+ SDG -> Just SCR
470+ SEK -> Just SDG
471+ SGD -> Just SEK
472+ SHP -> Just SGD
473+ SLE -> Just SHP
474+ SLL -> Just SLE
475+ SOS -> Just SLL
476+ SRD -> Just SOS
477+ SSP -> Just SRD
478+ STN -> Just SSP
479+ SVC -> Just STN
480+ SYP -> Just SVC
481+ SZL -> Just SYP
482+ THB -> Just SZL
483+ TJS -> Just THB
484+ TMT -> Just TJS
485+ TND -> Just TMT
486+ TOP -> Just TND
487+ TRY -> Just TOP
488+ TTD -> Just TRY
489+ TWD -> Just TTD
490+ TZS -> Just TWD
491+ UAH -> Just TZS
492+ UGX -> Just UAH
493+ USD -> Just UGX
494+ UYU -> Just USD
495+ UZS -> Just UYU
496+ VES -> Just UZS
497+ VND -> Just VES
498+ VUV -> Just VND
499+ WST -> Just VUV
500+ XAF -> Just WST
501+ XCD -> Just XAF
502+ XCG -> Just XCD
503+ XDR -> Just XCG
504+ XOF -> Just XDR
505+ XPF -> Just XOF
506+ XSU -> Just XPF
507+ YER -> Just XSU
508+ ZAR -> Just YER
509+ ZMW -> Just ZAR
510+ ZWG -> Just ZMW
511+ ZWL -> Just ZWG
512+
513+instance BoundedEnum Currency where
514+ cardinality = Cardinality 162
515+ toEnum = case _ of
516+ 0 -> Just AED
517+ 1 -> Just AFN
518+ 2 -> Just ALL
519+ 3 -> Just AMD
520+ 4 -> Just ANG
521+ 5 -> Just AOA
522+ 6 -> Just ARS
523+ 7 -> Just AUD
524+ 8 -> Just AWG
525+ 9 -> Just AZN
526+ 10 -> Just BAM
527+ 11 -> Just BBD
528+ 12 -> Just BDT
529+ 13 -> Just BGN
530+ 14 -> Just BHD
531+ 15 -> Just BIF
532+ 16 -> Just BMD
533+ 17 -> Just BND
534+ 18 -> Just BOB
535+ 19 -> Just BRL
536+ 20 -> Just BSD
537+ 21 -> Just BTN
538+ 22 -> Just BWP
539+ 23 -> Just BYN
540+ 24 -> Just BZD
541+ 25 -> Just CAD
542+ 26 -> Just CDF
543+ 27 -> Just CHF
544+ 28 -> Just CLP
545+ 29 -> Just CNY
546+ 30 -> Just COP
547+ 31 -> Just CRC
548+ 32 -> Just CUC
549+ 33 -> Just CUP
550+ 34 -> Just CVE
551+ 35 -> Just CZK
552+ 36 -> Just DJF
553+ 37 -> Just DKK
554+ 38 -> Just DOP
555+ 39 -> Just DZD
556+ 40 -> Just EGP
557+ 41 -> Just ERN
558+ 42 -> Just ETB
559+ 43 -> Just EUR
560+ 44 -> Just FJD
561+ 45 -> Just FKP
562+ 46 -> Just GBP
563+ 47 -> Just GEL
564+ 48 -> Just GHS
565+ 49 -> Just GIP
566+ 50 -> Just GMD
567+ 51 -> Just GNF
568+ 52 -> Just GTQ
569+ 53 -> Just GYD
570+ 54 -> Just HKD
571+ 55 -> Just HNL
572+ 56 -> Just HRK
573+ 57 -> Just HTG
574+ 58 -> Just HUF
575+ 59 -> Just IDR
576+ 60 -> Just ILS
577+ 61 -> Just INR
578+ 62 -> Just IQD
579+ 63 -> Just IRR
580+ 64 -> Just ISK
581+ 65 -> Just JMD
582+ 66 -> Just JOD
583+ 67 -> Just JPY
584+ 68 -> Just KES
585+ 69 -> Just KGS
586+ 70 -> Just KHR
587+ 71 -> Just KMF
588+ 72 -> Just KPW
589+ 73 -> Just KRW
590+ 74 -> Just KWD
591+ 75 -> Just KYD
592+ 76 -> Just KZT
593+ 77 -> Just LAK
594+ 78 -> Just LBP
595+ 79 -> Just LKR
596+ 80 -> Just LRD
597+ 81 -> Just LSL
598+ 82 -> Just LYD
599+ 83 -> Just MAD
600+ 84 -> Just MDL
601+ 85 -> Just MGA
602+ 86 -> Just MKD
603+ 87 -> Just MMK
604+ 88 -> Just MNT
605+ 89 -> Just MOP
606+ 90 -> Just MRU
607+ 91 -> Just MUR
608+ 92 -> Just MVR
609+ 93 -> Just MWK
610+ 94 -> Just MXN
611+ 95 -> Just MYR
612+ 96 -> Just MZN
613+ 97 -> Just NAD
614+ 98 -> Just NGN
615+ 99 -> Just NIO
616+ 100 -> Just NOK
617+ 101 -> Just NPR
618+ 102 -> Just NZD
619+ 103 -> Just OMR
620+ 104 -> Just PAB
621+ 105 -> Just PEN
622+ 106 -> Just PGK
623+ 107 -> Just PHP
624+ 108 -> Just PKR
625+ 109 -> Just PLN
626+ 110 -> Just PYG
627+ 111 -> Just QAR
628+ 112 -> Just RON
629+ 113 -> Just RSD
630+ 114 -> Just RUB
631+ 115 -> Just RWF
632+ 116 -> Just SAR
633+ 117 -> Just SBD
634+ 118 -> Just SCR
635+ 119 -> Just SDG
636+ 120 -> Just SEK
637+ 121 -> Just SGD
638+ 122 -> Just SHP
639+ 123 -> Just SLE
640+ 124 -> Just SLL
641+ 125 -> Just SOS
642+ 126 -> Just SRD
643+ 127 -> Just SSP
644+ 128 -> Just STN
645+ 129 -> Just SVC
646+ 130 -> Just SYP
647+ 131 -> Just SZL
648+ 132 -> Just THB
649+ 133 -> Just TJS
650+ 134 -> Just TMT
651+ 135 -> Just TND
652+ 136 -> Just TOP
653+ 137 -> Just TRY
654+ 138 -> Just TTD
655+ 139 -> Just TWD
656+ 140 -> Just TZS
657+ 141 -> Just UAH
658+ 142 -> Just UGX
659+ 143 -> Just USD
660+ 144 -> Just UYU
661+ 145 -> Just UZS
662+ 146 -> Just VES
663+ 147 -> Just VND
664+ 148 -> Just VUV
665+ 149 -> Just WST
666+ 150 -> Just XAF
667+ 151 -> Just XCD
668+ 152 -> Just XCG
669+ 153 -> Just XDR
670+ 154 -> Just XOF
671+ 155 -> Just XPF
672+ 156 -> Just XSU
673+ 157 -> Just YER
674+ 158 -> Just ZAR
675+ 159 -> Just ZMW
676+ 160 -> Just ZWG
677+ 161 -> Just ZWL
678+ _ -> Nothing
679+ fromEnum = case _ of
680+ AED -> 0
681+ AFN -> 1
682+ ALL -> 2
683+ AMD -> 3
684+ ANG -> 4
685+ AOA -> 5
686+ ARS -> 6
687+ AUD -> 7
688+ AWG -> 8
689+ AZN -> 9
690+ BAM -> 10
691+ BBD -> 11
692+ BDT -> 12
693+ BGN -> 13
694+ BHD -> 14
695+ BIF -> 15
696+ BMD -> 16
697+ BND -> 17
698+ BOB -> 18
699+ BRL -> 19
700+ BSD -> 20
701+ BTN -> 21
702+ BWP -> 22
703+ BYN -> 23
704+ BZD -> 24
705+ CAD -> 25
706+ CDF -> 26
707+ CHF -> 27
708+ CLP -> 28
709+ CNY -> 29
710+ COP -> 30
711+ CRC -> 31
712+ CUC -> 32
713+ CUP -> 33
714+ CVE -> 34
715+ CZK -> 35
716+ DJF -> 36
717+ DKK -> 37
718+ DOP -> 38
719+ DZD -> 39
720+ EGP -> 40
721+ ERN -> 41
722+ ETB -> 42
723+ EUR -> 43
724+ FJD -> 44
725+ FKP -> 45
726+ GBP -> 46
727+ GEL -> 47
728+ GHS -> 48
729+ GIP -> 49
730+ GMD -> 50
731+ GNF -> 51
732+ GTQ -> 52
733+ GYD -> 53
734+ HKD -> 54
735+ HNL -> 55
736+ HRK -> 56
737+ HTG -> 57
738+ HUF -> 58
739+ IDR -> 59
740+ ILS -> 60
741+ INR -> 61
742+ IQD -> 62
743+ IRR -> 63
744+ ISK -> 64
745+ JMD -> 65
746+ JOD -> 66
747+ JPY -> 67
748+ KES -> 68
749+ KGS -> 69
750+ KHR -> 70
751+ KMF -> 71
752+ KPW -> 72
753+ KRW -> 73
754+ KWD -> 74
755+ KYD -> 75
756+ KZT -> 76
757+ LAK -> 77
758+ LBP -> 78
759+ LKR -> 79
760+ LRD -> 80
761+ LSL -> 81
762+ LYD -> 82
763+ MAD -> 83
764+ MDL -> 84
765+ MGA -> 85
766+ MKD -> 86
767+ MMK -> 87
768+ MNT -> 88
769+ MOP -> 89
770+ MRU -> 90
771+ MUR -> 91
772+ MVR -> 92
773+ MWK -> 93
774+ MXN -> 94
775+ MYR -> 95
776+ MZN -> 96
777+ NAD -> 97
778+ NGN -> 98
779+ NIO -> 99
780+ NOK -> 100
781+ NPR -> 101
782+ NZD -> 102
783+ OMR -> 103
784+ PAB -> 104
785+ PEN -> 105
786+ PGK -> 106
787+ PHP -> 107
788+ PKR -> 108
789+ PLN -> 109
790+ PYG -> 110
791+ QAR -> 111
792+ RON -> 112
793+ RSD -> 113
794+ RUB -> 114
795+ RWF -> 115
796+ SAR -> 116
797+ SBD -> 117
798+ SCR -> 118
799+ SDG -> 119
800+ SEK -> 120
801+ SGD -> 121
802+ SHP -> 122
803+ SLE -> 123
804+ SLL -> 124
805+ SOS -> 125
806+ SRD -> 126
807+ SSP -> 127
808+ STN -> 128
809+ SVC -> 129
810+ SYP -> 130
811+ SZL -> 131
812+ THB -> 132
813+ TJS -> 133
814+ TMT -> 134
815+ TND -> 135
816+ TOP -> 136
817+ TRY -> 137
818+ TTD -> 138
819+ TWD -> 139
820+ TZS -> 140
821+ UAH -> 141
822+ UGX -> 142
823+ USD -> 143
824+ UYU -> 144
825+ UZS -> 145
826+ VES -> 146
827+ VND -> 147
828+ VUV -> 148
829+ WST -> 149
830+ XAF -> 150
831+ XCD -> 151
832+ XCG -> 152
833+ XDR -> 153
834+ XOF -> 154
835+ XPF -> 155
836+ XSU -> 156
837+ YER -> 157
838+ ZAR -> 158
839+ ZMW -> 159
840+ ZWG -> 160
841+ ZWL -> 161
842+
843+toString :: Currency -> String
844+toString = case _ of
845+ AED -> "AED"
846+ AFN -> "AFN"
847+ ALL -> "ALL"
848+ AMD -> "AMD"
849+ ANG -> "ANG"
850+ AOA -> "AOA"
851+ ARS -> "ARS"
852+ AUD -> "AUD"
853+ AWG -> "AWG"
854+ AZN -> "AZN"
855+ BAM -> "BAM"
856+ BBD -> "BBD"
857+ BDT -> "BDT"
858+ BGN -> "BGN"
859+ BHD -> "BHD"
860+ BIF -> "BIF"
861+ BMD -> "BMD"
862+ BND -> "BND"
863+ BOB -> "BOB"
864+ BRL -> "BRL"
865+ BSD -> "BSD"
866+ BTN -> "BTN"
867+ BWP -> "BWP"
868+ BYN -> "BYN"
869+ BZD -> "BZD"
870+ CAD -> "CAD"
871+ CDF -> "CDF"
872+ CHF -> "CHF"
873+ CLP -> "CLP"
874+ CNY -> "CNY"
875+ COP -> "COP"
876+ CRC -> "CRC"
877+ CUC -> "CUC"
878+ CUP -> "CUP"
879+ CVE -> "CVE"
880+ CZK -> "CZK"
881+ DJF -> "DJF"
882+ DKK -> "DKK"
883+ DOP -> "DOP"
884+ DZD -> "DZD"
885+ EGP -> "EGP"
886+ ERN -> "ERN"
887+ ETB -> "ETB"
888+ EUR -> "EUR"
889+ FJD -> "FJD"
890+ FKP -> "FKP"
891+ GBP -> "GBP"
892+ GEL -> "GEL"
893+ GHS -> "GHS"
894+ GIP -> "GIP"
895+ GMD -> "GMD"
896+ GNF -> "GNF"
897+ GTQ -> "GTQ"
898+ GYD -> "GYD"
899+ HKD -> "HKD"
900+ HNL -> "HNL"
901+ HRK -> "HRK"
902+ HTG -> "HTG"
903+ HUF -> "HUF"
904+ IDR -> "IDR"
905+ ILS -> "ILS"
906+ INR -> "INR"
907+ IQD -> "IQD"
908+ IRR -> "IRR"
909+ ISK -> "ISK"
910+ JMD -> "JMD"
911+ JOD -> "JOD"
912+ JPY -> "JPY"
913+ KES -> "KES"
914+ KGS -> "KGS"
915+ KHR -> "KHR"
916+ KMF -> "KMF"
917+ KPW -> "KPW"
918+ KRW -> "KRW"
919+ KWD -> "KWD"
920+ KYD -> "KYD"
921+ KZT -> "KZT"
922+ LAK -> "LAK"
923+ LBP -> "LBP"
924+ LKR -> "LKR"
925+ LRD -> "LRD"
926+ LSL -> "LSL"
927+ LYD -> "LYD"
928+ MAD -> "MAD"
929+ MDL -> "MDL"
930+ MGA -> "MGA"
931+ MKD -> "MKD"
932+ MMK -> "MMK"
933+ MNT -> "MNT"
934+ MOP -> "MOP"
935+ MRU -> "MRU"
936+ MUR -> "MUR"
937+ MVR -> "MVR"
938+ MWK -> "MWK"
939+ MXN -> "MXN"
940+ MYR -> "MYR"
941+ MZN -> "MZN"
942+ NAD -> "NAD"
943+ NGN -> "NGN"
944+ NIO -> "NIO"
945+ NOK -> "NOK"
946+ NPR -> "NPR"
947+ NZD -> "NZD"
948+ OMR -> "OMR"
949+ PAB -> "PAB"
950+ PEN -> "PEN"
951+ PGK -> "PGK"
952+ PHP -> "PHP"
953+ PKR -> "PKR"
954+ PLN -> "PLN"
955+ PYG -> "PYG"
956+ QAR -> "QAR"
957+ RON -> "RON"
958+ RSD -> "RSD"
959+ RUB -> "RUB"
960+ RWF -> "RWF"
961+ SAR -> "SAR"
962+ SBD -> "SBD"
963+ SCR -> "SCR"
964+ SDG -> "SDG"
965+ SEK -> "SEK"
966+ SGD -> "SGD"
967+ SHP -> "SHP"
968+ SLE -> "SLE"
969+ SLL -> "SLL"
970+ SOS -> "SOS"
971+ SRD -> "SRD"
972+ SSP -> "SSP"
973+ STN -> "STN"
974+ SVC -> "SVC"
975+ SYP -> "SYP"
976+ SZL -> "SZL"
977+ THB -> "THB"
978+ TJS -> "TJS"
979+ TMT -> "TMT"
980+ TND -> "TND"
981+ TOP -> "TOP"
982+ TRY -> "TRY"
983+ TTD -> "TTD"
984+ TWD -> "TWD"
985+ TZS -> "TZS"
986+ UAH -> "UAH"
987+ UGX -> "UGX"
988+ USD -> "USD"
989+ UYU -> "UYU"
990+ UZS -> "UZS"
991+ VES -> "VES"
992+ VND -> "VND"
993+ VUV -> "VUV"
994+ WST -> "WST"
995+ XAF -> "XAF"
996+ XCD -> "XCD"
997+ XCG -> "XCG"
998+ XDR -> "XDR"
999+ XOF -> "XOF"
1000+ XPF -> "XPF"
1001+ XSU -> "XSU"
1002+ YER -> "YER"
1003+ ZAR -> "ZAR"
1004+ ZMW -> "ZMW"
1005+ ZWG -> "ZWG"
1006+ ZWL -> "ZWL"
1007+
1008+fromString :: String -> Maybe Currency
1009+fromString = case _ of
1010+ "AED" -> Just AED
1011+ "AFN" -> Just AFN
1012+ "ALL" -> Just ALL
1013+ "AMD" -> Just AMD
1014+ "ANG" -> Just ANG
1015+ "AOA" -> Just AOA
1016+ "ARS" -> Just ARS
1017+ "AUD" -> Just AUD
1018+ "AWG" -> Just AWG
1019+ "AZN" -> Just AZN
1020+ "BAM" -> Just BAM
1021+ "BBD" -> Just BBD
1022+ "BDT" -> Just BDT
1023+ "BGN" -> Just BGN
1024+ "BHD" -> Just BHD
1025+ "BIF" -> Just BIF
1026+ "BMD" -> Just BMD
1027+ "BND" -> Just BND
1028+ "BOB" -> Just BOB
1029+ "BRL" -> Just BRL
1030+ "BSD" -> Just BSD
1031+ "BTN" -> Just BTN
1032+ "BWP" -> Just BWP
1033+ "BYN" -> Just BYN
1034+ "BZD" -> Just BZD
1035+ "CAD" -> Just CAD
1036+ "CDF" -> Just CDF
1037+ "CHF" -> Just CHF
1038+ "CLP" -> Just CLP
1039+ "CNY" -> Just CNY
1040+ "COP" -> Just COP
1041+ "CRC" -> Just CRC
1042+ "CUC" -> Just CUC
1043+ "CUP" -> Just CUP
1044+ "CVE" -> Just CVE
1045+ "CZK" -> Just CZK
1046+ "DJF" -> Just DJF
1047+ "DKK" -> Just DKK
1048+ "DOP" -> Just DOP
1049+ "DZD" -> Just DZD
1050+ "EGP" -> Just EGP
1051+ "ERN" -> Just ERN
1052+ "ETB" -> Just ETB
1053+ "EUR" -> Just EUR
1054+ "FJD" -> Just FJD
1055+ "FKP" -> Just FKP
1056+ "GBP" -> Just GBP
1057+ "GEL" -> Just GEL
1058+ "GHS" -> Just GHS
1059+ "GIP" -> Just GIP
1060+ "GMD" -> Just GMD
1061+ "GNF" -> Just GNF
1062+ "GTQ" -> Just GTQ
1063+ "GYD" -> Just GYD
1064+ "HKD" -> Just HKD
1065+ "HNL" -> Just HNL
1066+ "HRK" -> Just HRK
1067+ "HTG" -> Just HTG
1068+ "HUF" -> Just HUF
1069+ "IDR" -> Just IDR
1070+ "ILS" -> Just ILS
1071+ "INR" -> Just INR
1072+ "IQD" -> Just IQD
1073+ "IRR" -> Just IRR
1074+ "ISK" -> Just ISK
1075+ "JMD" -> Just JMD
1076+ "JOD" -> Just JOD
1077+ "JPY" -> Just JPY
1078+ "KES" -> Just KES
1079+ "KGS" -> Just KGS
1080+ "KHR" -> Just KHR
1081+ "KMF" -> Just KMF
1082+ "KPW" -> Just KPW
1083+ "KRW" -> Just KRW
1084+ "KWD" -> Just KWD
1085+ "KYD" -> Just KYD
1086+ "KZT" -> Just KZT
1087+ "LAK" -> Just LAK
1088+ "LBP" -> Just LBP
1089+ "LKR" -> Just LKR
1090+ "LRD" -> Just LRD
1091+ "LSL" -> Just LSL
1092+ "LYD" -> Just LYD
1093+ "MAD" -> Just MAD
1094+ "MDL" -> Just MDL
1095+ "MGA" -> Just MGA
1096+ "MKD" -> Just MKD
1097+ "MMK" -> Just MMK
1098+ "MNT" -> Just MNT
1099+ "MOP" -> Just MOP
1100+ "MRU" -> Just MRU
1101+ "MUR" -> Just MUR
1102+ "MVR" -> Just MVR
1103+ "MWK" -> Just MWK
1104+ "MXN" -> Just MXN
1105+ "MYR" -> Just MYR
1106+ "MZN" -> Just MZN
1107+ "NAD" -> Just NAD
1108+ "NGN" -> Just NGN
1109+ "NIO" -> Just NIO
1110+ "NOK" -> Just NOK
1111+ "NPR" -> Just NPR
1112+ "NZD" -> Just NZD
1113+ "OMR" -> Just OMR
1114+ "PAB" -> Just PAB
1115+ "PEN" -> Just PEN
1116+ "PGK" -> Just PGK
1117+ "PHP" -> Just PHP
1118+ "PKR" -> Just PKR
1119+ "PLN" -> Just PLN
1120+ "PYG" -> Just PYG
1121+ "QAR" -> Just QAR
1122+ "RON" -> Just RON
1123+ "RSD" -> Just RSD
1124+ "RUB" -> Just RUB
1125+ "RWF" -> Just RWF
1126+ "SAR" -> Just SAR
1127+ "SBD" -> Just SBD
1128+ "SCR" -> Just SCR
1129+ "SDG" -> Just SDG
1130+ "SEK" -> Just SEK
1131+ "SGD" -> Just SGD
1132+ "SHP" -> Just SHP
1133+ "SLE" -> Just SLE
1134+ "SLL" -> Just SLL
1135+ "SOS" -> Just SOS
1136+ "SRD" -> Just SRD
1137+ "SSP" -> Just SSP
1138+ "STN" -> Just STN
1139+ "SVC" -> Just SVC
1140+ "SYP" -> Just SYP
1141+ "SZL" -> Just SZL
1142+ "THB" -> Just THB
1143+ "TJS" -> Just TJS
1144+ "TMT" -> Just TMT
1145+ "TND" -> Just TND
1146+ "TOP" -> Just TOP
1147+ "TRY" -> Just TRY
1148+ "TTD" -> Just TTD
1149+ "TWD" -> Just TWD
1150+ "TZS" -> Just TZS
1151+ "UAH" -> Just UAH
1152+ "UGX" -> Just UGX
1153+ "USD" -> Just USD
1154+ "UYU" -> Just UYU
1155+ "UZS" -> Just UZS
1156+ "VES" -> Just VES
1157+ "VND" -> Just VND
1158+ "VUV" -> Just VUV
1159+ "WST" -> Just WST
1160+ "XAF" -> Just XAF
1161+ "XCD" -> Just XCD
1162+ "XCG" -> Just XCG
1163+ "XDR" -> Just XDR
1164+ "XOF" -> Just XOF
1165+ "XPF" -> Just XPF
1166+ "XSU" -> Just XSU
1167+ "YER" -> Just YER
1168+ "ZAR" -> Just ZAR
1169+ "ZMW" -> Just ZMW
1170+ "ZWG" -> Just ZWG
1171+ "ZWL" -> Just ZWL
1172+ _ -> Nothing
1173+
1174+allCurrencies :: Array Currency
1175+allCurrencies = enumFromTo bottom top
1176+
1177+instance WriteForeign Currency where
1178+ writeImpl = toString >>> writeImpl
1179+
1180+instance ReadForeign Currency where
1181+ readImpl f = do
1182+ let parse s = case fromString s of
1183+ Just c -> pure c
1184+ Nothing -> throwError $ pure $ ForeignError $ "Unknown currency: " <> s
1185+ s <- readImpl f
1186+ parse s
1187+
test/Test/Main.jsnew file+1
@@ -0,0 +1 @@
1+export const jsCurrencies = Intl.supportedValuesOf("currency");
test/Test/Main.pursnew file+59
@@ -0,0 +1,59 @@
1+module Test.Main where
2+
3+import Prelude
4+
5+import Data.Array as Array
6+import Data.Array.NonEmpty as NEA
7+import Data.Currency (Currency)
8+import Data.Currency as Currency
9+import Data.Maybe (Maybe(..), isJust)
10+import Data.String as String
11+import Effect (Effect)
12+import Effect.Aff (launchAff_)
13+import Partial.Unsafe (unsafeCrashWith)
14+import Test.QuickCheck (class Arbitrary)
15+import Test.QuickCheck.Gen (elements)
16+import Test.Spec (describe, it)
17+import Test.Spec.Assertions (shouldEqual)
18+import Test.Spec.QuickCheck (quickCheck)
19+import Test.Spec.Reporter.Console (consoleReporter)
20+import Test.Spec.Runner (runSpec)
21+
22+foreign import jsCurrencies :: Array String
23+
24+newtype ArbCurrency = ArbCurrency Currency
25+
26+instance Arbitrary ArbCurrency where
27+ arbitrary = ArbCurrency <$> elements nea
28+ where
29+ nea = case NEA.fromArray Currency.allCurrencies of
30+ Just a -> a
31+ Nothing -> unsafeCrashWith "allCurrencies is empty"
32+
33+main :: Effect Unit
34+main = launchAff_ $ runSpec [consoleReporter] do
35+ describe "Currency" do
36+ it "toString produces 3-char codes" do
37+ quickCheck \(ArbCurrency c) ->
38+ String.length (Currency.toString c) == 3
39+
40+ it "fromString <<< toString = Just (property)" do
41+ quickCheck \(ArbCurrency c) ->
42+ Currency.fromString (Currency.toString c) == Just c
43+
44+ it "fromString rejects garbage" do
45+ Currency.fromString "ZZZ" `shouldEqual` Nothing
46+ Currency.fromString "" `shouldEqual` Nothing
47+
48+ it "every JS runtime currency parses into our ADT" do
49+ let unparsed = Array.filter (\s -> not (isJust (Currency.fromString s))) jsCurrencies
50+ unparsed `shouldEqual` []
51+
52+ it "every ADT constructor maps to a known JS runtime currency" do
53+ let excess = Array.filter (\c -> not (Array.elem (Currency.toString c) jsCurrencies)) Currency.allCurrencies
54+ map Currency.toString excess `shouldEqual` []
55+
56+ it "spot check known currencies" do
57+ Currency.toString Currency.USD `shouldEqual` "USD"
58+ Currency.toString Currency.EUR `shouldEqual` "EUR"
59+ Currency.fromString "JPY" `shouldEqual` Just Currency.JPY