* Is there a difference in what the user wrote in the case of HsUserBang and HsNoBang/HsUnpack/HsStrict e.g are the latter three generated by the compiler as opposed to being written by the user (the function documentation notwithstanding)?
A very related function is isBanged:
isBanged :: HsBang -> Bool
isBanged HsNoBang = False
isBanged (HsUserBang Nothing bang) = bang
isBanged _ = True
What's the meaning of this function? Is it intended to communicate what the user wrote or whether result of what the user wrote results in a strict function?
Context: I'm adding a new StrictData language pragma [1] that makes fields strict by default and a '~' annotation of fields to reverse the default behavior. My intention is to change HsBang like so:
- Bool -- True <=> '!' specified
+ (Maybe Bool) -- True <=> '!' specified, False <=> '~'
+ -- specified, Nothing <=> unspecified
1.
https://ghc.haskell.org/trac/ghc/wiki/StrictPragma