Difference between revision 3 and current revision
No diff available.---
if malloc rounds up the space it allocates for you, then there should be a way to find out the actual amount of space that it gave you so that you can make use of it
---
https://www.haiku-os.org/legacy-docs/bebook/
---
https://github.com/WebAssembly/WASI/blob/master/phases/snapshot/docs.md
---
https://betterdev.blog/minimal-safe-bash-script-template/ https://news.ycombinator.com/item?id=25429899
-- SNES raytracing custom chip
https://www.shironekolabs.com/posts/superrt/
---
https://genode.org/documentation/genode-foundations/20.05/index.html
---
https://github.com/glouw/ctl https://lobste.rs/s/9gc2ku/c_template_library
"
C TEMPLATE LIBRARY (CTL)
CTL is a fast compiling, type safe, header only, template-like library for ISO C11. Motivation
CTL aims to improve C11 developer productivity by implementing the following STL containers in ISO C11:
deq.h = std::deque lst.h = std::list pqu.h = std::priority_queue que.h = std::queue set.h = std::set stk.h = std::stack str.h = std::string vec.h = std::vector
"
---
t0astbread 3 days ago [–]
Frameworks and languages to build small to mid-sized web applications that aren't no-code or low-code or tied into an online service. Basically, PHP alternatives.
Here's a "wishlist" of features I'd like in such a framework:
reply
---
haskell extension recommendations:
haskell
https://limperg.de/ghc-extensions/ basic track:
3.1 Syntactic Niceties 3.1.1 TupleSections 3.1.2 LambdaCase 3.1.3 MultiWayIf 3.1.4 BlockArguments 3.1.5 TypeOperators 3.1.6 NumericUnderscores 3.2 Overloaded Literals 3.2.1 OverloadedStrings 3.2.2 OverloadedLists 3.3 Patterns 3.3.1 ViewPatterns 3.3.2 PatternSynonyms 3.4 Type System 3.4.1 ExplicitForAll 3.4.2 TypeApplications 3.4.3 ScopedTypeVariables 3.4.4 RankNTypes 3.4.5 LiberalTypeSynonyms 3.5 Records 3.5.1 NamedFieldPuns 3.5.2 RecordWildCards 3.6 Classes 3.6.1 FlexibleInstances 3.6.2 FlexibleContexts 3.6.3 DeriveFunctor, DeriveFoldable, DeriveTraversable 3.6.4 GeneralizedNewtypeDeriving 3.6.5 InstanceSigs 3.6.6 ConstrainedClassMethods 3.6.7 MultiParamTypeClasses 3.6.8 FunctionalDependencies 3.6.9 DeriveGeneric 3.7 Typed Holes 3.7.1 Typed Holes and Type Wildcards 3.7.2 NamedWildCards 3.7.3 PartialTypeSignatures
https://taylor.fausak.me/2020/11/22/haskell-survey-results/#s2q5 <34% net:
+37% -4% DerivingStrategies? +37% -4% MultiParamTypeClasses? +37% -4% TupleSections? +35% -7% DataKinds? +33% -4% KindSignatures? +32% -6% TypeFamilies? +30% -4% StandaloneDeriving? +30% -6% MultiWayIf? +29% -5% DeriveDataTypeable? +28% -5% ConstraintKinds? +28% -5% TypeOperators? +28% -6% ViewPatterns? +26% -4% InstanceSigs? +26% -5% DeriveLift? +25% -4% NumericUnderscores? +24% -6% NamedFieldPuns? +24% -5% EmptyCase? +24% -6% GADTSyntax +24% -6% ExplicitForAll? +23% -5% BinaryLiterals? +23% -6% FunctionalDependencies? +23% -10% DeriveAnyClass? +22% -9% RecordWildCards? +21% -6% DefaultSignatures? +21% -6% ExistentialQuantification? +20% -5% PatternSynonyms? +19% -13% ApplicativeDo?
https://taylor.fausak.me/2019/11/16/haskell-survey-results/#s2q5
Which language extensions would you like to be enabled by default?
Multiple select. 48% OverloadedStrings? 40% LambdaCase? 34% DeriveGeneric? 29% DeriveFunctor? 29% GADTs 28% BangPatterns? 26% FlexibleInstances? 25% FlexibleContexts? 25% ScopedTypeVariables? 25% RankNTypes? DeriveFoldable? GeneralizedNewtypeDeriving? TypeApplications? TypeFamilies? DeriveTraversable? 20% DataKinds? TupleSections? MultiParamTypeClasses? DerivingVia? TypeOperators? 17% KindSignatures? DerivingStrategies? 15% DeriveDataTypeable? MultiWayIf? ViewPatterns? StandaloneDeriving? ConstraintKinds? DeriveAnyClass? RecordWildCards? 13% EmptyCase? ApplicativeDo? 12% FunctionalDependencies? ExplicitForAll? InstanceSigs? 11% GADTSyntax PatternSynonyms? NamedFieldPuns? NumericUnderscores? 10%
http://dev.stephendiehl.com/hask/#language-extensions
The Benign
It’s not obvious which extensions are the most common but it’s fairly safe to say that these extensions are benign and are safely used extensively:
NoImplicitPrelude OverloadedStrings LambdaCase FlexibleContexts FlexibleInstances GeneralizedNewtypeDeriving TypeSynonymInstances MultiParamTypeClasses FunctionalDependencies NoMonomorphismRestriction GADTs BangPatterns DeriveGeneric DeriveAnyClass DerivingStrategies ScopedTypeVariables
The Advanced
These extensions are typically used by advanced projects that push the limits of what is possible with Haskell to enforce complex invariants and very type-safe APIs.
PolyKinds DataKinds DerivingVia GADTs RankNTypes ExistentialQuantification TypeFamilies TypeOperators TypeApplications UndecidableInstances
The Lowlevel
These extensions are typically used by low-level libraries that are striving for optimal performance or need to integrate with foreign functions and native code. Most of these are used to manipulate base machine types and interface directly with the low-level byte representations of data structures.
CPP BangPatterns CApiFFI Strict StrictData RoleAnnotations ForeignFunctionInterface InterruptibleFFI UnliftedFFITypes MagicHash UnboxedSums UnboxedTuples
https://gist.github.com/mightybyte/6c469c125eb50e0c2ebf4ae26b5adfff
Level 0 - Use at will
Tried and true extensions. Very unlikely to cause problems. You can use these and rarely get any complaints.
ApplicativeDo AutoDeriveTypeable -- Automatic derivation of Typeable BangPatterns Cpp DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveGeneric DeriveLift DeriveTraversable EmptyDataDecls ExistentialQuantification ExplicitForAll FlexibleContexts FlexibleInstances ForeignFunctionInterface GeneralizedNewtypeDeriving JavaScriptFFI KindSignatures LambdaCase MagicHash MonomorphismRestriction MultiParamTypeClasses OverloadedLists OverloadedStrings PackageImports PartialTypeSignatures RankNTypes RecordWildCards -- This one is somewhat controversial ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications UnboxedTuples ViewPatterns
Level 1 - More complex, but well understood
More complexity than level 0, but on the whole quite well understood and useful. Pose a little bit more of an obstacle in terms of concepts you need to understand to use them. Implementations without level 1 are still preferred if possible.
AllowAmbiguousTypes DefaultSignatures DerivingStrategies FunctionalDependencies GADTs ImplicitPrelude -- Alternate preludes meh QuasiQuotes RecursiveDo TemplateHaskell TypeFamilies TypeOperators TypeSynonymInstances UndecidableInstances
Now, with that small digression out of the way, the question becomes precisely which extensions should go into that default-extensions list. I happen to like using most of the features GHC makes available, so I enable a whopping 34 language extensions by default. As of GHC 8.2, here is my list:
ApplicativeDo BangPatterns ConstraintKinds DataKinds DefaultSignatures DeriveFoldable DeriveFunctor DeriveGeneric DeriveLift DeriveTraversable DerivingStrategies EmptyCase ExistentialQuantification FlexibleContexts FlexibleInstances FunctionalDependencies GADTs GeneralizedNewtypeDeriving InstanceSigs KindSignatures LambdaCase MultiParamTypeClasses MultiWayIf NamedFieldPuns OverloadedStrings PatternSynonyms RankNTypes ScopedTypeVariables StandaloneDeriving TupleSections TypeApplications TypeFamilies TypeFamilyDependencies TypeOperators
https://www.schoolofhaskell.com/user/PthariensFlame/guide-to-ghc-extensions
The extensions which are currently covered are:
BangPatterns BinaryLiterals DatatypeContexts DoAndIfThenElse DoRec EmptyCase EmptyDataDecls ExistentialQuantification ExplicitForAll GADTs GADTSyntax Haskell98 Haskell2010 LambdaCase LiberalTypeSynonyms MonadComprehensions MultiWayIf NegativeLiterals NPlusKPatterns NondecreasingIndentation NumDecimals OverloadedLists OverloadedStrings PackageImports ParallelListComp PatternGuards PatternSignatures PatternSynonyms PolymorphicComponents PostfixOperators Rank2Types RankNTypes RecursiveDo ScopedTypeVariables TransformListComp TupleSections UnicodeSyntax ViewPatterns
Welcome View Patterns Pattern Synonyms Record WildCards? (and OverloadedStrings?) Bang Patterns Rebindable Syntax (and NoMonomorphismRestriction?) List Comprehensions (and ParallelListComp?, TransformListComp?, MonadComprehensions?, RecordWildCards?) Type Operators Recursive Do Nullary Type Classes Implicit Parameters Type Families (and FlexibleContexts?) Multi Param Type Classes (and FlexibleInstances?) Functional Dependencies Deriving (and DeriveFunctor? DeriveFoldable? DeriveTraversable? DeriveDataTypeable? GeneralizedNewtypeDeriving?) Derive Generic (and UndecidableInstances? FunctionalDependencies? TypeOperators?) Overloaded Strings Rank N Types (and TypeFamilies? GADTs KindSignatures?) Existential Quantification Scoped Type Variables Arrows Template Haskell Static Pointers Thanks
git clone https://github.com/tssm/up-to-date-real-world-haskell.git cd up-to-date-real-world-haskell/ /bin/grep LANGUAGE *.org
BangPatterns? CPP DeriveDataTypeable? FlexibleContexts? ForeignFunctionInterface? FunctionalDependencies? FlexibleInstances? GeneralizedNewtypeDeriving? MultiParamTypeClasses? PatternGuards? TypeSynonymInstances?
git clone https://github.com/tssm/up-to-date-real-world-haskell.git cd up-to-date-real-world-haskell/ /bin/grep LANGUAGE *.org
BangPatterns? CPP DeriveDataTypeable? FlexibleContexts? FlexibleInstances? ForeignFunctionInterface? FunctionalDependencies? GeneralizedNewtypeDeriving? MultiParamTypeClasses? PatternGuards? TypeSynonymInstances?
git clone https://github.com/bos/rwh.git cd rwh /bin/grep -r LANGUAGE *
BangPatterns? CPP DeriveDataTypeable? EmptyDataDecls? FlexibleContexts? FlexibleInstances? ForeignFunctionInterface? FunctionalDependencies? GeneralizedNewtypeDeriving? MultiParamTypeClasses? OverlappingInstances? PatternGuards? TypeSynonymInstances? UndecidableInstances?
(so these two lists are the same except the second one adds: EmptyDataDecls? OverlappingInstances? UndecidableInstances? )
>34% net 2020:
BangPatterns? DeriveFoldable? DeriveFunctor? DeriveGeneric? DeriveTraversable? DerivingVia? FlexibleContexts? FlexibleInstances? GADTs GeneralizedNewtypeDeriving? LambdaCase? OverloadedStrings? RankNTypes? ScopedTypeVariables? TypeApplications?
>%20 2019 takes out
DerivingVia? (>17%)
and adds
TypeFamilies?
2020 >25% net would add:
+37% -4% DerivingStrategies? +37% -4% MultiParamTypeClasses? +37% -4% TupleSections? +35% -7% DataKinds? +33% -4% KindSignatures? +32% -6% TypeFamilies? +30% -4% StandaloneDeriving?
all of which, except StandaloneDeriving? (between 15% and 13%) and TypeFamilies? (above 20%), were in between 20% and 15% in 2019
so i think we can stick with orig 34% list, minus DerivingVia?:
the following is >34% net in 2020 and >20% in 2019 State of Haskell surveys:
BangPatterns? DeriveFoldable? DeriveFunctor? DeriveGeneric? DeriveTraversable? FlexibleContexts? FlexibleInstances? GADTs GeneralizedNewtypeDeriving? LambdaCase? OverloadedStrings? RankNTypes? ScopedTypeVariables? TypeApplications?
all of these are in https://limperg.de/ghc-extensions/ 's "basic track" except the following which are in eis "Advanced Track":
BangPatterns? GADTs
So labeling those:
BangPatterns? (advanced in Limperg) DeriveFoldable? DeriveFunctor? DeriveGeneric? DeriveTraversable? FlexibleContexts? FlexibleInstances? GADTs (advanced in Limperg) GeneralizedNewtypeDeriving? LambdaCase? OverloadedStrings? RankNTypes? ScopedTypeVariables? TypeApplications?
considering http://dev.stephendiehl.com/hask/#language-extensions 's Benign/Advanced/Lowlevel lists):
and https://gist.github.com/mightybyte/6c469c125eb50e0c2ebf4ae26b5adfff (Beardsley's lists)
BangPatterns? (advanced in Limperg, lowlevel in Diehl; is in RWH) DeriveFoldable? (not in Diehl's Benign/Advanced/Lowlevel lists, not in PthariensFlame?'s list) DeriveFunctor? (not in Diehl's Benign/Advanced/Lowlevel lists, not in PthariensFlame?'s list) DeriveGeneric? (not in PthariensFlame?'s list) DeriveTraversable? (not in Diehl's Benign/Advanced/Lowlevel lists, not in PthariensFlame?'s list) FlexibleContexts? (not in PthariensFlame?'s list; is in RWH) FlexibleInstances? (not in PthariensFlame?'s list; is in RWH) GADTs (advanced in Limperg, Diehl, "More complex, but well understood" in Beardsley) GeneralizedNewtypeDeriving? (not in PthariensFlame?'s list; is in RWH) LambdaCase? (not in 24 Days of GHC Extensions) OverloadedStrings? RankNTypes? (advanced in Diehl) ScopedTypeVariables? TypeApplications? (advanced in Diehl, not in PthariensFlame?'s list, not in 24 Days of GHC Extensions)
and all were in Diehl's Benign list except for as labeled, and all were in Beardsley's "Use at will" list except GADTs which were in his "More complex, but well understood" as labeled. All were in https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/#any-flavor-you-like 's list of 34 extensions used by default. Those not in https://www.schoolofhaskell.com/user/PthariensFlame/guide-to-ghc-extensions are labeled. Those not in https://ocharles.org.uk/pages/2014-12-01-24-days-of-ghc-extensions.html are labeled.
now considering adding more:
other items in 2020 SOH >=20% net:
ConstraintKinds? DataKinds? DeriveLift? DeriveDataTypeable? DerivingStrategies? DerivingVia? InstanceSigs? KindSignatures? MultiParamTypeClasses? MultiWayIf? NumericUnderscores? StandaloneDeriving? TupleSections? TypeFamilies? TypeOperators? ViewPatterns?
other items in 2019 SOH >=14% removes:
ConstraintKinds? DeriveLift? InstanceSigs? NumericUnderscores?
leaving:
DataKinds? (Limperg advanced, Diehl advanced, Beardsley's lists as "Avoid unless you have a VERY good reason", not in 24 Days of GHC Extensions) DeriveDataTypeable? (Limperg notes "Recent GHCs derive instances of Typeable without you even writing a deriving clause, so you don’t need DeriveDataTypeable? for that anymore." and places in Misc; not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's list) DerivingStrategies? (Limperg advanced, Beardsley's "More complex, but well understood" list, not in 24 Days of GHC Extensions) DerivingVia? (Limperg advanced, Diehl advanced, not in Beardsley's lists, not in lexi-lambda's default list, not in 24 Days of GHC Extensions) KindSignatures? (Limperg advanced, Diehl advanced (implied by TypeFamilies?)) MultiParamTypeClasses? MultiWayIf? (not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley hasn't decided where to put this yet, is in PthariensFlame?'s list, not in 24 Days of GHC Extensions) StandaloneDeriving? (Limperg advanced, not in Diehl's Benign/Advanced/Lowlevel lists, not in 24 Days of GHC Extensions) TupleSections? (is in PthariensFlame?'s list, not in 24 Days of GHC Extensions) TypeFamilies? (Limperg advanced, Diehl advanced, Beardsley's "More complex, but well understood" list) TypeOperators? (Diehl advanced, Beardsley's "More complex, but well understood" list)) ViewPatterns? (not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's default list, is in PthariensFlame?'s list)
all of these are in https://limperg.de/ghc-extensions/ 's "basic track" except as labeled and all were in Diehl's Benign list except for as labeled, and all were in Beardsley's "Use at will" list except GADTs which were in his "More complex, but well understood" as labeled. All were in https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/#any-flavor-you-like 's list of 34 extensions used by default except as labeled Those IN https://www.schoolofhaskell.com/user/PthariensFlame/guide-to-ghc-extensions are labeled. Only one on this list was in Real World Haskell: MultiParamTypeClasses?
So the following are >33% net in 2020 State of Haskell survey and >19% in 2019 State of Haskell survey, and on Diehl's Benign list, and in Beardsley's "Use at will list", and in lexi-lambda's list of extensions to use by default, and are on at least 2 of 3 of (PthariensFlame?'s list, Real World Haskell, 24 Days of GHC extensions):
FlexibleContexts? (not in PthariensFlame?'s list; is in RWH) FlexibleInstances? (not in PthariensFlame?'s list; is in RWH) GeneralizedNewtypeDeriving? (not in PthariensFlame?'s list; is in RWH) LambdaCase? (not in 24 Days of GHC Extensions) MultiParamTypeClasses? TupleSections? (not in 24 Days of GHC Extensions) OverloadedStrings? ScopedTypeVariables?
And the following are >33% net in 2020 State of Haskell survey and >19% in 2019 State of Haskell survey, and on Diehl's Benign or Advanced list (or with Diehl use classfication General/Deriving), and in Beardsley's "Use at will" list or "More complex, but well understood", and on at least one of (Diehl's Benign or Diehl's Lowlevel or Beardsley's "Use at will"), and in lexi-lambda's list of extensions to use by default, and are on at least 1 of 3 of (PthariensFlame?'s list, Real World Haskell, 24 Days of GHC extensions):
BangPatterns? (advanced in Limperg, lowlevel in Diehl; is in RWH) DeriveFoldable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveFunctor? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveGeneric? (not in PthariensFlame?'s list) DeriveTraversable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) GADTs (advanced in Limperg, both benign and advanced in Diehl, "More complex, but well understood" in Beardsley; also in 24 Days of GHC Extensions) RankNTypes? (advanced in Diehl) TypeApplications? (advanced in Diehl, not in PthariensFlame?'s list, not in 24 Days of GHC Extensions)
And the following are >33% net in 2020 State of Haskell survey and >15% in 2019 State of Haskell survey and on the lists Limperg Advanced, Diehl's Benign or Advanced, Beardsley's "More complex, but well understood", lexi-lambda, PthariensFlame?:
DerivingStrategies? (Limperg advanced, Beardsley's "More complex, but well understood" list, not in 24 Days of GHC Extensions)
And the following are >20% net in 2020 State of Haskell survey and >14% in 2019 State of Haskell survey, and on at least one of Limperg's Basic list, Diehl's Benign list, or Beardsley's "Use at will list" and at least one of the other two out of (Limperg, Diehl, Beardsley) list as either basic/benign/use at will or advanced/more complex but well understood, and in lexi-lambda's list of extensions to use by default unless listed, and are on at least 1 of (PthariensFlame?'s list, Real World Haskell, 24 Days of GHC extensions):
KindSignatures? (Limperg advanced, Diehl advanced (implied by TypeFamilies?, is in 24 Days of GHC Extensions) TypeOperators? (Diehl advanced, Beardsley's "More complex, but well understood" list, is in 24 Days of GHC Extensions) ViewPatterns? (not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's default list, is in PthariensFlame?'s list and 24 days of GHC extensions)
And the following are >20% net in 2020 State of Haskell survey and >14% in 2019 State of Haskell survey, and on at least one of Limperg's Basic or Advanced list, Diehl's Advanced list, or Beardsley's "Use at will" or "More complex but still well understood", and in lexi-lambda's list of extensions to use by default unless listed:
DataKinds? (Limperg advanced, Diehl advanced, Beardsley's lists as "Avoid unless you have a VERY good reason") DerivingVia? (Limperg advanced, Diehl advanced, not in Beardsley's lists, not in lexi-lambda's default list) MultiWayIf? (not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley hasn't decided where to put this yet; is in PthariensFlame?'s list) StandaloneDeriving? (Limperg advanced, not in Diehl's Benign/Advanced/Lowlevel lists) TypeFamilies? (Limperg advanced, Diehl advanced, Beardsley's "More complex, but well understood" list, is in 24 days of GHC extensions)
obsolete: DeriveDataTypeable? (Limperg notes "Recent GHCs derive instances of Typeable without you even writing a deriving clause, so you don’t need DeriveDataTypeable? for that anymore." and places in Misc; not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's list)
Others not above, but >10% in 2020 State of Haskell survey, and at least one of (Limperg Basic, Diehl Benign, Beardsley "Use at will"), and on at least two other lists (not counting "avoid" or "undecided" lists):
DeriveLift? (21% net in 2020 survey, <10% in 2019 survey, Limperg Advanced, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley Use at will, is in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) ExistentialQuantification? (15% net in 2020 survey, <10% in 2019 survey, Limperg Advanced, Diehl Advanced, Beardsley Use at will, is in lexi lambda's list, is in PthariensFlame?'s list, is in 24 days) ExplicitForAll? (18% net in 2020 survey, 11% in 2019 survey, Limperg Basic, Diehl Advanced (implied by ExistentialQuantification?), Beardsley Use at will, not in lexi lambda's list, is in PthariensFlame?'s list, not in 24 days) FunctionalDependencies? (17% net in 2020 survey, 12% in 2019 survey, Limperg Basic, Diehl Benign, Beardsley More complex, but well understood, is in lexi lambda's list, not in PthariensFlame?'s list, is in 24 days) GADTSyntax (18% net in 2020 survey, 11% in 2019 survey, Limperg Advanced, Diehl benign and advanced (implied by GADTs), Beardsley undecided, not in lexi lambda's list, is in PthariensFlame?'s list, not in 24 days) PatternSynonyms? (15% net in 2020 survey, 10% in 2019 survey, Limperg Basic, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley undecided, is in lexi lambda's list, is in PthariensFlame?'s list, not in 24 days)
In the above list, only FunctionalDependencies? is in RWH.
Others not above, but >10% in 2020 State of Haskell survey, and at least one of (Limperg Basic or Advanced, Diehl Benign or Advanced, Beardsley "Use at will" or "More complex, but well understood"), and on at least one other lists (not counting "avoid" or "undecided" lists):
BinaryLiterals? (18% net in 2020 survey, <10% in 2019 survey, Limperg Advanced, not mentioned by Diehl, Beardsley undecided, not in lexi lambda's list, is in PthariensFlame?'s list, not in 24 days) ConstraintKinds? (23% net in 2020 survey, 13% in 2019 survey, Limperg Advanced, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley Avoid unless you have a VERY good reason, is in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) DefaultSignatures? (15% net in 2020 survey, <10% in 2019 survey, Limperg Advanced, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley More complex, but well understood, is in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) DeriveAnyClass? (13% net in 2020 survey, 13% in 2019 survey, Limperg Advanced, Diehl Benign, Beardsley Avoid unless you have a VERY good reason, not in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) EmptyCase? (19% net in 2020 survey, 13% in 2019 survey, Limperg Advanced, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley undecided, is in lexi lambda's list, is in PthariensFlame?'s list, not in 24 days) InstanceSigs? (22% net in 2020 survey, 11% net in 2019 survey, Limperg Basic, not in Diehl's Benign/Advanced/Lowlevel lists, Beardsley undecided, is in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) NamedFieldPuns? (18% net in 2020 survey, 10% in 2019 survey, Limperg Basic, not in Diehl's Benign/Advanced/Lowlevel lists, not mentioned by Beardsley, is in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) PolyKinds? (10% net in 2020 survey, <10% in 2019 survey, Limperg Advanced, Diehl Advanced, Beardsley Avoid unless you have a VERY good reason, not in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days) RecordWildCards? (13% net in 2020 survey, 13% in 2019 survey, Limperg Basic, not in Diehl's Benign/Advanced/Lowlevel lists, not mentioned by Beardsley, not in lexi lambda's list, not in PthariensFlame?'s list, is in 24 days)
In the above list, no items are in RWH.
Others not above, but >10% in 2020 State of Haskell survey:
NumericUnderscores? (21% net in 2020 survey, 10% in 2019 survey, Limperg Basic, not mentioned by Diehl, not mentioned by Beardsley, not in lexi lambda's list, not in PthariensFlame?'s list, not in 24 days)
In the above list, no items are in RWH.
TODO: Diehl general/specialized, both sets
---
So i think the most important Haskell GHC extensions, divided into tiers, are (look thru the above to figure out the defns of tiers):
Tier 0 (should clearly be added to language; net majority 'vote' in 2020 Haskell survey): LambdaCase? (not in 24 Days of GHC Extensions) OverloadedStrings?
Tier 1 (should probably be added to language; widely used and recommended; net >=33% 'vote' in 2020 Haskell survey):
BangPatterns? (advanced in Limperg, lowlevel in Diehl; is in RWH) DeriveFoldable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveFunctor? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveGeneric? (not in PthariensFlame?'s list) DeriveTraversable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) FlexibleContexts? (not in PthariensFlame?'s list; is in RWH) FlexibleInstances? (not in PthariensFlame?'s list; is in RWH) GeneralizedNewtypeDeriving? (not in PthariensFlame?'s list; is in RWH) MultiParamTypeClasses? ScopedTypeVariables? (Diehl 'specialized') TupleSections? (not in 24 Days of GHC Extensions)
Tier 2 (should probably be added to language; widely used and recommended but somewhat advanced; net >=33% 'vote' in 2020 Haskell survey):
DerivingStrategies? (Limperg advanced, Beardsley's "More complex, but well understood" list, not in 24 Days of GHC Extensions; Diehl doesn't list general/specialized (but it's Diehl Benign)) GADTs (advanced in Limperg, both benign and advanced in Diehl, "More complex, but well understood" in Beardsley; also in 24 Days of GHC Extensions) RankNTypes? (advanced and specialized in Diehl; Limperg lists as Basic but only b/c it's required for the ST monad) TypeApplications? (advanced and specialized in Diehl, not in PthariensFlame?'s list, not in 24 Days of GHC Extensions)
Tier 3 (fairly widely used and recommended; net >=20% 'vote' in 2020 Haskell survey):):
KindSignatures? (Limperg advanced, Diehl advanced (implied by TypeFamilies?) and specialized, is in 24 Days of GHC Extensions) TypeOperators? (Diehl advanced and specialized, Beardsley's "More complex, but well understood" list, is in 24 Days of GHC Extensions) ViewPatterns? (not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's default list, is in PthariensFlame?'s list and 24 days of GHC extensions) DataKinds? (Limperg advanced, Diehl advanced and specialized, Beardsley's lists as "Avoid unless you have a VERY good reason") DerivingVia? (Limperg advanced, Diehl advanced (doesn't list general/specialized), not in Beardsley's lists, not in lexi-lambda's default list) MultiWayIf? (not in Diehl's Benign/Advanced/Lowlevel lists, specialized in Diehl, Beardsley hasn't decided where to put this yet; is in PthariensFlame?'s list) StandaloneDeriving? (Limperg advanced, not in Diehl's Benign/Advanced/Lowlevel lists) TypeFamilies? (Limperg advanced, Diehl advanced and specialized, Beardsley's "More complex, but well understood" list, is in 24 days of GHC extensions) DeriveDataTypeable? (Limperg notes "Recent GHCs derive instances of Typeable without you even writing a deriving clause, so you don’t need DeriveDataTypeable? for that anymore." and places in Misc; not in Diehl's Benign/Advanced/Lowlevel lists, not in lexi-lambda's list)
(note: in the above i added information to note whenever Diehl lists something as 'specialized')
so, based on the above, i might recommend the following 17 additions to the language/default extensions:
BangPatterns? (advanced in Limperg, lowlevel in Diehl; is in RWH) DeriveFoldable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveFunctor? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DeriveGeneric? (not in PthariensFlame?'s list) DeriveTraversable? (not in Diehl's Benign/Advanced/Lowlevel lists but General/Deriving, not in PthariensFlame?'s list) DerivingStrategies? (Limperg advanced, Beardsley's "More complex, but well understood" list, not in 24 Days of GHC Extensions; Diehl doesn't list general/specialized (but it's Diehl Benign)) FlexibleContexts? (not in PthariensFlame?'s list; is in RWH) FlexibleInstances? (not in PthariensFlame?'s list; is in RWH) GADTs (advanced in Limperg, both benign and advanced in Diehl, "More complex, but well understood" in Beardsley; also in 24 Days of GHC Extensions) GeneralizedNewtypeDeriving? (not in PthariensFlame?'s list; is in RWH) LambdaCase? (not in 24 Days of GHC Extensions) MultiParamTypeClasses? OverloadedStrings? RankNTypes? (advanced and specialized in Diehl; Limperg lists as Basic but only b/c it's required for the ST monad) ScopedTypeVariables? (Diehl 'specialized') TupleSections? (not in 24 Days of GHC Extensions) TypeApplications? (advanced and specialized in Diehl, not in PthariensFlame?'s list, not in 24 Days of GHC Extensions)
This is identical to the top 18 items in the https://taylor.fausak.me/2020/11/22/haskell-survey-results/#s2q5, except that that list includes DerivingVia? and my list does not.
The stats of the lowest item on that list (TupleSections?) are +37% -4%. The stats of the next item below it (DataKinds?) are +35% -7%. It's not that surprising that this is the 33% threshold b/c that's what i used above in making the tiers. However, that cutoff did fit in nicely with my analysis of the most basic and widely recommended extensions so I don't think it's totally arbitrary.
i wrote the following in plChHaskell:
The following extensions are within the top 18 items and are >= net 33% in the 2020 Haskell survey poll, and are in the top 22 items and are >= 15% in the 2019 Haskell survey poll, and are rated as Basic in https://limperg.de/ghc-extensions/, and are rated as Benign or General in http://dev.stephendiehl.com/hask/#language-extensions, and are rated as 'Use at will' on https://gist.github.com/mightybyte/6c469c125eb50e0c2ebf4ae26b5adfff , and are on the list of default extensions in https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/ , and are in at least one of https://www.schoolofhaskell.com/user/PthariensFlame/guide-to-ghc-extensions, https://ocharles.org.uk/pages/2014-12-01-24-days-of-ghc-extensions.html:
The following extensions are within the top 18 items and are >= net 33% in the 2020 Haskell survey poll, and are in the top 22 items and are >= 15% in the 2019 Haskell survey poll, and are rated as Basic or Advanced in in https://limperg.de/ghc-extensions/, and are rated as Benign or General or Advanced or Lowlevel in http://dev.stephendiehl.com/hask/#language-extensions, and are rated as 'Use at will' or "More complex, but well understood" on https://gist.github.com/mightybyte/6c469c125eb50e0c2ebf4ae26b5adfff , and are on the list of default extensions in https://lexi-lambda.github.io/blog/2018/02/10/an-opinionated-guide-to-haskell-in-2018/ , and are in at least one of https://www.schoolofhaskell.com/user/PthariensFlame/guide-to-ghc-extensions, https://ocharles.org.uk/pages/2014-12-01-24-days-of-ghc-extensions.html except as noted:
The union of the previous two lists is 17 items. The only extension in the top 18 items or with >= net 33% of the 2020 Haskell survey poll but not on either of these two lists is DerivingVia?.
---
in summary, i should look at/use the following 17 extensions with Haskell:
BangPatterns? DeriveFoldable? DeriveFunctor? DeriveGeneric? DeriveTraversable? LambdaCase? OverloadedStrings? FlexibleContexts? FlexibleInstances? GeneralizedNewtypeDeriving? MultiParamTypeClasses? ScopedTypeVariables? TupleSections?
advanced: DerivingStrategies? GADTs RankNTypes? TypeApplications?
after those, look at DerivingVia?, and then the ones between 20% and 33% net in the 2020 haskell survey:
DataKinds? KindSignatures? TypeFamilies? StandaloneDeriving? MultiWayIf? DeriveDataTypeable? ConstraintKinds? TypeOperators? ViewPatterns? InstanceSigs? DeriveLift? NumericUnderscores?
https://www.google.com/search?q=BangPatterns+DeriveFoldable+DeriveFunctor+%22DeriveGeneric%22+DeriveTraversable+%22LambdaCase%22+%22OverloadedStrings%22+FlexibleContexts+FlexibleInstances+GeneralizedNewtypeDeriving+MultiParamTypeClasses+ScopedTypeVariables+TupleSections+DerivingStrategies+GADTs+RankNTypes+TypeApplications doesn't turn up anything new (in the first 2 pages)
and in the future, just looking at the extensions with net 33%+ (2020; in 2019 the threshold would have been 20%) in the annual Haskell Survey is probably good enough. This is also interesting from a governance perspective; it adds weight to the idea that a procedure where a score -1/0/1 vote of 20%, 25%, or 33%+ is how things should be added to an agenda.
---
https://www.freepascal.org/docs-html/current/rtl/crt/index-5.html
---
https://janet-lang.org/api/index.html
---
btw looks like mutt is written in C and uses curses
https://en.wikipedia.org/wiki/Text-based_user_interface mentions curses, ncurses, newt, cdk
https://www.google.com/search?q=curses+ncurses+%22newt%22+cdk and some of those links also mention DIALOG, PDCurses, SMG$, Turbo Vision, early versions of visual basic (for DOS)
google suggests that the following subset is most popular: "curses" "ncurses" "newt" "cdk" "DIALOG"
and out of those: "ncurses" "newt" "cdk" "DIALOG"
on wikipedia, those pages also lead to: s-lang conio.h whiptail (related to Newt) zenity
note:
https://www.linuxquestions.org/questions/linux-software-2/is-there-a-library-for-creating-console-dialog-boxes-in-c-program-4175596822/ says: "is there a software library that can be used in a C program for creating dialog boxes in console without graphical environment (that is, not zenity or dialog)"... so i guess DIALOG is out? but i think that's incorrect; https://en.wikipedia.org/wiki/Dialog_(software) suggests no graphical environ is needed? i think zenity is gtk tho.
conio and whiptail aren't commonly mentioned on google. So mb:
"ncurses" "newt" "cdk" "DIALOG" "slang"
on slang vs ncurses: https://invisible-island.net/ncurses/ncurses-slang.html
https://www.opensourceforu.com/2011/11/spicing-up-console-for-fun-profit-2/
https://invisible-island.net/dialog/ says "Though similar in style to CDK, it is different, being a script-interpreter which provides a set of curses widgets. Widgets are objects whose appearance and behavior can be customized. There is a much-reduced variation of dialog, called lxdialog, which is used in Linux kernel configuration."
https://en.wikipedia.org/wiki/Dialog_(software) says "One might also consider lxdialog (part of menuconfig), except that it has been reduced to fragments that can no longer run dialog scripts. There are several programs inspired by dialog; not all read the same scripts. The most well-known are Xdialog and whiptail. "
https://linux.slashdot.org/story/01/05/09/0732219/developing-attractive-non-gui-apps-for-unix asks for GUI libs for POS systems and mentions (only comments with 3+ score):
picogui isn't as popular and elisp is obviously a different kind of solution. So we didn't add anything. So we're still at:
"ncurses" "newt" "cdk" "DIALOG" "slang"
https://www.opensourceforu.com/2011/11/spicing-up-console-for-fun-profit-2/ mentions newt and ncurses and also cdk, NDK++. It mentions that newt depends on slang. Dialog is also mentioned.
toread: https://www.opensourceforu.com/2011/11/spicing-up-console-for-fun-profit-2/
"Only a few well-known applications have been developed which could use either ncurses or slang. I have been involved with Lynx, Mutt and Midnight Commander. Most of the early discussion mentions the possibility of others, but provides no useful examples." -- https://invisible-island.net/ncurses/ncurses-slang.html
https://www.google.com/search?q=%22ncurses%22+%22newt%22+%22cdk%22++%22DIALOG%22+%22slang%22
this guy (Thomas E. Dickey) is involved with ncurses, cdk, dialog, and knows a lot about slang:
https://invisible-island.net/ncurses/ncurses-slang.html has a table listing all of the ncurses and slang library functions used by each of 3 programs that can use either ncurses or slang: Lynx, Mutt and Midnight Commander. The table is: https://invisible-island.net/ncurses/ncurses-slang.html#symbol_usage . The rest of the page has a detailed discussion of some architectural differences and their history between ncurses and slang.
https://en.wikipedia.org/wiki/Newt_(programming_library) says that newt "also contains the shared library needed by programs built with newt, as well as an application whiptail, which provides the most commonly used features of dialog. Newt is based on the slang library. It abbreviates from Not Erik's Windowing Toolkit. "
" From the Linux Dictionary: whiptail is a "dialog" replacement using newt instead of ncurses. From its README: whiptail is designed to be drop-in compatible with dialog(1), but has fewer features: some dialog boxes are not implemented, such as tailbox, timebox, calendarbox, etc." [1]