mlms13 / bs-nonempty Goto Github PK
View Code? Open in Web Editor NEWNonEmpty type with Array and List implementations for ReasonML and OCaml
License: MIT License
NonEmpty type with Array and List implementations for ReasonML and OCaml
License: MIT License
Studying your code, sir.
NonEmptyList.t
does not tolerate updating the dependencies. Though obviously, it works with its oringal dependencies.
Here is the error, if it matters to you:
:1
1 │ open BsAbstract.Interface;
2 │
3 │ module ArrayMonoid: MONOID_ANY with type t('a) = array('a) = {
4 │ type t('a) = array('a);
5 │ let append = Array.append;
6 │ let empty = [||];
7 │ };
8 │
9 │ module ArrayArrayLike: NonEmptyBase.ARRAY_LIKE with type t('a) = array(
'a) = {
Signature mismatch:
...
Values do not match:
let empty: array('_weak1)
is not included in
let empty: t('a)
File "/Users/mandalarian/Github/bs-nonempty/node_modules/bs-abstract/src/interfaces/Interface.re", line 23, characters 49-65:
Expected declaration
File "/Users/mandalarian/Github/bs-nonempty/src/NonEmptyArray.re", line 6, characters 6-11:
Actual declaration
Tried to think through it but here I am asking so....
Thanks for sharing.
We're already talking about adding an elem
function when the inner 'a
is a member of EQ. If we're adding that, we might as well also eq
for NonEmpty.t
in that case and make NonEmpty
implement EQ.
The easiest way to check Nels for equality is probably by zipping them together, so we'll want zip
and zip_with
as well.
For a normal Foldable
, these functions would return an option('a)
, but NonEmpty can guarantee you get an 'a
back.
let any: (('a => bool), NonEmptyList.t('a)) => bool;
let all: (('a => bool), NonEmptyList.t('a)) => bool;
let elem: ('a, NonEmptyList.t('a)) => bool; /* where 'a is a member of EQ */
let find: (('a => bool), NonEmptyList.t('a)) => option('a);
Although theoretically most of this could live in bs-abstract
and come for free with FOLDABLE.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.