Hi! I’m not sure the title is very clear, but here’s a better explanation.
I want to build a function that allows to build a Aff.Request String overriding fields of the defaultRequest.
For example:
buildRequest { url, method }
Asking on slack, I was suggested to use this class to get the row out of a record:
class RecordRow (t :: Type) (r :: # Type) | t -> r
instance recordRowInst :: RecordRow (Record r) r
else
instance recordRowFail :: Fail (Beside (Text "RecordRow applied to non record type: ") (Quote t)) => RecordRow t r
I added it to this function:
buildRequest ::
forall r s t x.
RecordRow (Request String) s =>
Row.Nub t s =>
Row.Union r s t =>
Row.Union r x s =>
{ | r } ->
Request String
buildRequest r = Record.merge r defaultSimpleRequest
The compiler complains that there’s a missing instance for Union r x t, where x is Request String's row.
I must be doing something wrong, but I’m not sure what 