Get Hlint to work on own computer

992 views
Skip to first unread message

Annika Johansson

unread,
Nov 13, 2014, 1:08:55 PM11/13/14
to chalmer...@googlegroups.com
Hi!

We get the following terminal messages when trying to run hlint on our code:

dhcp-192217:~ annikajohansson$ cabal install hlint

Resolving dependencies...

All the requested packages are already installed:

hlint-1.9.12

Use --reinstall if you want to reinstall anyway.

dhcp-192217:~ annikajohansson$ cd Dropbox/Chalmers/FunktionellProgrammering/Lab2

dhcp-192217:Lab2 annikajohansson$ ls

BlackJack.hs BlackJack1.hs Wrapper.hs

BlackJack.hs kopia Cards.hs psuedoLab2B.txt

dhcp-192217:Lab2 annikajohansson$ hlint BlackJack.hs

-bash: hlint: command not found


So basically I have hlint installed but the command cannot be found?

Does anyone else have this problem?

Any tips?


Thank you in advance!

Ellinor and Annika

Leif Schelin

unread,
Nov 13, 2014, 1:14:20 PM11/13/14
to chalmer...@googlegroups.com
So it's installed then. The reason bash cannot find it must be that it is not present in the $PATH$. You can modify the PATH system variable in ~/.bash_profile:

export PATH="$PATH:/.../directory/to/export"

In my case:

export PATH="$PATH:$HOME/Library/Haskell/bin"
where hlint is installed at $HOME/Library/Haskell/bin/hlint

Annika Johansson

unread,
Nov 14, 2014, 3:40:47 AM11/14/14
to chalmer...@googlegroups.com
Hello again! 
Thank you for you help!

Its very weird, I can't find where hlint is installed, if I search for them in my files I cannot find it and its not in my Haskell directory.
That makes it difficult to add to the path as: 
-------
export PATH="$PATH:/.../directory/to/export"

In my case:

export PATH="$PATH:$HOME/Library/Haskell/bin"
where hlint is installed at $HOME/Library/Haskell/bin/hlint
---------

Cause I don't know which directory to add...? Or am I misunderstanding something?
Sorry, having a bachelor in math this is quite new for me.

Thanks again for any help!
Annika and Ellinor

Annika Johansson

unread,
Nov 14, 2014, 3:45:54 AM11/14/14
to chalmer...@googlegroups.com
Hi!

Thank you for your answer! The problem now seems to be that I can't find were hlint is installed. Its not in the Haskell directory and a search on my computer can't find it... How do I know what directory to add to the path then?
Sorry for my confusion, having a bachelor in math this is quite new for me.

Thanks again for any help!
Annika

Den torsdagen den 13:e november 2014 kl. 19:08:55 UTC+1 skrev Annika Johansson:

Anton Lindgren

unread,
Nov 14, 2014, 4:00:28 AM11/14/14
to Annika Johansson, chalmer...@googlegroups.com
Try typing this (It seems you're running either OS X or linux)

"which hlint"
Which for me prints:
"/Users/atamon/.cabal/bin/hlint"

So in my /Users/atamon/.bash_profile I have added a line
"export PATH=$HOME/.cabal/bin:$PATH"
at the end of the file.

Save the file, and open a new terminal and things might work if you're lucky :)

--
You received this message because you are subscribed to the Google Groups "2014 Functional Programming TDA 452/ DIT142" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chalmers-fp-1...@googlegroups.com.
To post to this group, send email to chalmer...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/chalmers-fp-14/ce2c1c7f-0319-4587-abd1-9aee5a9a39bf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Simon Huber

unread,
Nov 18, 2014, 4:44:57 AM11/18/14
to Annika Johansson, chalmer...@googlegroups.com
Hi Annika and Ellinor,

On Fri, Nov 14, 2014 at 9:40 AM, Annika Johansson <annik...@gmail.com> wrote:
> Its very weird, I can't find where hlint is installed, if I search for them
> in my files I cannot find it and its not in my Haskell directory.

Just to clarify: do you run OSX or Linux? I remember vaguely that on
OSX there is a file called $HOME/.cabal/where-is-my-stuff.txt (or
something very similar) which tells you where the executables get
installed. On Linux, the directory usually is $HOME/.cabal/bin

--Simon
Reply all
Reply to author
Forward
0 new messages