Languages extensions used to be declared in pragmas locally at the beginning of modules they were used in. They have recently all been set up globally at the package level (see in package.yaml) to avoid having huge repetitive preludes in haskell modules.
I am not convinced this is desirable because most extensions are only used in few modules (it is then difficult to picture which module depends on which), some modify the haskell concrete syntax, some modify type checking, and some may be controversial in the haskell community. I think there are risks of over-reliance on these extensions, unexpected behaviors in the future when we don't keep in mind all the enabled extensions, and it could reduce modularity and portability.
I think we should aim at a compromise.
We should consult with the community and determine a set of criteria to decide on which language extensions do deserve to be enabled globally. I would be in favor of going local when in doubt.
Languages extensions used to be declared in pragmas locally at the beginning of modules they were used in. They have recently all been set up globally at the package level (see in
package.yaml
) to avoid having huge repetitive preludes in haskell modules.I am not convinced this is desirable because most extensions are only used in few modules (it is then difficult to picture which module depends on which), some modify the haskell concrete syntax, some modify type checking, and some may be controversial in the haskell community. I think there are risks of over-reliance on these extensions, unexpected behaviors in the future when we don't keep in mind all the enabled extensions, and it could reduce modularity and portability.
I think we should aim at a compromise.
We should consult with the community and determine a set of criteria to decide on which language extensions do deserve to be enabled globally. I would be in favor of going local when in doubt.