I have Haskell Platform 8.2.2 installed on Windows. When I run ghci and type alex H.x after Prelude>, I get
<interactive>:3:6: error:
Not in scope: `H.x'
No module named `H' is imported.
When I type just alex, I get
<interactive>:6:1: error:
* Variable not in scope: alex
* Perhaps you meant `lex' (imported from Prelude).
I looked in Haskell Platform\8.2.2\lib and I can see a folder called Cabal-2.0.1.0 but nothing for alex.
How do I get Alex installed?
alexis an executable program, to be run from command line, not a library to be invoked from GHCi.To run
alexviastack(which is what you have installed), type:(assuming you actually have a file named
H.xlying around)The first time you run it like this,
stackwill buildalex, which will take a few minutes. This will happen one time only, subsequent runs will be quick.If you want to run
alexwithoutstack, you can askstackto putalexon yourPATH. To do that, type:After that, you can execute
alexwithout prependingstack execevery time: