[Haskell-beginners] HLint fails to give suggestions
Mateusz Kowalczyk
fuuzetsu at fuuzetsu.co.uk
Wed May 15 20:27:20 CEST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15/05/13 19:21, irfan hudda wrote:
> Because the code fun1 :: Int -> String fun1 1 = "hell" fun1 2 = 3
> has obvious errors I was expecting HLint to display those errors.
>
I think you don't understand what HLint is supposed to do. It's GHC's
job to show you type errors. HLint is only there to give you
suggestions about style. I believe that the most it can do in terms of
errors is to throw a fit when you have invalid syntax (not the case here).
Example usage:
> module Test where
>
> main :: IO () main = print $ show $ id $ id $ id 5
I get
> Test.hs:5:23: Error: Evaluate Found: id $ id $ id 5 Why not: (id $
> id 5)
>
> Test.hs:5:28: Error: Evaluate Found: id $ id 5 Why not: id 5
> Test.hs:5:33: Error: Evaluate Found: id 5 Why not: 5
>
> 3 suggestions
- --
Mateusz K.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iQIcBAEBAgAGBQJRk9OIAAoJEM1mucMq2pqXhb4P/RqzmJHCHWw3PDHg9Q/KmRKs
0I0xKF+u3mEkOt3xzGg9LO+aqueLCIiSDWItY6romGJNJBI4pz5DA7uc5LOrJASm
z+K2LwC3E7laoW58S9xWgU6hJiGb2HkaVunC78d79mnOPJYq5rpDKzYMTjZssGwM
AAE4C7VZQv6Bbx8iPa/Q5E6Sh1cCLSrHWqmznjCaIpO1TuKJd7+i10Jq6y6kBgDE
VDl/UE6TUGs2ZQCAtLSxwflKloeyNyFf/GCCl35iceAp4uWBwHnuzwLWHEL6TRsq
nT6R3O3vQ8woVOh7S8cEfNutHbSreFRAdZOZDLA5G8rXqDLTLe0Rj+UyW8ckORdR
78Xlf6ZKENWB+TT9/LNKtY1mFy0A2biarQcgwslq5pCf0LX/+IJl2EL56hefABrr
PHxb6llg4n9S0Har2Cqgv3xBfI81m4gdiqsTaiwzs+BA9p9h42nSlea83aShGkKm
PFVYAZkeGsFhEuBk33mlivp7SchOd3Or/xNUtexNWREMtDb+C5mDH9qttIPwdJKU
rKmIYPC5BfQJxcFytII6iM2QNDgFZQ9LsfrItbMfW0nWPf6tx+Xu2gtPka5MXJTj
ispXg39L9De/EZP+71R+n8KqWCHp/5lMq0LQ92lmoXp1soDWZh52b2CjivoYG6PS
/PUjOX6FEfJKzWz4OGhQ
=xgst
-----END PGP SIGNATURE-----
More information about the Beginners
mailing list