Skip to content

Instantly share code, notes, and snippets.

@mietek
Last active August 29, 2015 14:03
Show Gist options
  • Save mietek/670b51267897a7d7fc0a to your computer and use it in GitHub Desktop.
Save mietek/670b51267897a7d7fc0a to your computer and use it in GitHub Desktop.
GHCi 7.6.3 ignoring Foo.o
$ cat >Foo.hs <<EOF
module Foo where
foo :: IO ()
foo = print "Foo"
EOF
$ ghc -Wall -c -o Foo.o Foo.hs
$ cat >Foo.hs <<EOF
module Foo where
foo :: IO ()
foo = print "Not Foo"
EOF
$ ghci Foo.o
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (static) Foo.o ... done
final link ... done
> :l Foo
[1 of 1] Compiling Foo ( Foo.hs, interpreted )
Ok, modules loaded: Foo.
> foo
"Not Foo"
>
$ cat >Foo.hs <<EOF
module Foo where
foo :: IO ()
foo = print "Foo"
EOF
$ ghc -Wall -c -o Foo.o Foo.hs
$ rm Foo.hs
$ ghci Foo.o
GHCi, version 7.6.3: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading object (static) Foo.o ... done
final link ... done
> :l Foo
<command line>:
Could not find module `Foo'
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
>
Leaving GHCi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment