Memory footprint of Haskell data types
(The following applies to GHC, other compilers may use different storage conventions) Rule of thumb: a constructor costs one word for a header, and one word for each field. Exception: a constructor with no fields (like Nothing or True) takes no space, because GHC creates a single instance of these constructors and shares it amongst … Read more