-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommended set of language extensions? #9
Comments
I think I’m a minority opinion, but I always enable those I consider “safe” package-wide:
|
Once there is a |
I like the idea of not writing many language pragmas as well. |
In addition to the question of which language extensions, is whether it's acceptable to put the language extensions in the |
Yes that would be me.
If you put pragmas into cabal files, you cannot trivially use some of these tools (e.g. for generating simpe ctags, you only need to parse, which you can do per-file without having to implement any support for cabal), or quickly load a couple of different modules from different packages into one ghci by using the Without the |
I guess I should also bring in some form of bold statement: I would happily choose spending a few seconds at the creation of each |
Then we can put something like this on the template, and provide for some editors a snippet for the few seconds mentioned: {-# LANGUAGE NoImplicitPrelude, OverloadedStrings, OverloadedLists,
LambdaCase, GADTSyntax, RankNTypes, ScopedTypeVariables,
DeriveGeneric, TupleSections, BangPatterns, MultiParamTypeClasses,
FlexibleInstances, FlexibleContexts, MultiWayIf, TypeFamilies,
TypeOperators, FunctionalDependencies, DisambiguateRecordFields,
MonadComprehensions, BinaryLiterals, RecursiveDo, ParallelListComp,
PartialTypeSignatures, RecordWildCards, PatternSynonyms, EmptyCase,
InstanceSigs, KindSignatures, DeriveFunctor, DeriveFoldable,
DeriveTraversable, ConstraintKinds, ExplicitNamespaces #-}
module SomeModule
(
) where
import RIO |
Yeah I guess that'd do. One might debate whether it should be like that or one-per-line which makes diffs look better, but for the purpose of ghci, that doens't matter. We should also consider that some of these proposed ones might be controversial. For example, some consider |
I’d say aggregate for the “commonly agreed-upon subset” and one per line for others, then you have the most compact representation that is amenable to good workflow. |
Oops, I didn't have a watch set on this repo yet, so only just saw this issue. Until ghci can properly load multiple packages at once, we should not recommend any default extensions that are known to cause some code to no longer compile. There's a list here: https://github.com/commercialhaskell/stack/blob/864831f8f2d4c91e5989f2cbfbe3769c03946e0d/src/Stack/Ghci.hs#L635 So, this would mean removing I guess the alternative approach would be to convert libraries to using these, but that's hard if you ever want to load older packages into your ghci along with newer. |
Another reason to not include |
For what it's worth, I've also run into |
Would a middle ground be to include in the I would personally hate to have that long list of extensions in the top, but I don't know if the other tooling, such as |
I don't think so, because |
I think we're stuck with language pragmas in the modules themselves for now. The list is already documented, and in the future we can include that list in a template. Closing as complete. |
And should we advise setting these in the
package.yaml
file vs LANGUAGE pragmas.The text was updated successfully, but these errors were encountered: