diff --git a/ghcaniuse.cabal b/ghcaniuse.cabal index 02e651d..db5044b 100644 --- a/ghcaniuse.cabal +++ b/ghcaniuse.cabal @@ -1,6 +1,6 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack diff --git a/src/GHCanIUse/CLI.hs b/src/GHCanIUse/CLI.hs index 9a52f26..19e4fd3 100644 --- a/src/GHCanIUse/CLI.hs +++ b/src/GHCanIUse/CLI.hs @@ -39,8 +39,8 @@ instance ParseRecord (Options Wrapped) where runCLI :: IO () runCLI = do options <- - unwrapRecord $ - unwords ["GHCanIUse", "v" <> pack (showVersion GHCanIUse.version)] + unwrapRecord + $ unwords ["GHCanIUse", "v" <> pack (showVersion GHCanIUse.version)] releases <- getGHCReleases options stopGlobalPool renderToFile "index.html" $ generatePage $ ghcReleasesToExtensionsMap releases @@ -66,8 +66,11 @@ processVersion Options {..} ghcVersion = do where getFilePath = (directory ) . unpack . getLanguagesFileName logEntry (ext, url) = - putStrLn . unpack $ - displayLangAtVersion ext ghcVersion <> " -> " <> maybe "" render url + putStrLn + . unpack + $ displayLangAtVersion ext ghcVersion + <> " -> " + <> maybe "" render url getLanguagesFromFile :: FilePath -> IO (Set LanguageExtension) getLanguagesFromFile fp = do @@ -92,15 +95,15 @@ makeGHCRelease releaseVersion releaseLanguages = ghcUserGuideURL :: GHCVersion -> URI ghcUserGuideURL v@(GHCVersion {..}) = - fromMaybe baseURI $ - emptyURI + fromMaybe baseURI + $ emptyURI { uriScheme = Nothing, uriAuthority = Left False, uriPath = sequence pathsNE >>= \paths -> pure (True, paths), uriQuery = [], uriFragment = Nothing } - `relativeTo` baseURI + `relativeTo` baseURI where versionNumbers = [major, minor, patch] ghcPath = mkPathPiece $ pack "~ghc" diff --git a/src/GHCanIUse/Render.hs b/src/GHCanIUse/Render.hs index 8eaf01f..d09e35b 100644 --- a/src/GHCanIUse/Render.hs +++ b/src/GHCanIUse/Render.hs @@ -16,7 +16,7 @@ import qualified Paths_ghcaniuse as GHCanIUse import Relude import Text.URI (render) -(!) :: With a => a -> Attribute -> a +(!) :: (With a) => a -> Attribute -> a (!) a b = a `with` [b] flexRow :: (With (arg -> result), Term arg result) => arg -> result @@ -34,13 +34,16 @@ arrows = p_ [class_ "arrows tc f3 pl2"] do span_ ! class_ "up-arrow ml-1" $ "↑" generateHTMLTable :: LanguageExtensionsMap -> Html () -generateHTMLTable languageExtensions = article_ ! class_ "w100" $ - table_ [id_ "ghc-extensions-table", class_ "bg-white m0"] do +generateHTMLTable languageExtensions = article_ + ! class_ "w100" + $ table_ [id_ "ghc-extensions-table", class_ "bg-white m0"] do thead_ $ tr_ [class_ "bg-white"] do th_ $ flexRow $ h4_ "Language Extensions" >> arrows mapM_ th_ $ displayReleaseHTML <$> allReleases - tbody_ ! class_ "lh-solid" $ - forM_ allExtensions $ \extension -> tr_ do + tbody_ + ! class_ "lh-solid" + $ forM_ allExtensions + $ \extension -> tr_ do th_ ! class_ "tl bg-white" $ toHtml $ unLanguageExtension extension forM_ allReleases $ renderCell extension where @@ -90,9 +93,9 @@ template content = doctypehtml_ do body_ [class_ "f4 bg-black pr flex flex-column"] do header content - script_ [type_ "text/javascript"] $ - tableSort - <> "\nnew Tablesort(document.getElementById('ghc-extensions-table'));" + script_ [type_ "text/javascript"] + $ tableSort + <> "\nnew Tablesort(document.getElementById('ghc-extensions-table'));" where keywords = "GHC, haskell, language extensions, table, nix, NixOS, table" description = "Browse the supported language extensions for different GHC versions." diff --git a/test/GHCanIUseSpec.hs b/test/GHCanIUseSpec.hs index 07b68dd..ed2d2fc 100644 --- a/test/GHCanIUseSpec.hs +++ b/test/GHCanIUseSpec.hs @@ -3,17 +3,17 @@ module GHCanIUseSpec where +import Control.Concurrent.ParallelIO (parallelInterleaved) import qualified Data.Map as Map import qualified Data.Set as Set import Data.Text (unpack) import GHCanIUse.CLI import GHCanIUse.Types import Network.HTTP.Req +import Options.Generic (Unwrapped) import Relude import Test.Syd import Text.URI -import Options.Generic (Unwrapped) -import Control.Concurrent.ParallelIO (parallelInterleaved) checkURLDocExists :: URI -> IO () checkURLDocExists url' = do @@ -43,6 +43,6 @@ spec = [release] -> do let docs = releaseLanguages release let urls = catMaybes $ Map.elems $ unLanguageExtensionsDocs docs - void $ liftIO $ parallelInterleaved $ checkURLDocExists <$> urls + void $ liftIO $ parallelInterleaved $ checkURLDocExists <$> urls [] -> expectationFailure $ "Couldn't process " <> show v _ -> expectationFailure "Produced mored releases than 1"