Open ocharles opened 5 years ago
I think I'm +1 on this, since using toMap will give you some static assurance about component name collisions, besides the nicer syntax. (We could even take that assurance further with, e.g., a single named-components : List { name: Text, component : < Test | Library | ... > }
field!)
will give you some static assurance about component name collisions, besides the nicer syntax
Note that this is in some sense "opt-in" - you don't have to use toMap
, you just have to supply a List { mapKey : Text, mapValue : Executable }
(for the executables
section). This means it's still possible to supply duplicates, and we should decide what to do in that case (I think just error out).
a single
named-components
field!
Should we do this at the same time? I do like it.
Yeah, it's opt-in - but, since dhall-to-cabal
is opt-in anyway, I think nudging people towards safer practice is sensible enough.
On named-components
: OK, let's do it!
{ named-components : Map Text Component, library : Optional Library }
?
It feels like the new toMap keyword could be nicer for defining the components of a library. The keys are component names and the values are their definitions. Anyone any thoughts on this?