The documents description is a type right now - but it should be a newtype. We define the Description as a strict map, but the type does not enforce the strict usage throughout the application.
type Description = SM.Map Text Text
For example: If i create a document with a description somewhere in the code, but import the lazy Map there - the description is lazy in that particular case and we get no compiler error.
With a newtype wrapper we could control the usage of strict functions and avoid potential memory leaks.
The documents description is a type right now - but it should be a newtype. We define the Description as a strict map, but the type does not enforce the strict usage throughout the application.
For example: If i create a document with a description somewhere in the code, but import the lazy Map there - the description is lazy in that particular case and we get no compiler error.
With a newtype wrapper we could control the usage of strict functions and avoid potential memory leaks.