textOptionalTextMap.dhall 602 B

1234567891011121314151617181920212223
  1. let Prelude = ../lib/prelude.dhall
  2. let JSON = Prelude.JSON
  3. let Types = ../types/package.dhall
  4. let TextJSONPair = { mapKey : Text, mapValue : JSON.Type }
  5. let TextOptionalTextPair = { mapKey : Text, mapValue : Optional Text }
  6. let RenderOptional = ./optionals/package.dhall
  7. let renderPair
  8. : TextOptionalTextPair → TextJSONPair
  9. = λ(p : TextOptionalTextPair)
  10. → p ⫽ { mapValue = RenderOptional.text p.mapValue }
  11. let renderTextTextMap
  12. : List TextOptionalTextPair → Types.JSONObject
  13. = Prelude.List.map TextOptionalTextPair TextJSONPair renderPair
  14. in renderTextTextMap