Comments (3)
Are you looking for something like:
type family (l :: *) .* (r :: *) :: * where
Rec l .* Rec r = Rec (l .+ r)
x .* y = TypeError (TL.Text "Tried to .* non-records")
No, I haven't included anything like this in row-types because .+
seemed general enough, and having another operator just for records seemed unnecessary. Do you have a particular use-case in mind?
from row-types.
Do you have a particular use-case in mind?
Yes, following steps.
Create alias to record, to use it everywhere.
Now it's expected to have an ability to create type alias to helper record with additional fields without defining intermediate type alias of rows of original type.
from row-types.
I suppose I can see the usefulness of this — I've definitely made a row-type synonym called FooRow
just so I can then define Rec FooRow
— but I think it may make things more confusing overall because now different row-types type families will work on different kinds of arguments. That is, other type functions like .\
, .!
, .-
, Extend
, etc, all work on row-types themselves, and not on Rec
s over row-types, and .*
won't play nicely with them. One might argue that we should add special Rec
versions of all of those type functions too, but I'm not ready to go there (maybe if they were all in a separate module, e.g. Data.Row.Record.TypeFamilies
, but still, I'm not sure it's sensible).
For now, I encourage you to use the 3-line .*
I suggested above in your own row-types code. If you find that it's actually super-useful and you're using it a lot, maybe we can discuss upstreaming it later.
from row-types.
Related Issues (20)
- Q: How does Data.Row.Records compare to other extensible record approaches? HOT 7
- Allow label in pattern matching? HOT 1
- Is there an easy way to make functor instances? HOT 11
- Where's the row-types-lens library? HOT 4
- Design help with default values HOT 9
- new release to hackage? HOT 1
- `ToNativeExact t ρ` as type family HOT 4
- trial Left result HOT 1
- Feature request: unions aka corecords HOT 3
- Soliciting feedback HOT 2
- Feature request: named function's arguments HOT 12
- Is it possible to deduce lens over constrained type? HOT 6
- AllUniqueLabels (V.Map (Either String) r) HOT 4
- Segmentation fault after upgrading to row-types-1.0 HOT 4
- Publish row-types-aeson & row-types-barbies HOT 4
- `row-types-aeson` with `aeson-2` compatibility HOT 5
- See github.com/dwincort/row-types for active maintenance HOT 5
- Should the aeson instances omit `Nothing` fields? HOT 2
- ⚠️ Archival Notice
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 row-types.