Configuration Typed Decoding

This comparison sits between configuration loading and startup validation.

The earlier loading comparison ends with a normalized RawStartupConfig that still holds string values. This step turns those strings into typed in-memory values before the later startup rules decide whether the application is allowed to start.

Files

  • /Users/scottpeterson/Dev/PurelyFunctional/HaskellDemo/src/Shared/ConfigurationTypedDecodingStartup.hs
  • /Users/scottpeterson/Dev/PurelyFunctional/HaskellDemo/src/Baseline/ConfigurationTypedDecodingStartup.hs
  • /Users/scottpeterson/Dev/PurelyFunctional/HaskellDemo/src/HaskellStyle/ConfigurationTypedDecodingStartup.hs

Baseline

Baseline.ConfigurationTypedDecodingStartup.decodeStartupConfigInline decodes the raw environment, port, and log-level strings in order and stops at the first invalid value.

Haskell Style

HaskellStyle.ConfigurationTypedDecodingStartup.decodeStartupConfig keeps the same raw input but accumulates all decoding failures before returning a typed DecodedStartupConfig.

This keeps the transition clear:

  1. load raw strings
  2. decode typed values
  3. validate startup/business constraints