Comments (6)
This looks useful to me!
Regarding your implementation, it would probably be best to implement it in FFI for performance reasons (as unsafePick
or something in the Unsafe
module).
Oops, commented too early.
But I would also suggest using RProxy r
instead of Proxy (Record r)
, just because you aren't doing anything with the information that it's a record inside the proxy ...
Otherwise it looks good to me, nice suggestion!
from purescript-record.
Confession: I was originally going to suggest using something like insert
/delete
, then I realized that wouldn't be any better, hence FFI. My other bad idea was to implement delete
in terms of pick
from purescript-record.
It would need to use the FFI anyway, since I don't really want to add a maps
dependency here.
What are the use cases for this?
from purescript-record.
In Redux when you connect a component to a state, and you want to match what you need as tight as possible (which is an optimisation).
Another case how I am using it is when using css-modules
and importing css into purescritp through ffi:
foregin import css :: { header :: String, section :: String, footer :: String }
But then a component might just require a section of those css classes.
Sure ffi is the way to go, it's just not accessible in try.purescript :)
from purescript-record.
I guess the right place for the class SubRow
is in Type.Row
. I'll submit a PR there too.
from purescript-record.
The only dependency that this will introduce is for Data.Array
, I hope it's fine. It just requires cons
(the new DCE that I am working on is able to cut everything out except the required function :) )
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.