I have a Haskell project that regularly uses a lot of language features, and I want the language extension block for each source file to be the same. Here's a list,
{-# LANGUAGE Arrows,
BangPatterns,
DefaultSignatures,
DeriveDataTypeable,
DeriveFunctor,
EmptyDataDecls,
FlexibleContexts,
FlexibleInstances,
FunctionalDependencies,
GADTs,
GeneralizedNewtypeDeriving,
MultiParamTypeClasses,
NamedFieldPuns,
NoImplicitPrelude,
NoMonomorphismRestriction,
OverlappingInstances,
RankNTypes,
RebindableSyntax,
ScopedTypeVariables,
StandaloneDeriving,
TemplateHaskell,
TypeFamilies,
TypeOperators,
TypeSynonymInstances,
UndecidableInstances,
ViewPatterns #-}
Maybe to some it's bad practice, but I consider language extensions to be part of the "Haskell+" that I usually write code in. And, I want that to be the same across modules. For example, the NoImplicitPrelude changes the language dramatically, and I want it uniform for all modules.
Question: How can I achieve this, without copy-pasting the language block into each file? It gets annoying how I often learn a new language feature, add it to module A, then start working on module B, and realize I have to go copy the language block from module A.
Just FYI the CPP pragma with a #include does not do the trick! Thanks in advance.