diff --git a/spago.lock b/spago.lock index 87e8795..c188c8d 100644 --- a/spago.lock +++ b/spago.lock @@ -1,904 +1,1073 @@ -workspace: - packages: - arrays-extra: - path: ./ - dependencies: - - arrays: ">=7.3.0 <8.0.0" - - either: ">=6.1.0 <7.0.0" - - filterable: ">=5.0.0 <6.0.0" - - foldable-traversable: ">=6.0.0 <7.0.0" - - foldable-traversable-extra: ">=0.0.5 <0.0.6" - - maybe: ">=6.0.0 <7.0.0" - - partial: ">=4.0.0 <5.0.0" - - prelude: ">=6.0.1 <7.0.0" - - tuples: ">=7.0.0 <8.0.0" - test_dependencies: [] - build_plan: - - arrays - - bifunctors - - const - - contravariant - - control - - distributive - - effect - - either - - exceptions - - exists - - filterable - - foldable-traversable - - foldable-traversable-extra - - functions - - functors - - gen - - identity - - invariant - - lazy - - lists - - maybe - - newtype - - nonempty - - ordered-collections - - orders - - partial - - prelude - - profunctor - - refs - - safe-coerce - - st - - tailrec - - transformers - - tuples - - type-equality - - unfoldable - - unsafe-coerce - package_set: - address: - registry: 49.0.0 - compiler: ">=0.15.14 <0.16.0" - content: - abc-parser: 2.0.1 - ace: 9.1.0 - aff: 7.1.0 - aff-bus: 6.0.0 - aff-coroutines: 9.0.0 - aff-promise: 4.0.0 - aff-retry: 2.0.0 - affjax: 13.0.0 - affjax-node: 1.0.0 - affjax-web: 1.0.0 - ansi: 7.0.0 - applicative-phases: 1.0.0 - argonaut: 9.0.0 - argonaut-aeson-generic: 0.4.1 - argonaut-codecs: 9.1.0 - argonaut-core: 7.0.0 - argonaut-generic: 8.0.0 - argonaut-traversals: 10.0.0 - argparse-basic: 2.0.0 - array-builder: 0.1.2 - array-search: 0.5.6 - arraybuffer: 13.2.0 - arraybuffer-builder: 3.1.0 - arraybuffer-types: 3.0.2 - arrays: 7.3.0 - arrays-extra: 0.6.0 - arrays-zipper: 2.0.1 - ask: 1.0.0 - assert: 6.0.0 - assert-multiple: 0.3.4 - avar: 5.0.0 - b64: 0.0.8 - barbies: 1.0.1 - barlow-lens: 0.9.0 - bifunctors: 6.0.0 - bigints: 7.0.1 - bolson: 0.3.9 - bookhound: 0.1.7 - bower-json: 3.0.0 - call-by-name: 4.0.1 - canvas: 6.0.0 - canvas-action: 9.0.0 - cartesian: 1.0.6 - catenable-lists: 7.0.0 - chameleon: 1.0.0 - chameleon-halogen: 1.0.3 - chameleon-react-basic: 1.1.0 - chameleon-styled: 2.5.0 - chameleon-transformers: 1.0.0 - channel: 1.0.0 - checked-exceptions: 3.1.1 - choku: 0.2.2 - classless: 0.1.1 - classless-arbitrary: 0.1.1 - classless-decode-json: 0.1.1 - classless-encode-json: 0.1.3 - classnames: 2.0.0 - codec: 6.1.0 - codec-argonaut: 10.0.0 - codec-json: 1.1.0 - colors: 7.0.1 - concur-core: 0.5.0 - concur-react: 0.5.0 - concurrent-queues: 3.0.0 - console: 6.1.0 - const: 6.0.0 - contravariant: 6.0.0 - control: 6.0.0 - convertable-options: 1.0.0 - coroutines: 7.0.0 - css: 6.0.0 - css-frameworks: 1.0.1 - data-mvc: 0.0.2 - datetime: 6.1.0 - datetime-parsing: 0.2.0 - debug: 6.0.2 - decimals: 7.1.0 - default-values: 1.0.1 - deku: 0.9.23 - deno: 0.0.5 - dissect: 1.0.0 - distributive: 6.0.0 - dom-filereader: 7.0.0 - dom-indexed: 12.0.0 - dotenv: 4.0.3 - droplet: 0.6.0 - dts: 1.0.0 - dual-numbers: 1.0.2 - dynamic-buffer: 3.0.1 - echarts-simple: 0.0.1 - effect: 4.0.0 - either: 6.1.0 - elmish: 0.11.3 - elmish-enzyme: 0.1.1 - elmish-hooks: 0.10.0 - elmish-html: 0.8.2 - elmish-testing-library: 0.3.2 - email-validate: 7.0.0 - encoding: 0.0.9 - enums: 6.0.1 - env-names: 0.3.4 - error: 2.0.0 - eta-conversion: 0.3.2 - exceptions: 6.0.0 - exists: 6.0.0 - exitcodes: 4.0.0 - expect-inferred: 3.0.0 - fahrtwind: 2.0.0 - fallback: 0.1.0 - fast-vect: 1.2.0 - fetch: 4.1.0 - fetch-argonaut: 1.0.1 - fetch-core: 5.1.0 - fetch-yoga-json: 1.1.0 - fft-js: 0.1.0 - filterable: 5.0.0 - fix-functor: 0.1.0 - fixed-points: 7.0.0 - fixed-precision: 5.0.0 - flame: 1.3.0 - float32: 2.0.0 - fmt: 0.2.1 - foldable-traversable: 6.0.0 - foldable-traversable-extra: 0.0.6 - foreign: 7.0.0 - foreign-object: 4.1.0 - foreign-readwrite: 3.4.0 - forgetmenot: 0.1.0 - fork: 6.0.0 - form-urlencoded: 7.0.0 - formatters: 7.0.0 - framer-motion: 1.0.1 - free: 7.1.0 - freeap: 7.0.0 - freer-free: 0.0.1 - freet: 7.0.0 - functions: 6.0.0 - functor1: 3.0.0 - functors: 5.0.0 - fuzzy: 0.4.0 - gen: 4.0.0 - generate-values: 1.0.1 - generic-router: 0.0.1 - geojson: 0.0.5 - geometry-plane: 1.0.3 - gojs: 0.1.1 - grain: 3.0.0 - grain-router: 3.0.0 - grain-virtualized: 3.0.0 - graphs: 8.1.0 - group: 4.1.1 - halogen: 7.0.0 - halogen-bootstrap5: 5.3.2 - halogen-css: 10.0.0 - halogen-echarts-simple: 0.0.4 - halogen-formless: 4.0.3 - halogen-helix: 1.0.0 - halogen-hooks: 0.6.3 - halogen-hooks-extra: 0.9.0 - halogen-infinite-scroll: 1.1.0 - halogen-store: 0.5.4 - halogen-storybook: 2.0.0 - halogen-subscriptions: 2.0.0 - halogen-svg-elems: 8.0.0 - halogen-typewriter: 1.0.4 - halogen-vdom: 8.0.0 - halogen-vdom-string-renderer: 0.5.0 - halogen-xterm: 2.0.0 - heckin: 2.0.1 - heterogeneous: 0.6.0 - homogeneous: 0.4.0 - http-methods: 6.0.0 - httpurple: 4.0.0 - humdrum: 0.0.1 - hyrule: 2.3.8 - identity: 6.0.0 - identy: 4.0.1 - indexed-db: 1.0.0 - indexed-monad: 3.0.0 - int64: 3.0.0 - integers: 6.0.0 - interpolate: 5.0.2 - intersection-observer: 1.0.1 - invariant: 6.0.0 - jarilo: 1.0.1 - jelly: 0.10.0 - jelly-router: 0.3.0 - jelly-signal: 0.4.0 - jest: 1.0.0 - js-abort-controller: 1.0.0 - js-bigints: 2.2.1 - js-date: 8.0.0 - js-fetch: 0.2.1 - js-fileio: 3.0.0 - js-intl: 1.0.4 - js-iterators: 0.1.1 - js-maps: 0.1.2 - js-promise: 1.0.0 - js-promise-aff: 1.0.0 - js-timers: 6.1.0 - js-uri: 3.1.0 - json: 1.0.0 - json-codecs: 5.0.0 - justifill: 0.5.0 - jwt: 0.0.9 - labeled-data: 0.2.0 - lazy: 6.0.0 - lazy-joe: 1.0.0 - lcg: 4.0.0 - leibniz: 5.0.0 - leveldb: 1.0.1 - liminal: 1.0.1 - linalg: 6.0.0 - lists: 7.0.0 - literals: 1.0.2 - logging: 3.0.0 - logging-journald: 0.4.0 - lumi-components: 18.0.0 - machines: 7.0.0 - maps-eager: 0.4.1 - marionette: 1.0.0 - marionette-react-basic-hooks: 0.1.1 - marked: 0.1.0 - matrices: 5.0.1 - matryoshka: 1.0.0 - maybe: 6.0.0 - media-types: 6.0.0 - meowclient: 1.0.0 - midi: 4.0.0 - milkis: 9.0.0 - minibench: 4.0.1 - mmorph: 7.0.0 - monad-control: 5.0.0 - monad-logger: 1.3.1 - monad-loops: 0.5.0 - monad-unlift: 1.0.1 - monoid-extras: 0.0.1 - monoidal: 0.16.0 - morello: 0.4.0 - mote: 3.0.0 - motsunabe: 2.0.0 - mvc: 0.0.1 - mysql: 6.0.1 - n3: 0.1.0 - nano-id: 1.1.0 - nanoid: 0.1.0 - naturals: 3.0.0 - nested-functor: 0.2.1 - newtype: 5.0.0 - nextjs: 0.1.1 - nextui: 0.2.0 - node-buffer: 9.0.0 - node-child-process: 11.1.0 - node-event-emitter: 3.0.0 - node-execa: 5.0.0 - node-fs: 9.1.0 - node-glob-basic: 1.3.0 - node-http: 9.1.0 - node-http2: 1.1.1 - node-human-signals: 1.0.0 - node-net: 5.1.0 - node-os: 5.1.0 - node-path: 5.0.0 - node-process: 11.2.0 - node-readline: 8.1.0 - node-sqlite3: 8.0.0 - node-streams: 9.0.0 - node-tls: 0.3.1 - node-url: 7.0.1 - node-zlib: 0.4.0 - nonempty: 7.0.0 - now: 6.0.0 - npm-package-json: 2.0.0 - nullable: 6.0.0 - numberfield: 0.1.0 - numbers: 9.0.1 - oak: 3.1.1 - oak-debug: 1.2.2 - object-maps: 0.3.0 - ocarina: 1.5.4 - open-folds: 6.3.0 - open-memoize: 6.1.0 - open-pairing: 6.1.0 - options: 7.0.0 - optparse: 5.0.1 - ordered-collections: 3.1.1 - ordered-set: 0.4.0 - orders: 6.0.0 - owoify: 1.2.0 - pairs: 9.0.1 - parallel: 7.0.0 - parsing: 10.2.0 - parsing-dataview: 3.2.4 - partial: 4.0.0 - pathy: 9.0.0 - pha: 0.13.0 - phaser: 0.7.0 - phylio: 1.1.2 - pipes: 8.0.0 - pirates-charm: 0.0.1 - pmock: 0.9.0 - point-free: 1.0.0 - pointed-list: 0.5.1 - polymorphic-vectors: 4.0.0 - posix-types: 6.0.0 - precise: 6.0.0 - precise-datetime: 7.0.0 - prelude: 6.0.1 - prettier-printer: 3.0.0 - profunctor: 6.0.0 - profunctor-lenses: 8.0.0 - protobuf: 4.3.0 - psa-utils: 8.0.0 - psci-support: 6.0.0 - punycode: 1.0.0 - qualified-do: 2.2.0 - quantities: 12.2.0 - quickcheck: 8.0.1 - quickcheck-combinators: 0.1.3 - quickcheck-laws: 7.0.0 - quickcheck-utf8: 0.0.0 - random: 6.0.0 - rationals: 6.0.0 - rdf: 0.1.0 - react: 11.0.0 - react-aria: 0.2.0 - react-basic: 17.0.0 - react-basic-classic: 3.0.0 - react-basic-dnd: 10.1.0 - react-basic-dom: 6.1.0 - react-basic-emotion: 7.1.0 - react-basic-hooks: 8.2.0 - react-basic-storybook: 2.0.0 - react-dom: 8.0.0 - react-halo: 3.0.0 - react-icons: 1.1.4 - react-markdown: 0.1.0 - react-testing-library: 4.0.1 - react-virtuoso: 1.0.0 - read: 1.0.1 - recharts: 1.1.0 - record: 4.0.0 - record-extra: 5.0.1 - record-ptional-fields: 0.1.2 - record-studio: 1.0.4 - refs: 6.0.0 - remotedata: 5.0.0 - resize-observer: 1.0.0 - resource: 2.0.1 - resourcet: 1.0.0 - result: 1.0.3 - return: 0.2.0 - ring-modules: 5.0.1 - rito: 0.3.4 - routing: 11.0.0 - routing-duplex: 0.7.0 - run: 5.0.0 - safe-coerce: 2.0.0 - safely: 4.0.1 - school-of-music: 1.3.0 - selection-foldable: 0.2.0 - selective-functors: 1.0.1 - semirings: 7.0.0 - signal: 13.0.0 - simple-emitter: 3.0.1 - simple-i18n: 2.0.1 - simple-json: 9.0.0 - simple-ulid: 3.0.0 - sized-matrices: 1.0.0 - sized-vectors: 5.0.2 - slug: 3.0.8 - small-ffi: 4.0.1 - soundfonts: 4.1.0 - sparse-matrices: 1.3.0 - sparse-polynomials: 2.0.5 - spec: 7.5.5 - spec-mocha: 5.1.0 - spec-quickcheck: 5.0.0 - splitmix: 2.1.0 - ssrs: 1.0.0 - st: 6.2.0 - statistics: 0.3.2 - strictlypositiveint: 1.0.1 - string-parsers: 8.0.0 - strings: 6.0.1 - strings-extra: 4.0.0 - stringutils: 0.0.12 - substitute: 0.2.3 - supply: 0.2.0 - svg-parser: 3.0.0 - systemd-journald: 0.3.0 - tagged: 4.0.2 - tailrec: 6.1.0 - tecton: 0.2.1 - tecton-halogen: 0.2.0 - test-unit: 17.0.0 - thermite: 6.3.1 - thermite-dom: 0.3.1 - these: 6.0.0 - transformation-matrix: 1.0.1 - transformers: 6.0.0 - tree-rose: 4.0.2 - ts-bridge: 4.0.0 - tuples: 7.0.0 - two-or-more: 1.0.0 - type-equality: 4.0.1 - typedenv: 2.0.1 - typelevel: 6.0.0 - typelevel-lists: 2.1.0 - typelevel-peano: 1.0.1 - typelevel-prelude: 7.0.0 - typelevel-regex: 0.0.3 - typelevel-rows: 0.1.0 - uint: 7.0.0 - ulid: 3.0.1 - uncurried-transformers: 1.1.0 - undefined: 2.0.0 - undefined-is-not-a-problem: 1.1.0 - unfoldable: 6.0.0 - unicode: 6.0.0 - unique: 0.6.1 - unlift: 1.0.1 - unordered-collections: 3.0.1 - unsafe-coerce: 6.0.0 - unsafe-reference: 5.0.0 - untagged-to-tagged: 0.1.4 - untagged-union: 1.0.0 - uri: 9.0.0 - uuid: 9.0.0 - uuidv4: 1.0.0 - validation: 6.0.0 - variant: 8.0.0 - variant-encodings: 2.0.0 - vectorfield: 1.0.1 - vectors: 2.1.0 - versions: 7.0.0 - visx: 0.0.2 - web-clipboard: 5.0.0 - web-cssom: 2.0.0 - web-cssom-view: 0.1.0 - web-dom: 6.0.0 - web-dom-parser: 8.0.0 - web-dom-xpath: 3.0.0 - web-encoding: 3.0.0 - web-events: 4.0.0 - web-fetch: 4.0.1 - web-file: 4.0.0 - web-geometry: 0.1.0 - web-html: 4.1.0 - web-pointerevents: 2.0.0 - web-proletarian: 1.0.0 - web-promise: 3.2.0 - web-resize-observer: 2.1.0 - web-router: 1.0.0 - web-socket: 4.0.0 - web-storage: 5.0.0 - web-streams: 4.0.0 - web-touchevents: 4.0.0 - web-uievents: 5.0.0 - web-url: 2.0.0 - web-workers: 1.1.0 - web-xhr: 5.0.1 - webextension-polyfill: 0.1.0 - webgpu: 0.0.1 - which: 2.0.0 - xterm: 1.0.0 - yoga-fetch: 1.0.1 - yoga-json: 5.1.0 - yoga-om: 0.1.0 - yoga-postgres: 6.0.0 - yoga-tree: 1.0.0 - z3: 0.0.2 - zipperarray: 2.0.0 - extra_packages: {} -packages: - arrays: - type: registry - version: 7.3.0 - integrity: sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc= - dependencies: - - bifunctors - - control - - foldable-traversable - - functions - - maybe - - nonempty - - partial - - prelude - - safe-coerce - - st - - tailrec - - tuples - - unfoldable - - unsafe-coerce - bifunctors: - type: registry - version: 6.0.0 - integrity: sha256-/gZwC9YhNxZNQpnHa5BIYerCGM2jeX9ukZiEvYxm5Nw= - dependencies: - - const - - either - - newtype - - prelude - - tuples - const: - type: registry - version: 6.0.0 - integrity: sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc= - dependencies: - - invariant - - newtype - - prelude - contravariant: - type: registry - version: 6.0.0 - integrity: sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c= - dependencies: - - const - - either - - newtype - - prelude - - tuples - control: - type: registry - version: 6.0.0 - integrity: sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk= - dependencies: - - newtype - - prelude - distributive: - type: registry - version: 6.0.0 - integrity: sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ= - dependencies: - - identity - - newtype - - prelude - - tuples - - type-equality - effect: - type: registry - version: 4.0.0 - integrity: sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M= - dependencies: - - prelude - either: - type: registry - version: 6.1.0 - integrity: sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY= - dependencies: - - control - - invariant - - maybe - - prelude - exceptions: - type: registry - version: 6.0.0 - integrity: sha256-y/xTAEIZIARCE+50/u1di0ncebJ+CIwNOLswyOWzMTw= - dependencies: - - effect - - either - - maybe - - prelude - exists: - type: registry - version: 6.0.0 - integrity: sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8= - dependencies: - - unsafe-coerce - filterable: - type: registry - version: 5.0.0 - integrity: sha256-cCojJHRnTmpY1j1kegI4CFwghdQ2Fm/8dzM8IlC+lng= - dependencies: - - arrays - - either - - foldable-traversable - - identity - - lists - - ordered-collections - foldable-traversable: - type: registry - version: 6.0.0 - integrity: sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM= - dependencies: - - bifunctors - - const - - control - - either - - functors - - identity - - maybe - - newtype - - orders - - prelude - - tuples - foldable-traversable-extra: - type: registry - version: 0.0.6 - integrity: sha256-S4+D9xs+lLO7p9+Y4M2XYHafaHlciY1jpGqCGmwfZdc= - dependencies: - - arrays - - either - - foldable-traversable - - maybe - - ordered-collections - - partial - - prelude - - transformers - - tuples - functions: - type: registry - version: 6.0.0 - integrity: sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI= - dependencies: - - prelude - functors: - type: registry - version: 5.0.0 - integrity: sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU= - dependencies: - - bifunctors - - const - - contravariant - - control - - distributive - - either - - invariant - - maybe - - newtype - - prelude - - profunctor - - tuples - - unsafe-coerce - gen: - type: registry - version: 4.0.0 - integrity: sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI= - dependencies: - - either - - foldable-traversable - - identity - - maybe - - newtype - - nonempty - - prelude - - tailrec - - tuples - - unfoldable - identity: - type: registry - version: 6.0.0 - integrity: sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY= - dependencies: - - control - - invariant - - newtype - - prelude - invariant: - type: registry - version: 6.0.0 - integrity: sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo= - dependencies: - - control - - prelude - lazy: - type: registry - version: 6.0.0 - integrity: sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU= - dependencies: - - control - - foldable-traversable - - invariant - - prelude - lists: - type: registry - version: 7.0.0 - integrity: sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI= - dependencies: - - bifunctors - - control - - foldable-traversable - - lazy - - maybe - - newtype - - nonempty - - partial - - prelude - - tailrec - - tuples - - unfoldable - maybe: - type: registry - version: 6.0.0 - integrity: sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q= - dependencies: - - control - - invariant - - newtype - - prelude - newtype: - type: registry - version: 5.0.0 - integrity: sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw= - dependencies: - - prelude - - safe-coerce - nonempty: - type: registry - version: 7.0.0 - integrity: sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs= - dependencies: - - control - - foldable-traversable - - maybe - - prelude - - tuples - - unfoldable - ordered-collections: - type: registry - version: 3.1.1 - integrity: sha256-boSYHmlz4aSbwsNN4VxiwCStc0t+y1F7BXmBS+1JNtI= - dependencies: - - arrays - - foldable-traversable - - gen - - lists - - maybe - - partial - - prelude - - st - - tailrec - - tuples - - unfoldable - orders: - type: registry - version: 6.0.0 - integrity: sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink= - dependencies: - - newtype - - prelude - partial: - type: registry - version: 4.0.0 - integrity: sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4= - dependencies: [] - prelude: - type: registry - version: 6.0.1 - integrity: sha256-o8p6SLYmVPqzXZhQFd2hGAWEwBoXl1swxLG/scpJ0V0= - dependencies: [] - profunctor: - type: registry - version: 6.0.0 - integrity: sha256-99NzxFgTr4CGlCSRYG1kShL+JhYbihhHtbOk1/0R5zI= - dependencies: - - control - - distributive - - either - - exists - - invariant - - newtype - - prelude - - tuples - refs: - type: registry - version: 6.0.0 - integrity: sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s= - dependencies: - - effect - - prelude - safe-coerce: - type: registry - version: 2.0.0 - integrity: sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU= - dependencies: - - unsafe-coerce - st: - type: registry - version: 6.2.0 - integrity: sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY= - dependencies: - - partial - - prelude - - tailrec - - unsafe-coerce - tailrec: - type: registry - version: 6.1.0 - integrity: sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk= - dependencies: - - bifunctors - - effect - - either - - identity - - maybe - - partial - - prelude - - refs - transformers: - type: registry - version: 6.0.0 - integrity: sha256-Pzw40HjthX77tdPAYzjx43LK3X5Bb7ZspYAp27wksFA= - dependencies: - - control - - distributive - - effect - - either - - exceptions - - foldable-traversable - - identity - - lazy - - maybe - - newtype - - prelude - - tailrec - - tuples - - unfoldable - tuples: - type: registry - version: 7.0.0 - integrity: sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M= - dependencies: - - control - - invariant - - prelude - type-equality: - type: registry - version: 4.0.1 - integrity: sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw= - dependencies: [] - unfoldable: - type: registry - version: 6.0.0 - integrity: sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg= - dependencies: - - foldable-traversable - - maybe - - partial - - prelude - - tuples - unsafe-coerce: - type: registry - version: 6.0.0 - integrity: sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0= - dependencies: [] +{ + "workspace": { + "packages": { + "arrays-extra": { + "path": "./", + "core": { + "dependencies": [ + { + "arrays": ">=7.3.0 <8.0.0" + }, + { + "either": ">=6.1.0 <7.0.0" + }, + { + "filterable": ">=5.0.0 <6.0.0" + }, + { + "foldable-traversable": ">=6.0.0 <7.0.0" + }, + { + "foldable-traversable-extra": ">=0.0.5 <0.0.6" + }, + { + "functions": ">=6.0.0 <7.0.0" + }, + { + "maybe": ">=6.0.0 <7.0.0" + }, + { + "ordered-collections": ">=3.2.0 <4.0.0" + }, + { + "partial": ">=4.0.0 <5.0.0" + }, + { + "prelude": ">=6.0.1 <7.0.0" + }, + { + "tuples": ">=7.0.0 <8.0.0" + } + ], + "build_plan": [ + "arrays", + "bifunctors", + "const", + "contravariant", + "control", + "distributive", + "effect", + "either", + "exceptions", + "exists", + "filterable", + "foldable-traversable", + "foldable-traversable-extra", + "functions", + "functors", + "gen", + "identity", + "invariant", + "lazy", + "lists", + "maybe", + "newtype", + "nonempty", + "ordered-collections", + "orders", + "partial", + "prelude", + "profunctor", + "refs", + "safe-coerce", + "st", + "tailrec", + "transformers", + "tuples", + "type-equality", + "unfoldable", + "unsafe-coerce" + ] + }, + "test": { + "dependencies": [], + "build_plan": [] + } + } + }, + "package_set": { + "address": { + "registry": "64.6.0" + }, + "compiler": ">=0.15.15 <0.16.0", + "content": { + "abc-parser": "2.0.1", + "ace": "9.1.0", + "address-rfc2821": "0.1.1", + "aff": "8.0.0", + "aff-bus": "6.0.0", + "aff-coroutines": "9.0.0", + "aff-promise": "4.0.0", + "aff-retry": "2.0.0", + "affjax": "13.0.0", + "affjax-node": "1.0.0", + "affjax-web": "1.0.0", + "ansi": "7.0.0", + "apexcharts": "0.5.0", + "applicative-phases": "1.0.0", + "argonaut": "9.0.0", + "argonaut-aeson-generic": "0.4.1", + "argonaut-codecs": "9.1.0", + "argonaut-core": "7.0.0", + "argonaut-generic": "8.0.0", + "argonaut-traversals": "10.0.0", + "argparse-basic": "2.0.0", + "array-builder": "0.1.2", + "array-search": "0.6.0", + "arraybuffer": "13.2.0", + "arraybuffer-builder": "3.1.0", + "arraybuffer-types": "3.0.2", + "arrays": "7.3.0", + "arrays-extra": "0.6.1", + "arrays-zipper": "2.0.1", + "ask": "1.0.0", + "assert": "6.0.0", + "assert-multiple": "0.4.0", + "avar": "5.0.1", + "b64": "0.0.8", + "barbies": "1.0.1", + "barlow-lens": "0.9.0", + "benchlib": "0.0.4", + "bifunctors": "6.1.0", + "bigints": "7.0.1", + "bolson": "0.3.9", + "bookhound": "0.1.7", + "bower-json": "3.0.0", + "call-by-name": "4.0.1", + "canvas": "6.0.0", + "canvas-action": "9.0.0", + "cartesian": "1.0.6", + "catenable-lists": "7.0.0", + "cbor-stream": "1.3.0", + "chameleon": "1.0.0", + "chameleon-halogen": "1.0.3", + "chameleon-react-basic": "1.1.0", + "chameleon-styled": "2.5.0", + "chameleon-transformers": "1.0.0", + "channel": "1.0.0", + "checked-exceptions": "3.1.1", + "choku": "1.0.2", + "classless": "0.1.1", + "classless-arbitrary": "0.1.1", + "classless-decode-json": "0.1.1", + "classless-encode-json": "0.1.3", + "classnames": "2.0.0", + "codec": "6.1.0", + "codec-argonaut": "10.0.0", + "codec-json": "2.0.0", + "colors": "7.0.1", + "concur-core": "0.5.0", + "concur-react": "0.5.0", + "concurrent-queues": "3.0.0", + "console": "6.1.0", + "const": "6.0.0", + "contravariant": "6.0.0", + "control": "6.0.0", + "convertable-options": "1.0.0", + "coroutines": "7.0.0", + "css": "6.0.0", + "css-class-name-extractor": "0.0.4", + "css-frameworks": "1.0.1", + "csv-stream": "2.3.0", + "data-mvc": "0.0.2", + "datetime": "6.1.0", + "datetime-parsing": "0.2.0", + "debounce": "0.1.0", + "debug": "6.0.2", + "decimals": "7.1.0", + "default-values": "1.0.1", + "deku": "0.9.23", + "deno": "0.0.5", + "dissect": "1.0.0", + "distributive": "6.0.0", + "dodo-printer": "2.2.3", + "dom-filereader": "7.0.0", + "dom-indexed": "12.0.0", + "dom-simple": "0.4.0", + "dotenv": "4.0.3", + "droplet": "0.6.0", + "dts": "1.0.0", + "dual-numbers": "1.0.3", + "dynamic-buffer": "3.0.1", + "echarts-simple": "0.0.1", + "effect": "4.0.0", + "either": "6.1.0", + "elmish": "0.13.0", + "elmish-enzyme": "0.1.1", + "elmish-hooks": "0.10.3", + "elmish-html": "0.9.0", + "elmish-testing-library": "0.3.2", + "email-validate": "7.0.0", + "encoding": "0.0.9", + "enums": "6.0.1", + "env-names": "0.4.0", + "error": "2.0.0", + "eta-conversion": "0.3.2", + "exceptions": "6.1.0", + "exists": "6.0.0", + "exitcodes": "4.0.0", + "expect-inferred": "3.0.0", + "express": "0.9.1", + "ezfetch": "1.1.0", + "fahrtwind": "2.0.0", + "fakerjs": "0.0.1", + "fallback": "0.1.0", + "fast-vect": "1.2.0", + "fetch": "4.1.0", + "fetch-argonaut": "1.0.1", + "fetch-core": "5.1.0", + "fetch-yoga-json": "1.1.0", + "ffi-simple": "0.5.1", + "fft-js": "0.1.0", + "filterable": "5.0.0", + "fix-functor": "0.1.0", + "fixed-points": "7.0.0", + "fixed-precision": "5.0.0", + "flame": "1.3.0", + "float32": "2.0.0", + "fmt": "0.2.1", + "foldable-traversable": "6.0.0", + "foldable-traversable-extra": "0.0.6", + "foreign": "7.0.0", + "foreign-object": "4.1.0", + "foreign-readwrite": "3.4.0", + "forgetmenot": "0.1.0", + "fork": "6.0.0", + "form-urlencoded": "7.0.0", + "formatters": "7.0.0", + "framer-motion": "1.0.1", + "free": "7.1.0", + "freeap": "7.0.0", + "freer-free": "0.0.1", + "freet": "7.0.0", + "functions": "6.0.0", + "functor1": "3.0.0", + "functors": "5.0.0", + "fuzzy": "0.4.0", + "gen": "4.0.0", + "generate-values": "1.0.1", + "generic-router": "0.0.1", + "geojson": "0.0.5", + "geometria": "2.2.0", + "gesso": "1.0.0", + "gojs": "0.1.1", + "golem-fetch": "0.1.0", + "grain": "3.0.0", + "grain-router": "3.0.0", + "grain-virtualized": "3.0.0", + "graphs": "8.1.0", + "group": "4.1.1", + "halogen": "7.0.0", + "halogen-bootstrap5": "5.3.2", + "halogen-canvas": "1.0.0", + "halogen-css": "10.0.0", + "halogen-declarative-canvas": "0.0.8", + "halogen-echarts-simple": "0.0.4", + "halogen-formless": "4.0.3", + "halogen-helix": "1.1.0", + "halogen-hooks": "0.6.3", + "halogen-hooks-extra": "0.9.0", + "halogen-infinite-scroll": "1.1.0", + "halogen-store": "0.5.4", + "halogen-storybook": "2.0.0", + "halogen-subscriptions": "2.0.0", + "halogen-svg-elems": "8.0.0", + "halogen-typewriter": "1.0.4", + "halogen-use-trigger-hooks": "1.0.0", + "halogen-vdom": "8.0.0", + "halogen-vdom-string-renderer": "0.5.0", + "halogen-xterm": "2.0.0", + "heckin": "2.0.1", + "heterogeneous": "0.6.0", + "homogeneous": "0.4.0", + "http-methods": "6.0.0", + "httpurple": "4.0.0", + "huffman": "0.4.0", + "humdrum": "0.0.1", + "hyrule": "2.3.8", + "identity": "6.0.0", + "identy": "4.0.1", + "indexed-db": "1.0.0", + "indexed-monad": "3.0.0", + "int64": "3.0.0", + "integers": "6.0.0", + "interpolate": "5.0.2", + "intersection-observer": "1.0.1", + "invariant": "6.0.0", + "jarilo": "1.0.1", + "jelly": "0.10.0", + "jelly-router": "0.3.0", + "jelly-signal": "0.4.0", + "jest": "1.0.0", + "js-abort-controller": "1.0.0", + "js-bigints": "2.2.1", + "js-date": "8.0.0", + "js-fetch": "0.2.1", + "js-fileio": "3.0.0", + "js-intl": "1.1.4", + "js-iterators": "0.1.1", + "js-maps": "0.1.2", + "js-promise": "1.0.0", + "js-promise-aff": "1.0.0", + "js-timers": "6.1.0", + "js-uri": "3.1.0", + "jsdom": "1.0.0", + "json": "1.1.0", + "json-codecs": "5.0.0", + "justifill": "0.5.0", + "jwt": "0.0.9", + "labeled-data": "0.2.0", + "language-cst-parser": "0.14.1", + "lazy": "6.0.0", + "lazy-joe": "1.0.0", + "lcg": "4.0.0", + "leibniz": "5.0.0", + "leveldb": "1.0.1", + "liminal": "1.0.1", + "linalg": "6.0.0", + "lists": "7.0.0", + "literals": "1.0.2", + "logging": "3.0.0", + "logging-journald": "0.4.0", + "lumi-components": "18.0.0", + "machines": "7.0.0", + "maps-eager": "0.5.0", + "marionette": "1.0.0", + "marionette-react-basic-hooks": "0.1.1", + "marked": "0.1.0", + "matrices": "5.0.1", + "matryoshka": "1.0.0", + "maybe": "6.0.0", + "media-types": "6.0.0", + "meowclient": "1.0.0", + "midi": "4.0.0", + "milkis": "9.0.0", + "minibench": "4.0.1", + "mmorph": "7.0.0", + "monad-control": "5.0.0", + "monad-logger": "1.3.1", + "monad-loops": "0.5.0", + "monad-unlift": "1.0.1", + "monoid-extras": "0.0.1", + "monoidal": "0.16.0", + "morello": "0.4.0", + "mote": "3.0.0", + "motsunabe": "2.0.0", + "mvc": "0.0.1", + "mysql": "6.0.1", + "n3": "0.1.0", + "nano-id": "1.1.0", + "nanoid": "0.1.0", + "naturals": "3.0.0", + "nested-functor": "0.2.1", + "newtype": "5.0.0", + "nextjs": "0.1.1", + "nextui": "0.2.0", + "node-buffer": "9.0.0", + "node-child-process": "11.1.0", + "node-event-emitter": "3.0.0", + "node-execa": "5.0.0", + "node-fs": "9.2.0", + "node-glob-basic": "2.0.0", + "node-http": "9.1.0", + "node-http2": "1.1.1", + "node-human-signals": "1.0.0", + "node-net": "5.1.0", + "node-os": "5.1.0", + "node-path": "5.0.1", + "node-process": "11.2.0", + "node-readline": "8.1.1", + "node-sqlite3": "8.0.0", + "node-stream-pipes": "2.1.6", + "node-streams": "9.0.1", + "node-tls": "0.3.1", + "node-url": "7.0.1", + "node-workerbees": "0.3.1", + "node-zlib": "0.4.0", + "nonempty": "7.0.0", + "now": "6.0.0", + "npm-package-json": "2.0.0", + "nullable": "6.0.0", + "numberfield": "0.2.2", + "numbers": "9.0.1", + "oak": "3.1.1", + "oak-debug": "1.2.2", + "object-maps": "0.3.0", + "ocarina": "1.5.4", + "oooooooooorrrrrrrmm-lib": "0.0.1", + "open-colors-scales-and-schemes": "1.0.0", + "open-folds": "6.4.0", + "open-foreign-generic": "11.0.3", + "open-memoize": "6.2.0", + "open-mkdirp-aff": "1.2.0", + "open-pairing": "6.2.0", + "open-smolder": "12.0.2", + "options": "7.0.0", + "optparse": "5.0.1", + "ordered-collections": "3.2.0", + "ordered-set": "0.4.0", + "orders": "6.0.0", + "owoify": "1.2.0", + "pairs": "9.0.1", + "parallel": "7.0.0", + "parsing": "10.3.0", + "parsing-dataview": "3.2.4", + "partial": "4.0.0", + "pathy": "9.0.0", + "pha": "0.13.0", + "phaser": "0.7.0", + "phylio": "1.1.2", + "pipes": "8.0.0", + "pirates-charm": "0.0.1", + "pmock": "0.9.0", + "point-free": "1.0.0", + "pointed-list": "0.5.1", + "polymorphic-vectors": "4.0.0", + "posix-types": "6.0.0", + "postgresql": "2.0.20", + "precise": "6.0.0", + "precise-datetime": "7.0.0", + "prelude": "6.0.2", + "prettier-printer": "3.0.0", + "printf": "0.1.0", + "priority-queue": "0.1.2", + "profunctor": "6.0.1", + "profunctor-lenses": "8.0.0", + "protobuf": "4.4.0", + "psa-utils": "8.0.0", + "psci-support": "6.0.0", + "punycode": "1.0.0", + "qualified-do": "2.2.0", + "quantities": "12.2.0", + "quickcheck": "8.0.1", + "quickcheck-combinators": "0.1.3", + "quickcheck-laws": "7.0.0", + "quickcheck-utf8": "0.0.0", + "random": "6.0.0", + "rationals": "6.0.0", + "rdf": "0.1.0", + "react": "11.0.0", + "react-aria": "0.2.0", + "react-basic": "17.0.0", + "react-basic-classic": "3.0.0", + "react-basic-dnd": "10.1.0", + "react-basic-dom": "7.0.0", + "react-basic-dom-beta": "0.1.1", + "react-basic-emotion": "7.1.0", + "react-basic-hooks": "8.2.0", + "react-basic-storybook": "2.0.0", + "react-dom": "8.0.0", + "react-halo": "3.0.0", + "react-icons": "1.1.5", + "react-markdown": "0.1.0", + "react-testing-library": "4.0.1", + "react-virtuoso": "1.0.0", + "reactix": "0.6.1", + "read": "1.0.1", + "recharts": "1.1.0", + "record": "4.0.0", + "record-extra": "5.0.1", + "record-extra-srghma": "0.1.1", + "record-ptional-fields": "0.1.2", + "record-studio": "1.0.4", + "refs": "6.0.0", + "remotedata": "5.0.1", + "repr": "0.5.0", + "resize-arrays": "0.0.1", + "resize-observer": "1.0.0", + "resource": "2.0.1", + "resourcet": "1.0.0", + "result": "1.0.3", + "return": "0.2.0", + "ring-modules": "5.0.1", + "rito": "0.3.4", + "roman": "0.4.0", + "rough-notation": "1.0.2", + "routing": "11.0.0", + "routing-duplex": "0.7.0", + "run": "5.0.0", + "safe-coerce": "2.0.0", + "safely": "4.0.1", + "school-of-music": "1.3.0", + "selection-foldable": "0.2.0", + "selective-functors": "1.0.1", + "semirings": "7.0.0", + "shuffle": "1.1.0", + "signal": "13.0.0", + "simple-emitter": "3.0.1", + "simple-i18n": "2.0.1", + "simple-json": "9.0.0", + "simple-json-generics": "0.2.1", + "simple-ulid": "3.0.0", + "sized-matrices": "1.0.0", + "sized-vectors": "5.0.2", + "slug": "3.1.0", + "small-ffi": "4.0.1", + "soundfonts": "4.1.0", + "sparse-matrices": "2.0.1", + "sparse-polynomials": "3.0.1", + "spec": "8.1.1", + "spec-discovery": "8.4.0", + "spec-mocha": "5.1.1", + "spec-node": "0.0.3", + "spec-quickcheck": "5.0.2", + "spec-reporter-xunit": "0.7.1", + "splitmix": "2.1.0", + "ssrs": "1.0.0", + "st": "6.2.0", + "statistics": "0.3.2", + "strictlypositiveint": "1.0.1", + "string-parsers": "8.0.0", + "strings": "6.0.1", + "strings-extra": "4.0.0", + "stringutils": "0.0.12", + "substitute": "0.2.3", + "supply": "0.2.0", + "svg-parser": "3.0.0", + "systemd-journald": "0.3.0", + "tagged": "4.0.2", + "tailrec": "6.1.0", + "tanstack-query": "2.0.0", + "tecton": "0.2.1", + "tecton-halogen": "0.2.0", + "test-unit": "17.0.0", + "thermite": "6.3.1", + "thermite-dom": "0.3.1", + "these": "6.0.0", + "threading": "0.0.3", + "tidy": "0.11.1", + "tidy-codegen": "4.0.1", + "tldr": "0.0.0", + "toestand": "0.9.0", + "transformation-matrix": "1.0.1", + "transformers": "6.1.0", + "tree-rose": "4.0.2", + "trivial-unfold": "0.5.0", + "ts-bridge": "4.0.0", + "tuples": "7.0.0", + "two-or-more": "1.0.0", + "type-equality": "4.0.1", + "typedenv": "2.0.1", + "typelevel": "6.0.0", + "typelevel-lists": "2.1.0", + "typelevel-peano": "1.0.1", + "typelevel-prelude": "7.0.0", + "typelevel-regex": "0.0.3", + "typelevel-rows": "0.1.0", + "typisch": "0.4.0", + "uint": "7.0.0", + "ulid": "3.0.1", + "uncurried-transformers": "1.1.0", + "undefined": "2.0.0", + "undefined-is-not-a-problem": "1.1.0", + "unfoldable": "6.0.0", + "unicode": "6.0.0", + "unique": "0.6.1", + "unlift": "1.0.1", + "unordered-collections": "3.1.0", + "unsafe-coerce": "6.0.0", + "unsafe-reference": "5.0.0", + "untagged-to-tagged": "0.1.4", + "untagged-union": "1.0.0", + "uri": "9.0.0", + "url-immutable": "1.0.0", + "url-regex-safe": "0.1.1", + "uuid": "9.0.0", + "uuidv4": "1.0.0", + "validation": "6.0.0", + "variant": "8.0.0", + "variant-encodings": "2.0.0", + "variant-gen": "1.0.0", + "vectorfield": "1.0.1", + "vectors": "2.1.0", + "versions": "7.0.0", + "visx": "0.0.2", + "vitest": "1.0.0", + "web-clipboard": "6.0.0", + "web-cssom": "2.0.0", + "web-cssom-view": "0.1.0", + "web-dom": "6.0.0", + "web-dom-parser": "8.0.0", + "web-dom-xpath": "3.0.0", + "web-encoding": "3.0.0", + "web-events": "4.0.0", + "web-fetch": "4.0.1", + "web-file": "4.0.0", + "web-geometry": "0.1.0", + "web-html": "4.1.0", + "web-pointerevents": "2.0.0", + "web-proletarian": "1.0.0", + "web-promise": "3.2.0", + "web-resize-observer": "2.1.0", + "web-router": "1.0.0", + "web-socket": "4.0.0", + "web-storage": "5.0.0", + "web-streams": "4.0.0", + "web-touchevents": "4.0.0", + "web-uievents": "5.0.0", + "web-url": "2.0.0", + "web-workers": "1.1.0", + "web-xhr": "5.0.1", + "webextension-polyfill": "0.1.0", + "webgpu": "0.0.1", + "which": "2.0.0", + "whine-core": "0.0.28", + "xterm": "1.0.0", + "yoga-fetch": "1.0.1", + "yoga-json": "5.1.0", + "yoga-om": "0.1.0", + "yoga-postgres": "6.0.0", + "yoga-react-dom": "1.0.1", + "yoga-subtlecrypto": "0.1.0", + "yoga-tree": "1.0.0", + "z3": "0.0.2", + "zipperarray": "2.0.0" + } + }, + "extra_packages": {} + }, + "packages": { + "arrays": { + "type": "registry", + "version": "7.3.0", + "integrity": "sha256-tmcklBlc/muUtUfr9RapdCPwnlQeB3aSrC4dK85gQlc=", + "dependencies": [ + "bifunctors", + "control", + "foldable-traversable", + "functions", + "maybe", + "nonempty", + "partial", + "prelude", + "safe-coerce", + "st", + "tailrec", + "tuples", + "unfoldable", + "unsafe-coerce" + ] + }, + "bifunctors": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-6enQzl1vqnFTQZ1WX9BnoOOVdPGO9WZvVXldHckVQvY=", + "dependencies": [ + "const", + "either", + "newtype", + "prelude", + "tuples" + ] + }, + "const": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-tNrxDW8D8H4jdHE2HiPzpLy08zkzJMmGHdRqt5BQuTc=", + "dependencies": [ + "invariant", + "newtype", + "prelude" + ] + }, + "contravariant": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-TP+ooAp3vvmdjfQsQJSichF5B4BPDHp3wAJoWchip6c=", + "dependencies": [ + "const", + "either", + "newtype", + "prelude", + "tuples" + ] + }, + "control": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-sH7Pg9E96JCPF9PIA6oQ8+BjTyO/BH1ZuE/bOcyj4Jk=", + "dependencies": [ + "newtype", + "prelude" + ] + }, + "distributive": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-HTDdmEnzigMl+02SJB88j+gAXDx9VKsbvR4MJGDPbOQ=", + "dependencies": [ + "identity", + "newtype", + "prelude", + "tuples", + "type-equality" + ] + }, + "effect": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-eBtZu+HZcMa5HilvI6kaDyVX3ji8p0W9MGKy2K4T6+M=", + "dependencies": [ + "prelude" + ] + }, + "either": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-6hgTPisnMWVwQivOu2PKYcH8uqjEOOqDyaDQVUchTpY=", + "dependencies": [ + "control", + "invariant", + "maybe", + "prelude" + ] + }, + "exceptions": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-K0T89IHtF3vBY7eSAO7eDOqSb2J9kZGAcDN5+IKsF8E=", + "dependencies": [ + "effect", + "either", + "maybe", + "prelude" + ] + }, + "exists": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-A0JQHpTfo1dNOj9U5/Fd3xndlRSE0g2IQWOGor2yXn8=", + "dependencies": [ + "unsafe-coerce" + ] + }, + "filterable": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-cCojJHRnTmpY1j1kegI4CFwghdQ2Fm/8dzM8IlC+lng=", + "dependencies": [ + "arrays", + "either", + "foldable-traversable", + "identity", + "lists", + "ordered-collections" + ] + }, + "foldable-traversable": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-fLeqRYM4jUrZD5H4WqcwUgzU7XfYkzO4zhgtNc3jcWM=", + "dependencies": [ + "bifunctors", + "const", + "control", + "either", + "functors", + "identity", + "maybe", + "newtype", + "orders", + "prelude", + "tuples" + ] + }, + "foldable-traversable-extra": { + "type": "registry", + "version": "0.0.6", + "integrity": "sha256-S4+D9xs+lLO7p9+Y4M2XYHafaHlciY1jpGqCGmwfZdc=", + "dependencies": [ + "arrays", + "either", + "foldable-traversable", + "maybe", + "ordered-collections", + "partial", + "prelude", + "transformers", + "tuples" + ] + }, + "functions": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-adMyJNEnhGde2unHHAP79gPtlNjNqzgLB8arEOn9hLI=", + "dependencies": [ + "prelude" + ] + }, + "functors": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-zfPWWYisbD84MqwpJSZFlvM6v86McM68ob8p9s27ywU=", + "dependencies": [ + "bifunctors", + "const", + "contravariant", + "control", + "distributive", + "either", + "invariant", + "maybe", + "newtype", + "prelude", + "profunctor", + "tuples", + "unsafe-coerce" + ] + }, + "gen": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-f7yzAXWwr+xnaqEOcvyO3ezKdoes8+WXWdXIHDBCAPI=", + "dependencies": [ + "either", + "foldable-traversable", + "identity", + "maybe", + "newtype", + "nonempty", + "prelude", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "identity": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-4wY0XZbAksjY6UAg99WkuKyJlQlWAfTi2ssadH0wVMY=", + "dependencies": [ + "control", + "invariant", + "newtype", + "prelude" + ] + }, + "invariant": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-RGWWyYrz0Hs1KjPDA+87Kia67ZFBhfJ5lMGOMCEFoLo=", + "dependencies": [ + "control", + "prelude" + ] + }, + "lazy": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-lMsfFOnlqfe4KzRRiW8ot5ge6HtcU3Eyh2XkXcP5IgU=", + "dependencies": [ + "control", + "foldable-traversable", + "invariant", + "prelude" + ] + }, + "lists": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-EKF15qYqucuXP2lT/xPxhqy58f0FFT6KHdIB/yBOayI=", + "dependencies": [ + "bifunctors", + "control", + "foldable-traversable", + "lazy", + "maybe", + "newtype", + "nonempty", + "partial", + "prelude", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "maybe": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-5cCIb0wPwbat2PRkQhUeZO0jcAmf8jCt2qE0wbC3v2Q=", + "dependencies": [ + "control", + "invariant", + "newtype", + "prelude" + ] + }, + "newtype": { + "type": "registry", + "version": "5.0.0", + "integrity": "sha256-gdrQu8oGe9eZE6L3wOI8ql/igOg+zEGB5ITh2g+uttw=", + "dependencies": [ + "prelude", + "safe-coerce" + ] + }, + "nonempty": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-54ablJZUHGvvlTJzi3oXyPCuvY6zsrWJuH/dMJ/MFLs=", + "dependencies": [ + "control", + "foldable-traversable", + "maybe", + "prelude", + "tuples", + "unfoldable" + ] + }, + "ordered-collections": { + "type": "registry", + "version": "3.2.0", + "integrity": "sha256-o9jqsj5rpJmMdoe/zyufWHFjYYFTTsJpgcuCnqCO6PM=", + "dependencies": [ + "arrays", + "foldable-traversable", + "gen", + "lists", + "maybe", + "partial", + "prelude", + "st", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "orders": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-nBA0g3/ai0euH8q9pSbGqk53W2q6agm/dECZTHcoink=", + "dependencies": [ + "newtype", + "prelude" + ] + }, + "partial": { + "type": "registry", + "version": "4.0.0", + "integrity": "sha256-fwXerld6Xw1VkReh8yeQsdtLVrjfGiVuC5bA1Wyo/J4=", + "dependencies": [] + }, + "prelude": { + "type": "registry", + "version": "6.0.2", + "integrity": "sha256-kiAPZxihtAel8uRiTNdccf4qylp/9J3jNkEHNAD0MsE=", + "dependencies": [] + }, + "profunctor": { + "type": "registry", + "version": "6.0.1", + "integrity": "sha256-E58hSYdJvF2Qjf9dnWLPlJKh2Z2fLfFLkQoYi16vsFk=", + "dependencies": [ + "control", + "distributive", + "either", + "exists", + "invariant", + "newtype", + "prelude", + "tuples" + ] + }, + "refs": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-Vgwne7jIbD3ZMoLNNETLT8Litw6lIYo3MfYNdtYWj9s=", + "dependencies": [ + "effect", + "prelude" + ] + }, + "safe-coerce": { + "type": "registry", + "version": "2.0.0", + "integrity": "sha256-a1ibQkiUcbODbLE/WAq7Ttbbh9ex+x33VCQ7GngKudU=", + "dependencies": [ + "unsafe-coerce" + ] + }, + "st": { + "type": "registry", + "version": "6.2.0", + "integrity": "sha256-z9X0WsOUlPwNx9GlCC+YccCyz8MejC8Wb0C4+9fiBRY=", + "dependencies": [ + "partial", + "prelude", + "tailrec", + "unsafe-coerce" + ] + }, + "tailrec": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-Xx19ECVDRrDWpz9D2GxQHHV89vd61dnXxQm0IcYQHGk=", + "dependencies": [ + "bifunctors", + "effect", + "either", + "identity", + "maybe", + "partial", + "prelude", + "refs" + ] + }, + "transformers": { + "type": "registry", + "version": "6.1.0", + "integrity": "sha256-3Bm+Z6tsC/paG888XkywDngJ2JMos+JfOhRlkVfb7gI=", + "dependencies": [ + "control", + "distributive", + "effect", + "either", + "exceptions", + "foldable-traversable", + "identity", + "lazy", + "maybe", + "newtype", + "prelude", + "st", + "tailrec", + "tuples", + "unfoldable" + ] + }, + "tuples": { + "type": "registry", + "version": "7.0.0", + "integrity": "sha256-1rXgTomes9105BjgXqIw0FL6Fz1lqqUTLWOumhWec1M=", + "dependencies": [ + "control", + "invariant", + "prelude" + ] + }, + "type-equality": { + "type": "registry", + "version": "4.0.1", + "integrity": "sha256-Hs9D6Y71zFi/b+qu5NSbuadUQXe5iv5iWx0226vOHUw=", + "dependencies": [] + }, + "unfoldable": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-JtikvJdktRap7vr/K4ITlxUX1QexpnqBq0G/InLr6eg=", + "dependencies": [ + "foldable-traversable", + "maybe", + "partial", + "prelude", + "tuples" + ] + }, + "unsafe-coerce": { + "type": "registry", + "version": "6.0.0", + "integrity": "sha256-IqIYW4Vkevn8sI+6aUwRGvd87tVL36BBeOr0cGAE7t0=", + "dependencies": [] + } + } +} diff --git a/spago.yaml b/spago.yaml index e8ce99d..53ff211 100644 --- a/spago.yaml +++ b/spago.yaml @@ -6,7 +6,9 @@ package: - filterable: ">=5.0.0 <6.0.0" - foldable-traversable: ">=6.0.0 <7.0.0" - foldable-traversable-extra: ">=0.0.5 <0.0.6" + - functions: ">=6.0.0 <7.0.0" - maybe: ">=6.0.0 <7.0.0" + - ordered-collections: ">=3.2.0 <4.0.0" - partial: ">=4.0.0 <5.0.0" - prelude: ">=6.0.1 <7.0.0" - tuples: ">=7.0.0 <8.0.0" @@ -17,5 +19,5 @@ package: githubOwner: flip111 githubRepo: purescript-arrays-extra workspace: - package_set: - registry: 49.0.0 + packageSet: + registry: 64.6.0 diff --git a/src/Data/Array/Extra.purs b/src/Data/Array/Extra.purs index f6e3d0e..02bc79e 100644 --- a/src/Data/Array/Extra.purs +++ b/src/Data/Array/Extra.purs @@ -13,36 +13,30 @@ module Data.Array.Extra , interleave , exactlyOne , maybeToArray + , orderByArray + , orderByArrayOrd , module Data.Foldable.Extra , module Data.Semigroup.Foldable.Extra , module Data.Traversable.Extra ) where -import Data.Foldable.Extra -import Data.Semigroup.Foldable.Extra -import Data.Traversable.Extra +import Data.Foldable.Extra (allPredicate, anyPredicate, groupMaybe, groupMaybeMap, mapEither, mapMaybeAny, occurrences, occurrencesMap, partitionMaybe, sameElements) +import Data.Semigroup.Foldable.Extra (mapAny) +import Data.Traversable.Extra (mapAll, mapMaybeWrite, mapMaybeWriteModify, mapModify) +import Prelude -import Control.Semigroupoid ((<<<)) -import Data.Array (catMaybes, cons, head, length, sortBy, uncons, findIndex) +import Data.Array (catMaybes, cons, findIndex, head, length, mapWithIndex, sortBy, uncons) import Data.Array.NonEmpty (NonEmptyArray) import Data.Array.NonEmpty as NEA import Data.Either (Either) -import Data.Eq (class Eq, (==)) import Data.Filterable (partitionMap) import Data.Foldable (fold) import Data.Function (on) -import Data.Functor (map) -import Data.HeytingAlgebra ((||)) import Data.Map as Map -import Data.Maybe (Maybe(..), fromJust) -import Data.Ord (class Ord, comparing, (<), (>)) -import Data.Ordering (Ordering(..)) -import Data.Ring ((-)) -import Data.Semigroup ((<>)) +import Data.Maybe (Maybe(..), fromJust, fromMaybe) import Data.Tuple (Tuple(..), fst, snd) import Partial.Unsafe (unsafePartial) - -- | Sort by multiple comparison functions. -- | Similar to SQL where you can specificy multiple columns with ASC and DESC. -- | When a comparison function gives EQ the next one is tried. @@ -74,7 +68,7 @@ sortOn f = sortBy (comparing f) -- | sortOn' (\x -> if x == "dog" then 2 else 1) ["apple", "dog", "kiwi"] = ["apple", "kiwi", "dog"] -- | ``` sortOn' :: forall a b. Ord b => (a -> b) -> Array a -> Array a -sortOn' f = map snd <<< sortBy (comparing fst) <<< map (\x -> let y = f x in Tuple y x) +sortOn' f = map snd <<< sortBy (comparing fst) <<< map (\x -> let y = f x in Tuple y x) -- | Sort a list by a projection and sort by a given comparison function. -- | @@ -102,11 +96,13 @@ sortOnBy' f comp = map snd <<< sortBy (comp `on` fst) <<< map (\x -> let y = f x -- Implementers note: this could be simplified with https://github.com/purescript/purescript-prelude/issues/310 sortOnByMaybe :: forall a b. (a -> Maybe b) -> (b -> b -> Ordering) -> Array a -> Array a sortOnByMaybe f comp xs = - let g Nothing Nothing = EQ - g (Just _) Nothing = GT - g Nothing (Just _) = LT - g (Just a) (Just b) = comp a b - in sortOnBy f g xs + let + g Nothing Nothing = EQ + g (Just _) Nothing = GT + g Nothing (Just _) = LT + g (Just a) (Just b) = comp a b + in + sortOnBy f g xs -- | Sort a list by a projection and sort by a given comparison function. -- | When the projection returns Nothing those items will be placed last. Useful if your Array contains items with missing data to sort on @@ -117,11 +113,13 @@ sortOnByMaybe f comp xs = -- | ``` sortOnByMaybe' :: forall a b. (a -> Maybe b) -> (b -> b -> Ordering) -> Array a -> Array a sortOnByMaybe' f comp xs = - let g Nothing Nothing = EQ - g (Just _) Nothing = GT - g Nothing (Just _) = LT - g (Just a) (Just b) = comp a b - in sortOnBy' f g xs + let + g Nothing Nothing = EQ + g (Just _) Nothing = GT + g Nothing (Just _) = LT + g (Just a) (Just b) = comp a b + in + sortOnBy' f g xs -- | Partitions an array of Either into two arrays. All the Left elements are put, in order, into the left field of the output record. Similarly the Right elements are put into the right field of the output record. -- | Note that this function is an alias for `partitionMap` from `Data.Filterable`. @@ -130,7 +128,7 @@ sortOnByMaybe' f comp xs = -- | ```purescript -- | partitionEithers (\a -> if a > 2 then Left a else Right a) [1,2,3,4] == {left: [1,2], right: [3,4]} -- | ``` -partitionEithers :: forall a l r. (a -> Either l r) -> Array a -> {left :: Array l, right :: Array r} +partitionEithers :: forall a l r. (a -> Either l r) -> Array a -> { left :: Array l, right :: Array r } partitionEithers = partitionMap -- -- | Like unionBy between array A and array B. With elements left out from B being included when they match the predicate. @@ -165,14 +163,16 @@ partitionEithers = partitionMap -- | ``` combinations :: forall a. Int -> Array a -> Maybe (Array (NonEmptyArray a)) combinations n xs = - let f 0 _ = [[]] - f nn xs' = case uncons xs' of - Nothing -> [] - Just {head, tail} -> map (cons head) (f (nn - 1) tail) <> f n tail - in if n < 1 || n > length xs then - Nothing - else - Just (map (\x -> unsafePartial (fromJust (NEA.fromArray x))) (f n xs)) + let + f 0 _ = [ [] ] + f nn xs' = case uncons xs' of + Nothing -> [] + Just { head, tail } -> map (cons head) (f (nn - 1) tail) <> f n tail + in + if n < 1 || n > length xs then + Nothing + else + Just (map (\x -> unsafePartial (fromJust (NEA.fromArray x))) (f n xs)) -- | Takes an element from each array in turn to produce a new array. -- | @@ -182,12 +182,16 @@ combinations n xs = -- | ``` interleave :: forall a. Array (Array a) -> Array a interleave xss = - let f :: Tuple (Array (Array a)) (Array a) -> Tuple (Array (Array a)) (Array a) - f (Tuple [] acc) = Tuple [] acc - f (Tuple xss' acc) = - let heads_tails = catMaybes (map uncons xss') - in f (Tuple (map (_.tail) heads_tails) (map (_.head) heads_tails <> acc)) - in snd (f (Tuple xss [])) + let + f :: Tuple (Array (Array a)) (Array a) -> Tuple (Array (Array a)) (Array a) + f (Tuple [] acc) = Tuple [] acc + f (Tuple xss' acc) = + let + heads_tails = catMaybes (map uncons xss') + in + f (Tuple (map (_.tail) heads_tails) (map (_.head) heads_tails <> acc)) + in + snd (f (Tuple xss [])) -- | When the array has only one element, return this element. -- | This function is the opposite from `singleton`. @@ -212,8 +216,8 @@ exactlyOne xs = case length xs of -- | maybeToArray (Just 2) == [2] -- | ``` maybeToArray :: forall a. Maybe a -> Array a -maybeToArray Nothing = [] -maybeToArray (Just value) = [value] +maybeToArray Nothing = [] +maybeToArray (Just value) = [ value ] -- | Given two arrays, sort the second one by the order of the first one -- | The elements of each array will be compared to each other with their own projection functions. @@ -225,14 +229,16 @@ maybeToArray (Just value) = [value] -- | ``` orderByArray :: forall x y a. Eq a => (x -> a) -> (y -> a) -> Array x -> Array y -> Array y orderByArray proj_x proj_y xs ys = - let findIndexY y = findIndex (\x -> proj_x x == proj_y y) xs - compareIndices y1 y2 = - case Tuple (findIndexY y1) (findIndexY y2) of - Tuple (Just i1) (Just i2) -> compare i1 i2 - Tuple (Just _) Nothing -> LT - Tuple Nothing (Just _) -> GT - Tuple Nothing Nothing -> EQ - in sortBy compareIndices ys + let + findIndexY y = findIndex (\x -> proj_x x == proj_y y) xs + compareIndices y1 y2 = + case Tuple (findIndexY y1) (findIndexY y2) of + Tuple (Just i1) (Just i2) -> compare i1 i2 + Tuple (Just _) Nothing -> LT + Tuple Nothing (Just _) -> GT + Tuple Nothing Nothing -> EQ + in + sortBy compareIndices ys -- | Given two arrays, sort the second one by the order of the first one -- | The elements of each array will be compared to each other with their own projection functions. @@ -241,8 +247,10 @@ orderByArray proj_x proj_y xs ys = -- | Same as `orderByArray` but potentially faster due to using a Map internally. You will have to benchmark your specific situation to find out whether `orderByArray` or `orderByArrayOrd'` is faster. orderByArrayOrd :: forall x y a. Ord a => (x -> a) -> (y -> a) -> Array x -> Array y -> Array y orderByArrayOrd proj_x proj_y xs ys = - let indexMap = Map.fromFoldable (mapWithIndex (\i x -> Tuple (proj_x x) i) xs) - in sortBy (comparing (\y -> fromMaybe (length xs) $ Map.lookup (proj_y y) indexMap)) ys + let + indexMap = Map.fromFoldable (mapWithIndex (\i x -> Tuple (proj_x x) i) xs) + in + sortBy (comparing (\y -> fromMaybe (length xs) $ Map.lookup (proj_y y) indexMap)) ys -- zipOn :: forall a b c d. (a -> Maybe d) (b -> Maybe d) (a -> b -> c) -> Array a -> Array b -> Array c -- zipOn f_a f_b c xs ys -- start searching the smallest array first diff --git a/src/Data/Array/Extra/All.purs b/src/Data/Array/Extra/All.purs index 2ebf654..8cf522e 100644 --- a/src/Data/Array/Extra/All.purs +++ b/src/Data/Array/Extra/All.purs @@ -24,7 +24,8 @@ findIndices f xs = map snd (filter (\(Tuple x _) -> f x) (zip xs (range 0 (lengt -- | ``` updateAllWith :: forall a. (a -> Boolean) -> a -> Array a -> Array a updateAllWith f a xs = foldl go xs (findIndices f xs) - where go arr idx = unsafePartial (unsafeUpdateAt idx a arr) + where + go arr idx = unsafePartial (unsafeUpdateAt idx a arr) -- | Find an element by a predicate and return an array with the element replaced by an array. -- | @@ -33,7 +34,8 @@ updateAllWith f a xs = foldl go xs (findIndices f xs) -- | ``` updateAllArrayWith :: forall a. Partial => (a -> Boolean) -> Array a -> Array a -> Array a updateAllArrayWith f xs ys = foldl go ys (findIndices f ys) - where go arr idx = unsafePartial (unsafeInsertArray idx xs arr) + where + go arr idx = unsafePartial (unsafeInsertArray idx xs arr) -- | Find all elements matching a predicate and modify each element found. -- | @@ -42,7 +44,8 @@ updateAllArrayWith f xs ys = foldl go ys (findIndices f ys) -- | ``` modifyAllWith :: forall a. (a -> Boolean) -> (a -> a) -> Array a -> Array a modifyAllWith f modifier xs = foldl go xs (findIndices f xs) - where go arr idx = unsafePartial (unsafeModifyAt idx modifier arr) + where + go arr idx = unsafePartial (unsafeModifyAt idx modifier arr) -- | Find an element and return an array without that element when it was found. -- | @@ -70,4 +73,4 @@ difference :: forall a. Eq a => Array a -> Array a -> Array a difference xs ys = foldl (\xss y -> deleteWith (\x -> x == y) xss) xs ys -- todo: using Set is probably faster (see haskell code) --- todo: differenceBy \ No newline at end of file +-- todo: differenceBy diff --git a/src/Data/Array/Extra/First.purs b/src/Data/Array/Extra/First.purs index 21f8f77..ba1f025 100644 --- a/src/Data/Array/Extra/First.purs +++ b/src/Data/Array/Extra/First.purs @@ -17,13 +17,15 @@ import Partial.Unsafe (unsafePartial) -- | ```purescript -- | pick (_ == 2) [1,2,3] == Just {yes: 2, no: [1,3]} -- | ``` -pick :: forall a. (a -> Boolean) -> Array a -> Maybe {yes :: a, no :: Array a} +pick :: forall a. (a -> Boolean) -> Array a -> Maybe { yes :: a, no :: Array a } pick f xs = case findIndex f xs of - Nothing -> Nothing + Nothing -> Nothing Just idx -> - let elem = unsafePartial (unsafeIndex xs idx) - rest = unsafePartial (unsafeDeleteAt idx xs) - in Just {yes: elem, no: rest} + let + elem = unsafePartial (unsafeIndex xs idx) + rest = unsafePartial (unsafeDeleteAt idx xs) + in + Just { yes: elem, no: rest } -- | Find an element and return an array without that element when it was found. -- | @@ -73,7 +75,7 @@ modifyWith f modifier xs = map (\idx -> unsafePartial (unsafeModifyAt idx modifi -- | ``` modifyOrSnoc :: forall a. (a -> Boolean) -> (a -> a) -> Array a -> a -> Array a modifyOrSnoc f modifier xs x = case findIndex f xs of - Nothing -> snoc xs x + Nothing -> snoc xs x Just idx -> unsafePartial (unsafeModifyAt idx modifier xs) -- | Modify an element when it was found by the predicate or push a new element to the front of the array. @@ -84,7 +86,7 @@ modifyOrSnoc f modifier xs x = case findIndex f xs of -- | ``` modifyOrCons :: forall a. (a -> Boolean) -> (a -> a) -> a -> Array a -> Array a modifyOrCons f modifier x xs = case findIndex f xs of - Nothing -> cons x xs + Nothing -> cons x xs Just idx -> unsafePartial (unsafeModifyAt idx modifier xs) -- | Update an element when it was found by the predicate or append a new element to the end of the array. @@ -95,7 +97,7 @@ modifyOrCons f modifier x xs = case findIndex f xs of -- | ``` updateOrSnoc :: forall a. (a -> Boolean) -> Array a -> a -> Array a updateOrSnoc f xs x = case findIndex f xs of - Nothing -> snoc xs x + Nothing -> snoc xs x Just idx -> unsafePartial (unsafeUpdateAt idx x xs) -- | Update an element when it was found by the predicate or push a new element to the front of the array. @@ -106,7 +108,7 @@ updateOrSnoc f xs x = case findIndex f xs of -- | ``` updateOrCons :: forall a. (a -> Boolean) -> a -> Array a -> Array a updateOrCons f x xs = case findIndex f xs of - Nothing -> cons x xs + Nothing -> cons x xs Just idx -> unsafePartial (unsafeUpdateAt idx x xs) -- | Finds a single element and returns it together with elements before and after. @@ -114,10 +116,10 @@ updateOrCons f x xs = case findIndex f xs of -- | ```purescript -- | partitionSides (_ == 3) [1,2,3,4,5] == Just {before: [1,2], found: 3, after: [4,5]} -- | ``` -splitOn :: forall a. (a -> Boolean) -> Array a -> Maybe {before :: Array a, found :: a, after :: Array a} +splitOn :: forall a. (a -> Boolean) -> Array a -> Maybe { before :: Array a, found :: a, after :: Array a } splitOn f xs = case findIndex f xs of - Nothing -> Nothing - Just idx -> Just {before: take idx xs, found: unsafePartial (unsafeIndex xs idx), after: drop (idx + 1) xs} + Nothing -> Nothing + Just idx -> Just { before: take idx xs, found: unsafePartial (unsafeIndex xs idx), after: drop (idx + 1) xs } -- | Find an element and place an element before it. -- | Could also be thought of as placing the element in the place of the found element and moving al later elements. @@ -127,7 +129,7 @@ splitOn f xs = case findIndex f xs of -- | ``` insertBefore :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) insertBefore f x xs = case findIndex f xs of - Nothing -> Nothing + Nothing -> Nothing Just idx -> insertAt idx x xs -- | Find an element and place an element after it. @@ -137,7 +139,7 @@ insertBefore f x xs = case findIndex f xs of -- | ``` insertAfter :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) insertAfter f x xs = case findIndex f xs of - Nothing -> Nothing + Nothing -> Nothing Just idx -> insertAt (idx + 1) x xs -- | Find an element which could be projected into another value. @@ -148,10 +150,10 @@ insertAfter f x xs = case findIndex f xs of -- | ``` findMaybe :: forall a b. (a -> Maybe b) -> Array a -> Maybe b findMaybe f xs = case uncons xs of - Nothing -> Nothing + Nothing -> Nothing Just { head, tail } -> case f head of Just projection -> Just projection - Nothing -> findMaybe f tail + Nothing -> findMaybe f tail -- | Re-export of `difference` from `Data.Array` -- | diff --git a/src/Data/Array/Extra/Insert.purs b/src/Data/Array/Extra/Insert.purs index 08cebab..9fc6a3c 100644 --- a/src/Data/Array/Extra/Insert.purs +++ b/src/Data/Array/Extra/Insert.purs @@ -18,16 +18,16 @@ import Partial.Unsafe (unsafePartial) -- | ``` snocWith :: forall a. (a -> Boolean) -> Array a -> a -> Maybe (Array a) snocWith pred xs x = case findIndex pred xs of - Just _ -> Nothing + Just _ -> Nothing Nothing -> Just (snoc xs x) - + -- | Append an element to the end of the array when it could not be found. -- | -- | ```purescript -- | snocWith' [1,3] 2 == Just [1,3,2] -- | ``` snocWith' :: forall a. Eq a => Array a -> a -> Maybe (Array a) -snocWith' xs x = +snocWith' xs x = if elem x xs then Nothing else @@ -38,9 +38,9 @@ snocWith' xs x = -- | ```purescript -- | consWith 2 [1,3] == Just [2,1,3] -- | ``` -consWith :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) +consWith :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) consWith pred x xs = case findIndex pred xs of - Just _ -> Nothing + Just _ -> Nothing Nothing -> Just (cons x xs) -- | Find an element and when it was not found return an array with the element pushed to the front. @@ -48,7 +48,7 @@ consWith pred x xs = case findIndex pred xs of -- | ```purescript -- | consWith [1,3] 2 == Just [2,1,3] -- | ``` -consWith' :: forall a. Eq a => a -> Array a -> Maybe (Array a) +consWith' :: forall a. Eq a => a -> Array a -> Maybe (Array a) consWith' x xs = if elem x xs then Nothing @@ -62,7 +62,7 @@ consWith' x xs = -- | ``` insertByWith :: forall a. (a -> Boolean) -> (a -> a -> Ordering) -> a -> Array a -> Maybe (Array a) insertByWith pred comp x xs = case findIndex pred xs of - Just _ -> Nothing + Just _ -> Nothing Nothing -> Just (insertBy comp x xs) -- | Insert the element into a sorted array but only if the element didn't exist before. diff --git a/src/Data/Array/Extra/Last.purs b/src/Data/Array/Extra/Last.purs index 71e5a0f..684eb45 100644 --- a/src/Data/Array/Extra/Last.purs +++ b/src/Data/Array/Extra/Last.purs @@ -15,13 +15,15 @@ import Partial.Unsafe (unsafePartial) -- | ```purescript -- | pick (_ == 2) [1,2,3] == Just {yes: 2, no: [1,3]} -- | ``` -pick :: forall a. (a -> Boolean) -> Array a -> Maybe {yes :: a, no :: Array a} +pick :: forall a. (a -> Boolean) -> Array a -> Maybe { yes :: a, no :: Array a } pick f xs = case findLastIndex f xs of Nothing -> Nothing Just idx -> - let elem = unsafePartial (unsafeIndex xs idx) - rest = unsafePartial (unsafeDeleteAt idx xs) - in Just {yes: elem, no: rest} + let + elem = unsafePartial (unsafeIndex xs idx) + rest = unsafePartial (unsafeDeleteAt idx xs) + in + Just { yes: elem, no: rest } -- | Find an element and return an array without that element when it was found. -- | @@ -71,7 +73,7 @@ modifyWith f modifier xs = map (\idx -> unsafePartial (unsafeModifyAt idx modifi -- | ``` modifyOrSnoc :: forall a. (a -> Boolean) -> (a -> a) -> Array a -> a -> Array a modifyOrSnoc f modifier xs x = case findLastIndex f xs of - Nothing -> snoc xs x + Nothing -> snoc xs x Just idx -> unsafePartial (unsafeModifyAt idx modifier xs) -- | Modify an element when it was found by the predicate or push a new element to the front of the array. @@ -82,7 +84,7 @@ modifyOrSnoc f modifier xs x = case findLastIndex f xs of -- | ``` modifyOrCons :: forall a. (a -> Boolean) -> (a -> a) -> a -> Array a -> Array a modifyOrCons f modifier x xs = case findLastIndex f xs of - Nothing -> cons x xs + Nothing -> cons x xs Just idx -> unsafePartial (unsafeModifyAt idx modifier xs) -- | Update an element when it was found by the predicate or append a new element to the end of the array. @@ -93,7 +95,7 @@ modifyOrCons f modifier x xs = case findLastIndex f xs of -- | ``` updateOrSnoc :: forall a. (a -> Boolean) -> Array a -> a -> Array a updateOrSnoc f xs x = case findLastIndex f xs of - Nothing -> snoc xs x + Nothing -> snoc xs x Just idx -> unsafePartial (unsafeUpdateAt idx x xs) -- | Update an element when it was found by the predicate or push a new element to the front of the array. @@ -104,7 +106,7 @@ updateOrSnoc f xs x = case findLastIndex f xs of -- | ``` updateOrCons :: forall a. (a -> Boolean) -> a -> Array a -> Array a updateOrCons f x xs = case findLastIndex f xs of - Nothing -> cons x xs + Nothing -> cons x xs Just idx -> unsafePartial (unsafeUpdateAt idx x xs) -- | Finds a single element and returns it together with elements before and after. @@ -112,10 +114,10 @@ updateOrCons f x xs = case findLastIndex f xs of -- | ```purescript -- | partitionSides (_ == 3) [1,2,3,4,5] == Just {before: [1,2], found: 3, after: [4,5]} -- | ``` -splitOn :: forall a. (a -> Boolean) -> Array a -> Maybe {before :: Array a, found :: a, after :: Array a} +splitOn :: forall a. (a -> Boolean) -> Array a -> Maybe { before :: Array a, found :: a, after :: Array a } splitOn f xs = case findLastIndex f xs of - Nothing -> Nothing - Just idx -> Just {before: take idx xs, found: unsafePartial (unsafeIndex xs idx), after: drop (idx + 1) xs} + Nothing -> Nothing + Just idx -> Just { before: take idx xs, found: unsafePartial (unsafeIndex xs idx), after: drop (idx + 1) xs } -- | Find an element and place an element before it. -- | Could also be thought of as placing the element in the place of the found element and moving al later elements. @@ -125,7 +127,7 @@ splitOn f xs = case findLastIndex f xs of -- | ``` insertBefore :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) insertBefore f x xs = case findLastIndex f xs of - Nothing -> Nothing + Nothing -> Nothing Just idx -> insertAt idx x xs -- | Find an element and place an element after it. @@ -135,7 +137,7 @@ insertBefore f x xs = case findLastIndex f xs of -- | ``` insertAfter :: forall a. (a -> Boolean) -> a -> Array a -> Maybe (Array a) insertAfter f x xs = case findLastIndex f xs of - Nothing -> Nothing + Nothing -> Nothing Just idx -> insertAt (idx + 1) x xs -- | Find an element which could be projected into another value. @@ -146,9 +148,9 @@ insertAfter f x xs = case findLastIndex f xs of -- | ``` findMaybe :: forall a b. (a -> Maybe b) -> Array a -> Maybe b findMaybe f xs = case unsnoc xs of - Nothing -> Nothing + Nothing -> Nothing Just { init, last } -> case f last of Just projection -> Just projection - Nothing -> findMaybe f init + Nothing -> findMaybe f init --- todo: difference \ No newline at end of file +-- todo: difference diff --git a/src/Data/Array/Extra/NonEmpty.purs b/src/Data/Array/Extra/NonEmpty.purs new file mode 100644 index 0000000..578245f --- /dev/null +++ b/src/Data/Array/Extra/NonEmpty.purs @@ -0,0 +1,15 @@ +module Data.Array.Extra.NonEmpty where + +import Prelude + +import Data.Array.Extra (partitionEithers) +import Data.Array.NonEmpty (NonEmptyArray) +import Data.Array.NonEmpty as NonEmptyArray +import Data.Either (Either) + +-- | ```purescript +-- | partitionEithers1 (\a -> if a > 2 then Left a else Right a) [1,2,3,4] == Result: { head: Right 1, tail: { left: [3, 4], right: [2] } } +-- | ``` +-- | other variant - is to return `Either { left NonEmptyArray l, right: Array r } { left Array l, right: NonEmptyArray r }` +partitionEithers1 :: forall a l r. (a -> Either l r) -> NonEmptyArray a -> { head :: Either l r, tail :: { left :: Array l, right :: Array r } } +partitionEithers1 f = NonEmptyArray.uncons >>> \{ head, tail } -> { head: f head, tail: partitionEithers f tail } diff --git a/src/Data/Array/Extra/Unsafe.js b/src/Data/Array/Extra/Unsafe.js index 7c4adcb..72e5e6b 100644 --- a/src/Data/Array/Extra/Unsafe.js +++ b/src/Data/Array/Extra/Unsafe.js @@ -1,47 +1,29 @@ -"use strict"; - -export const unsafeInsertAtImpl = function (i) { - return function (a) { - return function (l) { - var l1 = l.slice(); - l1.splice(i, 0, a); - return l1; - }; - }; +export const unsafeInsertAtImpl = function (i, a, l) { + var l1 = l.slice(); + l1.splice(i, 0, a); + return l1; }; -export const unsafeInsertArrayImpl = function (i) { - return function (a) { - return function (l) { - return l.splice.apply(l, [i, 0].concat(a)); - }; - }; +export const unsafeInsertArrayImpl = function (i, a, l) { + var l1 = l.slice(); + l1.splice.apply(l1, [i, 0].concat(a)); + return l1; }; -export const unsafeDeleteAtImpl = function (i) { - return function (l) { - var l1 = l.slice(); - l1.splice(i, 1); - return l1; - }; +export const unsafeDeleteAtImpl = function (i, l) { + var l1 = l.slice(); + l1.splice(i, 1); + return l1; }; -export const unsafeUpdateAtImpl = function (i) { - return function (a) { - return function (l) { - var l1 = l.slice(); - l1[i] = a; - return l1; - }; - }; +export const unsafeUpdateAtImpl = function (i, a, l) { + var l1 = l.slice(); + l1[i] = a; + return l1; }; -export const unsafeModifyAtImpl = function (i) { - return function (f) { - return function (l) { - var l1 = l.slice(); - l1[i] = f(l1[i]); - return l1; - }; - }; +export const unsafeModifyAtImpl = function (i, f, l) { + var l1 = l.slice(); + l1[i] = f(l1[i]); + return l1; }; diff --git a/src/Data/Array/Extra/Unsafe.purs b/src/Data/Array/Extra/Unsafe.purs index 525acdc..12d139c 100644 --- a/src/Data/Array/Extra/Unsafe.purs +++ b/src/Data/Array/Extra/Unsafe.purs @@ -1,15 +1,16 @@ -- | Unsafe but faster functions due to no out of bounds checking. -module Data.Array.Extra.Unsafe ( - unsafeDeleteAt, - unsafeInsertAt, - unsafeInsertArray, - unsafeUpdateAt, - unsafeModifyAt, - unsafeHead +module Data.Array.Extra.Unsafe + ( unsafeDeleteAt + , unsafeInsertAt + , unsafeInsertArray + , unsafeUpdateAt + , unsafeModifyAt + , unsafeHead ) where import Data.Array (head) +import Data.Function.Uncurried (runFn2, Fn2, runFn3, Fn3) import Data.Maybe (fromJust) import Partial.Unsafe (unsafePartial) @@ -19,9 +20,9 @@ import Partial.Unsafe (unsafePartial) -- | unsafePartial $ unsafeDeleteAt 1 ["a", "b", "c"] = ["a", "c"] -- | ``` unsafeDeleteAt :: forall a. Partial => Int -> Array a -> Array a -unsafeDeleteAt = unsafeDeleteAtImpl +unsafeDeleteAt = runFn2 unsafeDeleteAtImpl -foreign import unsafeDeleteAtImpl :: forall a. Int -> Array a -> Array a +foreign import unsafeDeleteAtImpl :: forall a. Fn2 Int (Array a) (Array a) -- | Insert the element at index `i` in an array -- | @@ -29,9 +30,9 @@ foreign import unsafeDeleteAtImpl :: forall a. Int -> Array a -> Array a -- | unsafePartial $ unsafeInsertAt 1 "b" ["a", "c"] = ["a", "b", "c"] -- | ``` unsafeInsertAt :: forall a. Partial => Int -> a -> Array a -> Array a -unsafeInsertAt = unsafeInsertAtImpl +unsafeInsertAt = runFn3 unsafeInsertAtImpl -foreign import unsafeInsertAtImpl :: forall a. Int -> a -> Array a -> Array a +foreign import unsafeInsertAtImpl :: forall a. Fn3 Int a (Array a) (Array a) -- | Insert an array into another array at the given position. -- | @@ -39,9 +40,9 @@ foreign import unsafeInsertAtImpl :: forall a. Int -> a -> Array a -> Array a -- | unsafeInsertArray 2 [21,22] [1,2,3,4,5] == [1,2,21,22,3,4,5] -- | ``` unsafeInsertArray :: forall a. Partial => Int -> Array a -> Array a -> Array a -unsafeInsertArray = unsafeInsertArrayImpl +unsafeInsertArray = runFn3 unsafeInsertArrayImpl -foreign import unsafeInsertArrayImpl :: forall a. Int -> Array a -> Array a -> Array a +foreign import unsafeInsertArrayImpl :: forall a. Fn3 Int (Array a) (Array a) (Array a) -- | Overwrite the element at index `i` in an array -- | @@ -49,9 +50,9 @@ foreign import unsafeInsertArrayImpl :: forall a. Int -> Array a -> Array a -> A -- | unsafePartial $ unsafeUpdateAt 1 "e" ["a", "b", "c"] = ["a", "e", "c"] -- | ``` unsafeUpdateAt :: forall a. Partial => Int -> a -> Array a -> Array a -unsafeUpdateAt = unsafeUpdateAtImpl +unsafeUpdateAt = runFn3 unsafeUpdateAtImpl -foreign import unsafeUpdateAtImpl :: forall a. Int -> a -> Array a -> Array a +foreign import unsafeUpdateAtImpl :: forall a. Fn3 Int a (Array a) (Array a) -- | Overwrite the element at index `i` in an array -- | @@ -59,9 +60,9 @@ foreign import unsafeUpdateAtImpl :: forall a. Int -> a -> Array a -> Array a -- | unsafePartial $ unsafeModifyAt 1 (\a -> a <> "e") ["a", "b", "c"] = ["a", "be", "c"] -- | ``` unsafeModifyAt :: forall a. Partial => Int -> (a -> a) -> Array a -> Array a -unsafeModifyAt = unsafeModifyAtImpl +unsafeModifyAt = runFn3 unsafeModifyAtImpl -foreign import unsafeModifyAtImpl :: forall a. Int -> (a -> a) -> Array a -> Array a +foreign import unsafeModifyAtImpl :: forall a. Fn3 Int (a -> a) (Array a) (Array a) -- | Get the first element in an array. Passing `Nothing` to `unsafeHead` will throw an error at -- | runtime.