6 ms·
Yep. Here's an interesting list of extensions as of a couple years ago: https://www.reddit.com/r/haskell/comments/2z248l/language_extensions/ https://www.reddit
by _sdegutis 9y ago
Yep. Here's an interesting list of extensions as of a couple years ago: https://www.reddit.com/r/haskell/comments/2z248l/language_extensions/ https://www.reddit.com/r/haskell/comments/2z248l/language_ex... ... But that many extensions being pretty much necessary had definitely wore me down and turned me away from Haskell.
- nerdponx 9y agoWhat's the point of adding "optional" extensions, versus just incorporating them as features in later compiler versions?
- erik_seaberg 9y agoYou might want to know which code is relying on an extension that's found to be a Bad Idea(tm) and rolled back or seriously changed.
- gizmo686 9y agoMostly politics. It is a lot easier to add opt-in features than get consensus to change the language. Opt in extensions also allow you to avoid worrying about the longtail of backwards compatability.
- aetherspawn 9y agoBecause sometimes you have to explore a space to figure out if it’s any good. No point arbitrarily adding stuff to the language if it doesn’t turn out to be that useful. That’s how you end up with situations like ‘null’. Some of these extensions are nuts, too. They can make the type system behave in ways where it basically has to multivariate solve or do things that are overly clever. You probably don’t want that most of the time..
- mrkgnao 9y agoSome extensions are considered bad ideas later, e.g. -XImplicitParams. Some extensions can make existing code fail to compile, e.g. -XOverloadedStrings. Some extensions are fairly specialised and their use can cause error messages that are confusing if you don't know what the extension does, e.g. -XAllowAmbiguousTypes. Some extensions can cause certain pathological pieces of code to suddenly start behaving weirdly, e.g. if you turn on -XApplicativeDo for a type whose Applicative instance isn't lawful, but whose Monad instance is. Of course, many, many extensions could be enabled by default without making the UX worse or restricting the set of allowed programs at all: a large section of Haskell users is likely in favour of enabling syntactic conveniences like LambdaCase or MultiWayIf, or automatic code-generation utilities like DeriveFoldable, DeriveTraversable, and so on. That's what Haskell Prime is for, I suppose.
- marcosdumay 9y agoAnd lets not forget about UndecidableInstances and its ilk, that enable amazing pieces of functionality if used well, but incredibly dangerous if you are not careful
- whateveracct 9y agoUndecidableInstances is actually not bad. I turn it on all the time and don't feel scared when I do. Worst-case, I write some bad instances and the compiler fails due to the recursion limit. IncoherentInstances is the one that really has no place since it can make code unsound.