Comments (11)
I think we should move the minimal amount of stuff needed to support this (i.e. RowList
and classes) into Prelude as part of the 0.12.0 updates.
from purescript-record.
Do you think it might be worth considering doing it before then? Just because all the stuff is already there and ready to go, it seems a shame to wait, and even after 0.12 is out I think it would be nice if people could take advantage of this without having to upgrade. Presumably this would only be a minor-level change for Prelude, and I don't think that would cause a huge amount of hassle since most people seem to be using caret (^) bounds for most dependencies..?
from purescript-record.
It'll probably happen, but it requires some reorganisation of the libraries - the instances for records will have to live with the class definitions to prevent them from being orphans (since record is a Prim
type) - so for that to happen, -typelevel-prelude
needs to be merged with or moved above -prelude
in the dependency hierarchy.
from purescript-record.
FWIW, in the meantime I've created this, which I find helpful: https://github.com/matthewleon/purescript-record-show
from purescript-record.
We definitely could, especially since there is no plan for continued work on 0.12 right now anyway.
from purescript-record.
Great! Looking at @matthewleon's record-show library, I guess that means the following would need to be moved above or into Prelude in the dependency hierarchy:
import Data.Record (get, delete)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Type.Prelude (class RowToList, class RowLacks)
import Type.Row (kind RowList, Nil, Cons, RLProxy(..))
Does that seem doable? Or is there maybe a way of achieving this without using all of these?
from purescript-record.
Come to think of it I suppose we could avoid the record
dependency by cheating and using the FFI...? Also we could probably switch out delete
for a version of unsafeCoerce
which is specialised to have the same type, in order to avoid doing unnecessary work.
from purescript-record.
Come to think of it I suppose we could avoid the record dependency by cheating and using the FFI...?
Is there FFI use elsewhere in the Prelude?
from purescript-record.
Yes; most of the Show instances need it, for example.
from purescript-record.
On second thoughts, since we are moving some of these classes in 0.12, it's probably best to wait until 0.12. See purescript/purescript#2903
from purescript-record.
These now exist in the 0.12 version of the prelude.
from purescript-record.
Related Issues (20)
- operations on homogeneous records HOT 2
- stack-safe Builder HOT 1
- unsafeModify HOT 1
- unsafeFreeze, unsafeThaw HOT 1
- deprecate verbose ST function names HOT 1
- modifySTRecord HOT 1
- Builder Profunctor instance HOT 3
- Builder.merge could be "safer" HOT 1
- insert and forall in record HOT 2
- Is equality on records order independent? HOT 1
- Record kind as type parameter? Bug? HOT 2
- Create a partially applied record constructor HOT 7
- Alternative `build` for building a record from scratch HOT 1
- Argument precedence of Record and Builder merging HOT 6
- Bug: `union` causes type confusion HOT 3
- Add type which represents and provide instances for homogeneous records HOT 2
- drop fields HOT 2
- Add new and run to Record.ST HOT 2
- Is the ST module at all useful? HOT 5
- Add `mergeFlipped` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-record.