Skip to content

Commit

Permalink
Miscellaneous updates (#2)
Browse files Browse the repository at this point in the history
* update style rules and autoformat
* add an lts-21 config and a nix dev shell
* avoid use of 'head'
* write toModuleFullName point-free
  • Loading branch information
chris-martin authored Jan 22, 2024
1 parent 49e83bb commit aba4c94
Show file tree
Hide file tree
Showing 16 changed files with 407 additions and 160 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ jobs:
strategy:
matrix:
stack-yaml:
- stack-nightly.yaml # ghc-9.4
- stack.yaml # ghc-9.2
- stack-nightly.yaml # ghc-9.4
- stack.yaml # ghc-9.4
- stack-lts-19.6.yaml # ghc-9.2
- stack-lts-18.28.yaml # ghc-8.10
- stack-lts-16.31.yaml # ghc-8.8
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: freckle/stack-action@v4
with:
stack-yaml: ${{ matrix.stack-yaml }}

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: haskell/actions/hlint-setup@v2
- uses: haskell/actions/hlint-run@v2
with:
Expand Down
4 changes: 4 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
restylers:
- fourmolu
- "!stylish-haskell"
- "*"
25 changes: 0 additions & 25 deletions .stylish-haskell.yaml

This file was deleted.

70 changes: 0 additions & 70 deletions brittany.yaml

This file was deleted.

12 changes: 6 additions & 6 deletions example/Hspec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ module Main

import Prelude

import Module.Discover.Run (Module(..), run)
import Module.Discover.Run (Module (..), run)
import System.Environment (getArgs)

main :: IO ()
main = getArgs >>= run (pure . make) Nothing

make :: [Module] -> String
make modules =
unlines
$ ["module Main (main) where", ""]
<> (toQualifiedImport <$> modules)
<> ["", "main :: IO ()", "main = do"]
<> (toMainCall <$> modules)
unlines $
["module Main (main) where", ""]
<> (toQualifiedImport <$> modules)
<> ["", "main :: IO ()", "main = do"]
<> (toMainCall <$> modules)

toQualifiedImport :: Module -> String
toQualifiedImport Module {..} = "import qualified " <> moduleFullName
Expand Down
12 changes: 6 additions & 6 deletions example/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ module Main

import Prelude

import Module.Discover.Run (Module(..), run)
import Module.Discover.Run (Module (..), run)
import System.Environment (getArgs)

main :: IO ()
main = getArgs >>= run (pure . make) Nothing

make :: [Module] -> String
make modules =
unlines
$ ["module Main (main) where", ""]
<> (toQualifiedImport <$> modules)
<> ["", "main :: IO ()", "main = do"]
<> (toMainCall <$> modules)
unlines $
["module Main (main) where", ""]
<> (toQualifiedImport <$> modules)
<> ["", "main :: IO ()", "main = do"]
<> (toMainCall <$> modules)

toQualifiedImport :: Module -> String
toQualifiedImport Module {..} =
Expand Down
Loading

0 comments on commit aba4c94

Please sign in to comment.