Record merge with list concatenation


#1

I would like to have a function which would allow me to merge records, similarly to what /\ does, but when the two records have a common field, which contains an array of elements (of the same type for both records), instead of returning a Field collision error, it would concatenate the two arrays.

For example, if I have

a = { foo = [1] }
b = { foo = [2] }

I would like to have an operator ?/\? such that

a ?/\? b = { foo = [1, 2] }

Is this already available somehow? (sorry, I’m quite new to Dhall)
If not, would it be definable in Dhall itself?


#2

Hi @marcosh. Something similar was proposed in https://github.com/dhall-lang/dhall-lang/issues/754. Feel free to chime in there!