I’m learning Dhall at the moment by porting my Alacritty configuration to Dhall. The configuration allows for slightly different values depending on the platform. For example, there’s a key startup_mode
which allows let StartupMode = < Windowed | Maximized | Fullscreen >
on Linux, but let StartupMode = < Windowed | Maximized | Fullscreen | SimpleFullscreen >
on MacOS.
Is it possible to enforce this through Dhall? Basically, I’d imagine that the entire configuration can exist as MacOS and as a Linux variant. I don’t even know how I’d do this in Haskell to be honest. I have some vague notions of data Config a = MacOS a | Linux a
. Ideally I’d like to make it impossible to construct a Linux configuration with MacOS values somewhere.