|
|
|
|
|
by delhanty
2987 days ago
|
|
Thank you - very useful summary. >I say standardish Haskell because the sweet spot in my experience is a few lightweight GHC extensions but mostly shunning some of the seriously experimental stuff in the language. Are you able to say which GHC extensions you use and why? |
|
This extension fixes a defect in the spec as far as I'm concerned:
* ScopedTypeVariables
Syntactic extensions that make certain code forms lighter:
* LambdaCase * MultiWayIf
* OverloadedStrings * RecursiveDo
* TypeApplications * PatternGuards
* KindSignatures
Code Generation:
* DeriveFunctor * DeriveTraversable
* DeriveFoldable * DeriveGeneric
* StandaloneDeriving * GeneralizedNewtypeDeriving
Extensions to the type system. These can be misused so they should be respected.
* MultiParamTypeClasses (Can weaken type inference)
* FunctionalDependencies (Helps type inference with MultiParamTypeClasses, these two together compete with TypeFamilies for functionality)
* FlexibleInstances (Can be a bit sketch, actually) * FlexibleContexts
* UndecidableInstances (Surprisingly mostly benign)
* TypeFamilies (Type level programming should be kept to a minimum. Can kill type inference)
* GADTs (Very powerful, sparingly appropriate)
* RankNTypes (Higher rank types are very expressive but have much worse type inference)
Unpleasant extensions that cope with the realities of serious engineering:
* TemplateHaskell
* CPP
Very Spicy extensions that I avoid unless they're really really appropriate:
* PolyKinds * TypeInType
I am mostly neutral or unfamiliar with the others. The only extension I vehemently oppose is RecordWildCards because it is a binding form that doesn't mention the names it binds. It can get really confusing!