Re: [Haskell-cafe] compilation succeeds -- execution fails

2008-03-29 Thread Bertram Felgenhauer
Jason Dusek wrote:
   I have a program here:
 
 https://svn.j-s-n.org/public/haskell/cedict
 
   currently at revision 302, which compiles okay but I can't get
   it to work. I'm using the FFI to take a (currently small)
   array and translate it into a Map.
 
   It compiles fine and loads fine -- but it doesn't run fine:
 
 GHCi, version 6.8.2: http://www.haskell.org/ghc/  :? for help
 Loading package base ... linking ... done.
 Prelude import Data.Char.CEDICT
 Prelude Data.Char.CEDICT traditional 'a'
 Loading package array-0.1.0.0 ... linking ... done.
 Loading package containers-0.1.0.1 ... linking ... done.
 Loading package parsec-2.1.0.0 ... linking ... done.
 Loading package utf8-string-0.2 ... linking ... done.
 Loading package cedict-0.1.1 ... linking ... interactive:
 unknown symbol `___stginit_cedictzm0zi1zi1_DataziCharziCEDICTziMatter_'

This is a cabal pitfall.

Note that this is a symbol from Data.Char.CEDICT.Matter.
(The 'zi' represents a dot)

The problem is that this module wasn't packaged up in the library;
you have to list it in the  extra-modules  field in the cabal file,
along with the other used Data.Char.CEDICT.* modules.

See also
http://hackage.haskell.org/trac/hackage/ticket/128

HTH,

Bertram
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Haddock Help Required

2008-03-29 Thread Dominic Steinitz
David Waern david.waern at gmail.com writes:

 
 2008/3/24, Dominic Steinitz dominic.steinitz at blueyonder.co.uk:
  What should I be using for the file name for the read-interface option
   in haddock?
 
 You must use a file that is on your own hard drive and that is
 generated with version 2.0 of Haddock, since that is what you're
 using. The interface file format was changed in Haddock 2.0 due its
 use of GHC data types, so you can't use 0.x interface files.
 
 You need to generate base.haddock with Haddock 2.0. One way to do
 that, is to make sure Haddock 2.0 is installed, then get the GHC 6.8.2
 sources (with core libs) and build that with Haddock docs enabled.
 
 Hope this helps,
 David
 

Thanks I've done this

[EMAIL PROTECTED]:~/asn15/asn1 haddock -v -html -o hdoc Pretty.hs -B
/usr/lib/ghc-6.8.2 --optghc=-fglasgow-exts
--read-interface=http://www.haskell.org/ghc/docs/6.8.2/html/libraries/base,/home/dom/ghc-6.8.2/libraries/base/dist/doc/html/base/base.haddock


but now when I click on e.g. Integer I get directed to

http://www.haskell.org/ghc/docs/6.8.2/html/libraries/base/GHC-Num.html#t%3AInteger

which doesn't exist.

Integer actually exists in

http://www.haskell.org/ghc/docs/6.8.2/html/libraries/base/Prelude.html#t%3AInteger

What do I need to do to get haddock to point at the right links?

Dominic.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] Parsec Expected Type

2008-03-29 Thread Paul Keir
Many thanks guys, you've really taught me how to catch a fish here!
Paul


-Original Message-
From: Brandon S. Allbery KF8NH [mailto:[EMAIL PROTECTED]
Sent: Sat 3/29/2008 1:41 AM
To: haskell-cafe@haskell.org Cafe
Cc: Paul Keir
Subject: Re: [Haskell-cafe] Parsec Expected Type
 

On Mar 28, 2008, at 21:12 , Ryan Ingram wrote:
 On 3/28/08, Paul Keir [EMAIL PROTECTED] wrote:
 What I'd like is to parse either the string parameter, or the  
 string :.
 I'm using 'reserved' and 'symbol' because they seem to correspond  
 well to
 the concepts in the language I'm parsing. I could try,

 tester3 = reserved parameter | do { symbol :; return () }

 Or you could factor this behavior out into a new combinator:

 or_ :: Parser a - Parser b - Parser ()
 or_ x y = (x  return ()) | (y  return ())

 tester3 = reserved parameter `or_` symbol :

Or if you'd like to be inscrutable:

import Data.Function

or_ = ( return ()) `on` (|)

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] compilation succeeds -- execution fails

2008-03-29 Thread Stefan O'Rear
On Fri, Mar 28, 2008 at 11:33:52AM -0700, Jason Dusek wrote:
 Thomas Schilling [EMAIL PROTECTED] wrote:
  Did you try removing all .hi and .o files?
 
   Yes. I tried it again this morning, and I've got the same
   error -- same unknown symbol, c.
 
   I don't have trouble with most Haskell programs on my Mac, so
   I assume it's the way I'm connecting to C that is the problem.
   I've pasted in the relevant code below my signature -- it
   seems plain enough to me, but I've not done much with foreign
   declarations.
 
   The `Ptr Char` declarations, for example, point to things
   which are actually C ints -- they are all valid Unicode code
   points, so I figure there's no harm done.

The only type that you are allowed to assume corresponds to a C int is
CInt, in the Foreign.C.Types module.  This probably isn't the problem,
but it could make problems of its own on a 64-bit or otherwise weird
system.

Stefan


signature.asc
Description: Digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe