import literal haskell file

Hey, When I do import ModuleName and have a file ModuleName.lhs (in literal haskell), ghc complains that it cannot find the module. Is it somehow possible to import the lhs file without rewriting it? Thanks! Nathan

On Tue, Sep 17, 2013 at 6:18 PM, Nathan Hüsken
import ModuleName
and have a file ModuleName.lhs (in literal haskell), ghc complains that it cannot find the module.
(1) It's Literate Haskell, cf. Knuth's literate programming. (2) It is not imported as source; it is looking for a compiled module (specifically the .hi file). -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On 09/18/2013 12:34 AM, Brandon Allbery wrote:
On Tue, Sep 17, 2013 at 6:18 PM, Nathan Hüsken
mailto:nathan.huesken@posteo.de> wrote: import ModuleName
and have a file ModuleName.lhs (in literal haskell), ghc complains that it cannot find the module.
(1) It's Literate Haskell, cf. Knuth's literate programming. (2) It is not imported as source; it is looking for a compiled module (specifically the .hi file).
Mmh, ok. The file is part of a cabal project. So I have: Main.hs, Module.lhs, and main cannot find the module Module. How do I instruct cabal to produce the needed hi file?
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com mailto:allbery.b@gmail.com ballbery@sinenomine.net mailto:ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

I think that you're responding to the wrong person.
dan
On Sep 18, 2013, at 12:28 AM, Nathan Hüsken
On 09/18/2013 12:34 AM, Brandon Allbery wrote:
On Tue, Sep 17, 2013 at 6:18 PM, Nathan Hüsken
mailto:nathan.huesken@posteo.de> wrote: import ModuleName
and have a file ModuleName.lhs (in literal haskell), ghc complains that it cannot find the module.
(1) It's Literate Haskell, cf. Knuth's literate programming. (2) It is not imported as source; it is looking for a compiled module (specifically the .hi file).
Mmh, ok. The file is part of a cabal project. So I have: Main.hs, Module.lhs, and main cannot find the module Module. How do I instruct cabal to produce the needed hi file?
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com mailto:allbery.b@gmail.com ballbery@sinenomine.net mailto:ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Nathan Hüsken wrote:
Mmh, ok. The file is part of a cabal project. So I have: Main.hs, Module.lhs, and main cannot find the module Module. How do I instruct cabal to produce the needed hi file?
The cabal file will have something like: executable your-program main-is: Main.hs hs-source-dirs: src default-language: Haskell98 and some below that you need to add to that: other-modules: ModuleName If that't not exactly right the cabal documentation [0] should be able to help you. Erik [0] http://www.haskell.org/cabal/users-guide/ -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
participants (4)
-
Brandon Allbery
-
Dan Lior
-
Erik de Castro Lopo
-
Nathan Hüsken