[ ghc-Bugs-1183840 ] (OS X) Can't link MonadCont, but ghci works

SourceForge.net noreply at sourceforge.net
Fri Apr 15 11:59:12 EDT 2005


Bugs item #1183840, was opened at 2005-04-15 11:37
Message generated for change (Comment added) made by laboratoryman
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1183840&group_id=8032

Category: Compiler
Group: 6.4
Status: Open
Resolution: None
Priority: 5
Submitted By: No one of consequence (laboratoryman)
Assigned to: Nobody/Anonymous (nobody)
Summary: (OS X) Can't link MonadCont, but ghci works

Initial Comment:
The following test case prints [0,1,2] with ghci-6.4 on
OS X, but ghc can't link it.  The error is

$ ghc-6.4 -o y yield-cont-fails.hs

ld: Undefined symbols:
_ControlziMonadziCont_zdfMonadCont_closure
___stginit_ControlziMonadziCont_


The test case:

import Control.Monad.Cont

yield :: a -> Cont [a] ()
yield x = Cont (\c -> x : c ())

asGenerator :: Cont [a] v -> [a]
asGenerator (Cont f) = f (const [])

test = asGenerator (yield 0 >> yield 1 >> yield 2)

main = do print test

I have also attached it as a file to this bug.  I do
not have other versions of ghc installed.  I installed
GHC from

http://www.haskell.org/ghc/dist/6.4/MacOSX/GHC-6.4.pkg.zip


----------------------------------------------------------------------

>Comment By: No one of consequence (laboratoryman)
Date: 2005-04-15 11:59

Message:
Logged In: YES 
user_id=202433

Nevermind, "ghc --make" works.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2005-04-15 11:54

Message:
Logged In: NO 

The module Control.Monad.Cont is located in the mtl package.
GHCi load the package automatically when needed but you have
to name it explicitly when linking with GHC, or use the
'--make' option.

~Lemmih

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1183840&group_id=8032



More information about the Glasgow-haskell-bugs mailing list