[Haskell-beginners] Help!, was Re: Trouble with "import qualified"

Michael Orlitzky michael at orlitzky.com
Thu May 24 18:49:59 CEST 2012


On 05/24/12 12:34, Dudley Brooks wrote:
> Hi.  I've had this up for over a week, and haven't received any
> response.  Any help would be greatly appreciated.
> 
> On 5/16/12 10:04 PM, Dudley Brooks wrote:
> 
>> Almost complete beginner.
>>
>> I just downloaded Haskell 32-bit for Mac from Haskell.org and am going
>> through Learn You a Haskell. I tried to follow the instructions on
>>
>>     http://learnyouahaskell.com/modules#loading-modules
>>
>> in particular
>>
>>     import qualified Data.Map as Map
>>
>> which, following the instructions, I put in a .hs file which I attempted
>> to load into GHCi with :l. I got
>>
>>     parse error on input `import'
>>
>> I have no idea what the problem might be or what to do about it. Other
>> imports have been successful, but after getting the above message I
>> tried to "import qualified" other modules, always with the same error.
> 

Try starting from a fresh file? I just tried the simplest thing I could
think of to reproduce this, but it worked:

jumba ~ $ echo "import qualified Data.Map as Map" >> test.hs
jumba ~ $ echo "main = print \"Hello, World\"" >> test.hs
jumba ~ $ runhaskell test.hs
"Hello, World"
jumba ~ $ ghci
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :l test.hs
[1 of 1] Compiling Main             ( test.hs, interpreted )
Ok, modules loaded: Main.
*Main> main
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
"Hello, World"
*Main>



More information about the Beginners mailing list