You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
We can see traits as typeclasses that are directly implemented in the data rather than presented as separated instances, they have the advantage of not requiring to pass explicitly instances and can make DX better.
There are other scenarios that came up as useful, those are:
Compare : like a partial order that enables implementation of things like sortBy(array, p => [p.age, p.name]) without manually constructing an Order instance (that one should be able to still do)
*Copy : encodes the ability to copy an object to a separated instance
*Index : enables indexed access and updates over a structure that is indexed (e.g. Chunk, HashMap, etc)
Note: The ones marked with * are coming from requirements in optics.
The text was updated successfully, but these errors were encountered:
so far what seems to work well is Object.setPrototypeOf(copy, Object.getPrototypeOf(original)).
for Data.struct, classes in general, and for Data.Class etc.
Perhaps using that as a default, with the ability to override via a copy trait, would be a good way forward.
We currently have the following traits:
We can see traits as typeclasses that are directly implemented in the data rather than presented as separated instances, they have the advantage of not requiring to pass explicitly instances and can make DX better.
There are other scenarios that came up as useful, those are:
sortBy(array, p => [p.age, p.name])
without manually constructing an Order instance (that one should be able to still do)Note: The ones marked with
*
are coming from requirements inoptics
.The text was updated successfully, but these errors were encountered: