-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Now that I'm back to using Option I realized I needed another function, project. I also combined this with the recently added (in PR) getAll to get a convenience function, getSubset. It works well, but there are a few possible discussion points I can think of already:
- Is there a way to implement project without resorting to the FFI (the unexported utility function
pickFn)? This is based almost exactly onpickFnfrom Record-Extra, but an undefined guard is needed here since Foreign.Object can have missing values, whereas a Record cannot. In any case I tried a few things to this end, namely usingalter, but ran out of steam trying to massage the types. Denis Stoyanov had this note on Slack, which I'm not sure I follow exactly:I use it like
newtype MyRecord (r :: # Type) = MyRecord (FO.Object (Exists Identity))but just for example what is record will be - I'm relying on Records.Extra just to get the
Keysclass and related functions, but we might want to reconsider this. - Of course add docs when the dust settles.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels