Switch to fourmolu
This commit is contained in:
parent
ca4f5df04d
commit
63c385280e
6 changed files with 19 additions and 4 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"editor.formatOnType": true,
|
||||
"editor.formatOnSave": true,
|
||||
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix"
|
||||
"nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix",
|
||||
"haskell.formattingProvider": "fourmolu"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# haskell-template
|
||||
|
||||
Haskell project template optimized for a fully reproducible and friendly development environment. Based on [Nix](http://www.srid.ca/haskell-nix) + [Flakes](https://serokell.io/blog/practical-nix-flakes) + VSCode ([HLS](https://github.com/haskell/haskell-language-server)) + [ormolu](https://github.com/tweag/ormolu) autoformatting + [Relude](https://github.com/kowainik/relude#relude) as Prelude.
|
||||
Haskell project template optimized for a fully reproducible and friendly development environment. Based on [Nix](http://www.srid.ca/haskell-nix) + [Flakes](https://serokell.io/blog/practical-nix-flakes) + VSCode ([HLS](https://github.com/haskell/haskell-language-server)) + [fourmolu](https://github.com/fourmolu/fourmolu) autoformatting + [Relude](https://github.com/kowainik/relude#relude) as Prelude.
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell ../shell.nix -i bash
|
||||
set -xe
|
||||
find src -name \*.hs | xargs ormolu -m inplace -o -XImportQualifiedPost -o -XTypeApplications
|
||||
find src -name \*.hs | xargs fourmolu -m inplace -o -XImportQualifiedPost -o -XTypeApplications
|
||||
nixpkgs-fmt *.nix
|
||||
cabal-fmt -i *.cabal
|
|
@ -39,7 +39,7 @@
|
|||
cabal-install
|
||||
ghcid
|
||||
haskell-language-server
|
||||
ormolu
|
||||
fourmolu
|
||||
hlint
|
||||
pkgs.nixpkgs-fmt
|
||||
]);
|
||||
|
|
8
fourmolu.yaml
Normal file
8
fourmolu.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
indentation: 2
|
||||
comma-style: leading
|
||||
record-brace-space: true
|
||||
indent-wheres: true
|
||||
diff-friendly-import-export: true
|
||||
respectful: true
|
||||
haddock-style: multi-line
|
||||
newlines-between-decls: 1
|
|
@ -2,6 +2,12 @@ module Main where
|
|||
|
||||
import Main.Utf8 (withUtf8)
|
||||
|
||||
{- |
|
||||
Main entry point.
|
||||
|
||||
The `bin/run` script will invoke this function. See `.ghcid` file to change
|
||||
that.
|
||||
-}
|
||||
main :: IO ()
|
||||
main = do
|
||||
-- For withUtf8, see https://serokell.io/blog/haskell-with-utf8
|
||||
|
|
Loading…
Reference in a new issue