Questions tagged [hlint]

HLint is a program that gives suggestions on how to improve your Haskell source code.

HLint is an open-source Haskell program that makes suggestions about Haskell source code, using a user-extendable database of rules. The changes are designed to increase the readability of the source code, and are particularly suited for beginners. The home page for HLint is http://community.haskell.org/~ndm/hlint/.

29 questions
3
votes
2 answers

Can HLint automatically do suggested edits?

HLint gives suggestion how one can improve source code. However, given the nature of the suggestions, I wonder whether it's possible to automatically apply those suggestions. Is it possible to automatically apply suggestions proposed by hlint?
user6023611
3
votes
0 answers

Make hlint run ever time ghc and ghci does?

How can you make HLint run evertime you compile or interpret a haskell module with ghc (or inside of ghci.) Note: I am using geany on Ubuntu.
PyRulez
  • 10,513
  • 10
  • 42
  • 87
2
votes
1 answer

Hlint integration with (Win)GHCi

Using Hlint via the command prompt works for me, but I have problem trying to perform the GHCi integration. http://community.haskell.org/~ndm/darcs/hlint/hlint.htm says that "the script is at hlint.ghci [link], and a copy is installed locally in…
efie
  • 544
  • 5
  • 22
2
votes
1 answer

Hlint integration with emacs not working on new machine

I use hlint from within emacs with hs-lint.el in exactly the manner described in the link. hlint lives in my ~/.cabal/bin directory, which is on my $PATH, and everything works as expected when I call it from the command line. When I set this up on…
wvoq
  • 553
  • 3
  • 13
2
votes
1 answer

Makefile examples for Haskell tasks

Rather than invent my own, what are good makefile rules for typical Haskell tasks such as compiling, packaging, hlint, quickcheck, etc? In a search I find things like like this example: ghc -M *.hs
haroldcarr
  • 1,523
  • 15
  • 17
1
vote
1 answer

HLint program not found. Haskell

I am trying to setup haskell-linter for vs-code. I have installed hlint using cabal. Location of hlint ~/.cabal/bin/hlint I have also added the above path in setting.json of VSCode. "haskell.hlint.executablePath": "~/.cabal/bin/hlint" But still…
ujjwal gupta
  • 101
  • 3
  • 13
1
vote
1 answer

Haskell `hlint`, how can I add hint for wrong indentation, trailing spaces and etc?

I tried to use hlint package, but it gives no warnings or configuration for: trailing spaces last empty line spaces between arguments restrict tab indentation redundant lines and other lint option stuff that relates to spaces/tabs and empty…
Roman M. Koss
  • 970
  • 1
  • 15
  • 33
1
vote
1 answer

How to write complex / multi-line hlint rules?

What's the way to match the following code-pattern... do x <- createModel a b case x of Left e -> throwM $ ValidationErrors e Right y -> ... ...and suggest the following replacement: withThrow $ createModel a b I tried the following,…
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
1
vote
1 answer

Proper Way To Pass hlint Arguments to ghc-mod?

I'm trying to lint a file with ghc-mod. I know ghc-mod uses hlint for this and I know that hlint accepts arguments to modify the suggestions it reports. For instance, this works just fine: eric@linux-epth:total-beginner-haskell$ hlint…
ericky
  • 1,641
  • 2
  • 14
  • 16
1
vote
1 answer

How to get stack to run extra commands when building a haskell package?

I had made a script for compiling my haskell programs (so far just simple scripts consisting in a single source file) that contained, before the call to ghc, the following lines: echo "Running hlint" hlint ${1} echo "Running scan" ~/.cabal/bin/scan…
bli
  • 7,549
  • 7
  • 48
  • 94
1
vote
1 answer

Using HLint.hs file in EclipseFP

Is it possible to use HLint.hs file to customize HLint messages in EclipseFP? I tried adding a HLint.hs file in the project root containing: import "hint" HLint.HLint ignore "Use camelCase" but it has no effect: Update: For HLint to pick up the…
Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
0
votes
1 answer

Issue installing hlint on windows

I'm trying to install hlint on Windows using: cabal install hlint, and I get the following error: Preprocessing executable 'hlint' for hlint-1.8.50.. Building executable 'hlint' for hlint-1.8.50.. : warning:…
PSS
  • 5,561
  • 5
  • 28
  • 30
0
votes
0 answers

" [Linter] Error running HLint " ? hlint doesn't work on Atom

I installed 'linter 2.2.0' on Atom (this also installed: busy-signal 1.4.3, intentions 1.1.5, linter-ui-default 1.6.10). Then I installed 'linter-hlint 2.0.0' , however it doesn't work. I get an error saying: "[Linter] Error running HLint , see…
Bn.F76
  • 783
  • 2
  • 12
  • 30
-2
votes
1 answer

Parse error, possiby identation or mismatch brackets

I'm writing a program in haskell but I doesn't get rid of an error: mountTree :: [Char] -> FilePath -> Int -> Either IO [FilePath] String mountTree promatiList toScan 0 = do b <- getDirectoryContests(initial) return mountTree…
1
2