Hi! At work we see a recurring pattern:
-
We use a library (e.g. dhall-aws-cloudformation).
-
We want to provide abstractions over this library (e.g. “a Lambda Function that transforms one Kafka topic into another”).
-
We provide a record schema for the abstraction, and a Dhall function implementing that abstraction, usually following this pattern:
let Args = { Type = {...}, default = {...} } let call = (\args : Args.Type) -> UnderlyingLibraryType::{...} in { Args, call }
-
We use the abstraction with
MyAbstraction.call MyAbstraction.Args::{...}
.
The repeated boilerplate makes me wonder:
- Is there a better way to do what we’re doing?
- Is there an existing proposal for syntax that would remove some boilerplate from this pattern?
- Should we make such a proposal if it doesn’t exist?