a nube question

85 views
Skip to first unread message

Rob Dunne

unread,
Sep 9, 2015, 6:41:56 AM9/9/15
to haskell-exercises
Hi All,

I have a problem loading any source file into ghci. I get lots of
"Not in scope" error messages. I am just cutting and pasting these examples from various tutorials 
such as
so the syntax should be correct. 

See the example below. I must be missing something very fundamental!

Bye
Rob

localhost: ghci --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
localhost: pwd
/home/robd/course
localhost: cat t1.hs
main = print (fac 20)

fac 0 = 1
fac n = n * fac (n-1)

localhost: ghci
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[ 1 of 28] Compiling Course.Core      ( src/Course/Core.hs, interpreted )
.
[28 of 28] Compiling Course           ( src/Course.hs, interpreted )

>> :load t1
[1 of 1] Compiling Main             ( t1.hs, interpreted )
t1.hs:1:8: Not in scope: `print'
t1.hs:1:19: Not in scope: `fromInteger'
t1.hs:3:5: Not in scope: `fromInteger'
t1.hs:3:5: Not in scope: `=='
t1.hs:3:9: Not in scope: `fromInteger'
t1.hs:4:11: Not in scope: `*'
t1.hs:4:19: Not in scope: `-'
t1.hs:4:20: Not in scope: `fromInteger'
Failed, modules loaded: none.
>>

Tony Morris

unread,
Sep 9, 2015, 6:44:03 AM9/9/15
to Rob Dunne, haskell-exercises

The course material turns off implicit Prelude with a .ghci file. Try it in a directory without .ghci and make sure there is no ~/.ghci file.

--
You received this message because you are subscribed to the Google Groups "haskell-exercises" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-exerci...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Dunne

unread,
Sep 9, 2015, 6:58:47 AM9/9/15
to haskell-exercises
Thanks Tony, that fixed it!
R
Reply all
Reply to author
Forward
0 new messages