I think you might have mixed Neuron
and its type. From the error it looks like you gave Neuron
the type { Type = ..., default = ... }
. But Neuron should have the value { Type = ..., default = ... }
and the type { Type : Type, default : ... }
(note the difference between =
and :
.
FWIW, your solution is virtually equivalent to the one suggested in dhall-haskell issue #1521 and the problem is very similar as well.
Itâs probably worth documenting somewhere then
@Nadrieril: I can try to write this up as a quick How-to guide or addition to the FAQ for the Dhall wiki
Keep in mind that by naively using //
you will run into issues with nested merges, should you choose to later implement them.
Itâll be fine if all of your fields stay in the top level though.
in retrospective I wasnât very clear when I wrote
so that you can merge the defaults in the application and allow the user to truly omit the optional fields
The only âdownsideâ I see is that you must check the configuration with neuron and not with dhall itself but thatâs probably a good thing since it might involve more than typechecking