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/.

28 questions
19
votes
2 answers

Haskell: how to tell hlint not to: `Warning: Use string literal`

I have a unit test file: module X04PatMatTest where import AssertError import Test.HUnit import X04PatMat ... and hlint complains: X04PatMatTest.hs:15:69: Warning: Use string literal Found: ['a', 'b', 'd'] Why not: "abd" for various…
haroldcarr
  • 1,431
  • 13
  • 17
14
votes
3 answers

What does eta reduce mean in the context of HLint

I'm looking at the tutorial http://haskell.org/haskellwiki/How_to_write_a_Haskell_program import System.Environment main :: IO () main = getArgs >>= print . haqify . head haqify s = "Haq! " ++ s When running this program under HLint it gives the…
chollida
  • 7,536
  • 11
  • 50
  • 85
13
votes
2 answers

Does Leksah have hlint, hoogle integration?

Does leksah support any kind of plugins? Will it? Does it have any plugins built in, such as hlint, hoogle, pl, djinn? If not, is there an easy way to integrate these things?
Dan Burton
  • 51,332
  • 25
  • 109
  • 190
10
votes
1 answer

Using Hlint with intero on emacs

I can't get hlint suggestions to appear in emacs using intero. I have a new installation of emacs 24.5 I added the intero stuff at here into new ~/.emacs file I've done nothing else to emacs. I've read that the solution…
BillyBadBoy
  • 480
  • 3
  • 16
10
votes
3 answers

Difference between two functions creating a singleton list

When running hlint over my program it reported an error for \x -> [x] and suggested the alternative form (: []) What is there erroneous according to hlint about the first form, and thus why should I use the (less readable) second…
Laar
  • 551
  • 1
  • 4
  • 11
9
votes
3 answers

Is there an equivalent to HLint for Erlang?

HLint is a Haskell lint tool for making code more idiomatic. Is there something like it for Erlang?
mcandre
  • 19,306
  • 17
  • 77
  • 140
8
votes
2 answers

is there a command to apply hlint suggestions in emacs?

I'm using flycheck and haskell-hlint in emacs when I write Haskell codes and I think it will be great if I can apply those hlint suggestions by invoking some emacs procedures instead of modifying the code manually. If there isn't one available and…
Javran
  • 3,006
  • 1
  • 19
  • 37
8
votes
1 answer

Make HLint ignore parse error due to multi-way if?

I'm using the MultiWayIf language extension. While I love HLint (I'm using version v1.8.61), unfortunately it appears that HLint is not aware of this extension, and it reports multi-way ifs as parse errors: Warning: Parse error: | The HLint Manual…
the-konapie
  • 523
  • 2
  • 10
7
votes
3 answers

stack install ghc-mod fails with dependencies conflicts on OSX 10.13.4

When I try to install ghc-mod via stack I end up having these depencies conflicts Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for ghc-mod-5.8.0.0: Cabal-2.0.1.1 from stack…
Mo Hajr
  • 974
  • 1
  • 11
  • 27
7
votes
4 answers

When I try to install hlint I get errors surrounding old-time-1.1.0.3

I first tried to install Hlint. cabal install hlint but then I got the error: cabal: Error: some packages failed to install: cpphs-1.20.2 depends on old-time-1.1.0.3 which failed to install. haskell-src-exts-1.18.2 depends on old-time-1.1.0.3 which…
Felix Rosén
  • 1,391
  • 1
  • 17
  • 33
7
votes
1 answer

HLint : use &&& suggestion advice

I ran HLint on a little project and it suggested me to use &&&. Example : >>> cat st.hs f = (+) 10 g = (+) 1 main = print $ (\x -> (f x, g x)) 5 >>> hlint st.hs st.hs:4:17: Warning: Use &&& Found: \ x -> (f x, g x) Why not: f Control.Arrow.&&&…
mb14
  • 20,914
  • 4
  • 54
  • 97
5
votes
3 answers

How to run HLint?

I'm only a few weeks in to programming with Haskell. I was told to use HLint to improve my code. The problem is I can't figure out how to run HLint against my .hs file. I read the documentation and I was able to install it using cabal install hlint.…
isADon
  • 2,390
  • 5
  • 27
  • 40
4
votes
2 answers

Hlint suggestion: use uncurry

I have this line of code: map (\(u,v) -> flatTorus n u v) gridUV Hlint suggests me to replace it with map (uncurry (flatTorus n)) gridUV What is the motivation of this suggestion ? Is it for shortness only, or something else (performance) ?…
Stéphane Laurent
  • 48,421
  • 14
  • 86
  • 170
4
votes
3 answers

Is it a bad idea to use [Char] instead of String in Haskell function type declaration

I have just started learning Haskell using "Learn you a Haskell for Great Good". I am currently reading "Types and Typeclasses" chapter, so my knowledge is pretty .. non-existent. I am using Sublime Text 2 with SublimeHaskell package which…
Ivan Davidov
  • 823
  • 8
  • 23
3
votes
1 answer

Unrecognised HLINT pragma in Haskell

I'm trying to disable some warnings that HLint is giving me. According to docs I should be able to add a pragma to the top of my file. So I tried the following: {-# HLINT ignore #-} module Main where Which however gives me an error when running…
Rene Saarsoo
  • 12,403
  • 8
  • 51
  • 75
1
2