Haskell statistics for use of TypeFamilies and FunctionalDependencies

Continuing my investigation of my local copies of patch-tag+github+c.h.o+misc repositories (, I rewrote my haskell-src-exts script to examine LANGUAGE extensions in use (ignoring any .cabal flags): import Language.Haskell.Exts import qualified Data.Foldable as F (concat) import Control.Monad (when) main :: IO () main = do args <- fmap lines $ getContents mapM_ (\a -> checkAndPrint a `catch` (\_ -> return ())) args checkAndPrint :: FilePath -> IO () checkAndPrint fs = do x <- readFile fs let exts = F.concat $ readExtensions x let exts' = filter (\y -> y == FunctionalDependencies || y == TypeFamilies) exts when (not $ null exts') $ putStr (fs++":") >> (putStrLn $ unwords $ map show exts) return () The attachment is the gzipped* result of `find . -type f -name "*?hs" | sort | runhaskell ~/extensions.hs >> ~/exts.txt`. Notes: - 3597 files matched either LANUAGE - there were: 2685 users of TypeFamilies 1030 users of FunctionalDependencies 118 users of TypeFamilies+FunctionalDependencies 2.7k TypeFamilies may be surprisingly large; if so, it may be due to GHC and its duplicates; 947 lines match the string 'ghc' and 721 lines match both 'ghc' and 'TypeFamilies'. * 500k is a bit much for an attachment -- gwern http://www.gwern.net
participants (1)
-
Gwern Branwen