Why can't I use record selectors with an existentially quantified type?
When using Existential types, we have to use a pattern-matching syntax for extracting the forall ed value. We can't use the ordinary record selectors as functions. GHC reports an error and suggest using pattern-matching with this definition of yALL : {-# LANGUAGE ExistentialQuantification #-} data ALL = forall a. Show a => ALL { theA :: a } -- data ok xALL :: ALL -> String xALL (ALL a) = show a -- pattern matching ok -- ABOVE: heaven -- BELOW: hell yALL :: ALL -> String yALL all = show $ theA all -- record selector failed forall.hs:11:19: Cannot use record selector `theA' as a function due to