haddock (and -- $)

2003-12-18 Thread Johannes Waldmann
hello. a few comments and questions on haddock (www.haskell.org/haddock/)

1. haddock is great

2. haddock's interpretation of "-- $" is un-great:

I have two types of "-- $" occurences in my code
that conflict with haddock's idea of "named doc chunks"
a. CVS macros: -- $Id: ...$

b. pipes like this, with some lines commented out:

let x = this_function
  $ that_function
  -- $ but_not_this
  $ arg
3. how can I refer to external system libraries documentation
   (i. e. Data.FiniteMap from the ghc web site)?
4. haddock does not seem to understand cpp #ifdefs.
   how can I work around this? (I know I shouldn't use cpp
   in the first place, but I want to document existing code,
   and not rewrite it just to make the doc tool happy :-)
again, haddock is great.
even running it on the code as-is (without any annotations)
gives nice interface documentation, indexing and cross-refs.
--
-- Johannes Waldmann,  Tel/Fax: (0341) 3076 6479 / 6480 --
-- http://www.imn.htwk-leipzig.de/~waldmann/ -
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


RE: haddock (and -- $)

2003-12-18 Thread Simon Marlow
 
> hello. a few comments and questions on haddock 
> (www.haskell.org/haddock/)
> 
> 1. haddock is great

Thanks ;)

> 2. haddock's interpretation of "-- $" is un-great:
> 
> I have two types of "-- $" occurences in my code
> that conflict with haddock's idea of "named doc chunks"
> 
> a. CVS macros: -- $Id: ...$
> 
> b. pipes like this, with some lines commented out:
> 
> let x = this_function
>$ that_function
>-- $ but_not_this
>$ arg

I'm not sure that we can/should do anything about this.  The same
problem crops up with '-- |' too: you might comment out some guards for
example.  The solution is to add an extra space after the '--', or use
three dashes '---', etc. etc.

> 3. how can I refer to external system libraries documentation
> (i. e. Data.FiniteMap from the ghc web site)?

Download a GHC distribution, which has the .haddock files for the
libraries.  Then use the --read-interface option, something like this:

   $ haddock
--read-interface=file:///usr/share/ghc-6.2/html/libraries/base,/usr/shar
e/ghc-6.2/html/libraries/base/base.haddock

or you can point to the online docs, by replacing the first URL with
http://www.haskell.org/ghc/docs/6.2/html/libraries/base.

You can add further --read-interface options for the other packages that
come with GHC.

In the future, Haddock will make this easier by asking GHC where it
keeps its documentation.

> 4. haddock does not seem to understand cpp #ifdefs.
> how can I work around this? (I know I shouldn't use cpp
> in the first place, but I want to document existing code,
> and not rewrite it just to make the doc tool happy :-)

You can run cpp over the source file before feeding it to Haddock.  This
is what we do for GHC's libraries.  eg.

  $ ghc -E -cpp Foo.hs -o Foo.raw-hs
  $ haddock Foo.raw-hs ...

You can use some appropriate Makefile rules to automate this.

Cheers,
Simon
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


GHC: Installation problem on suse 9.0.

2003-12-18 Thread Gustavo Villavicencio
Dear all

i have running ghc on suse 7.3, but i can't install it on suse 9.0. the
next error is raising during the HC files compilation:


...
CTypes.hc:55265: warning: (near initialization for
`CTypes_tpl890_closure.payload') CTypes.hc:55297: warning: excess
elements in array initializer
CTypes.hc:55297: warning: (near initialization for
`CTypes_tpl891_closure.payload') CTypes.hc:55324: warning: excess
elements in array initializer
CTypes.hc:55324: warning: (near initialization for
`CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324: warning: excess
elements in array initializer
CTypes.hc:55324: warning: (near initialization for
`CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324: warning: excess
elements in array initializer
CTypes.hc:55324: warning: (near initialization for
`CTypes_zdfReadCChar_closure.payload') Prologue junk?: czvw_ret:
movl$0, 16(%esp)
movl$0, 20(%esp)
movl$0, 8(%esp)
movl$0, 12(%esp)

gmake[2]: *** [CTypes.o] Error 255
gmake[1]: *** [all] Error 1
gmake: *** [all] Error 1


any help will be appreciated.
gustavo



___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


RE: Installation problem on suse 9.0.

2003-12-18 Thread Gustavo Villavicencio
before nothing, THANKS Simon. I have begun the ghc installation
process from the 4.08.2 version. By other side, the suse 9.0
comes with gcc 3.3.1-24.
thanks again,
gustavo

Simon Marlow said:
> [ moved to [EMAIL PROTECTED] ]
>
>> i have running ghc on suse 7.3, but i can't install it on
>> suse 9.0. the
>> next error is raising during the HC files compilation:
>>
>> 
>> ...
>> CTypes.hc:55265: warning: (near initialization for
>> `CTypes_tpl890_closure.payload') CTypes.hc:55297: warning: excess
>> elements in array initializer
>> CTypes.hc:55297: warning: (near initialization for
>> `CTypes_tpl891_closure.payload') CTypes.hc:55324: warning: excess
>> elements in array initializer
>> CTypes.hc:55324: warning: (near initialization for
>> `CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324:
>> warning: excess
>> elements in array initializer
>> CTypes.hc:55324: warning: (near initialization for
>> `CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324:
>> warning: excess
>> elements in array initializer
>> CTypes.hc:55324: warning: (near initialization for
>> `CTypes_zdfReadCChar_closure.payload') Prologue junk?: czvw_ret:
>> movl$0, 16(%esp)
>> movl$0, 20(%esp)
>> movl$0, 8(%esp)
>> movl$0, 12(%esp)
>>
>> gmake[2]: *** [CTypes.o] Error 255
>> gmake[1]: *** [all] Error 1
>> gmake: *** [all] Error 1
>
> Which GHC version are you compiling?  Which GHC vesrion are you using
> to compile it?  It might be related to a newer version of gcc: what
> version is installed on your system?
>
> Cheers,
>   Simon



___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Fundeps discrepancy

2003-12-18 Thread Martin SULZMANN
Hi,

Yes, there is a formal description of type inference for FDs. 
You can download a paper via 
http://www.comp.nus.edu.sg/~sulzmann/chr/publications.html
(Sound and Decidable Type Inference for Functional Dependencies
by  Gregory J. Duck, Simon Peyton-Jones, Peter J. Stuckey and Martin
Sulzmann)
which provides some formal results
under which conditions imposed on FDs type inference is sound and
decidable.

In fact, your example above is harmless in the sense that type
inference remains decidable. Although, we might lose completeness of type
inference (because the super class relations of the example below
are not range-restricted).

*Real* problems arise once we start writing the following

class C a b | a->b
instance C a b => C [a] [b]

The above program violates the "termination" condition as stated in
Mark Jones, ESOP 2000 paper.
Indeed, Hugs and GHC don't strictly enforce this condition, hence, we
might lose
decidability of type inference. Please consult the above mentioned paper for an
extensive discussion.

You (and Brandon Michael Moore and many, many others in some previous
emails) were also raising issues 
why some seemingly well-typed programs making use of FDs are currently 
rejected. As you know
the well-typing and evidence-translation of programs are intimately
tied together.
The point is that current implementations are simply too
conservative. Note that in the above mentioned paper we are only
concerned with typing issues. A description of a more *relaxed*
evidence-translation scheme
will be discussed in some future work.

Martin

 > Hello again,
 > 
 > Please pardon another question on functional dependencies.  GHC and Hugs
 > behave differently on the following code:
 > 
 > class Tr tr a b | tr -> a b where f :: tr -> a -> b
 > class (Tr m a b, Tr n b c) => TrPair m n a c
 > 
 > The type variable b on the second line does not appear in the head,
 > but is determined by m and n in the head via the functional dependency
 > declared for Tr.  Hugs accepts this code, while GHC doesn't.  The
 > original fundeps paper (Mark Jones, ESOP 2000) seems silent on this
 > point.
 > 
 > Taking a step back, is there a formal description of type inference for
 > functional dependencies in Haskell type classes?  A set of typing rules,
 > or something written along the lines of John Peterson and Mark Jones's
 > "Implementing type classes" (PLDI 1993) or Mark Jones's "Typing Haskell
 > in Haskell", would be wonderful to have.
 > 
 >  Ken
 > 
 > -- 
 > Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
 > Tax the rich!
 > new journal Physical Biology: http://physbio.iop.org/
 > What if All Chemists Went on Strike? (science fiction):
 > http://www.iupac.org/publications/ci/2003/2506/iw3_letters.html
 > ___
 > Haskell mailing list
 > [EMAIL PROTECTED]
 > http://www.haskell.org/mailman/listinfo/haskell
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Installation problem on suse 9.0.

2003-12-18 Thread Donald Bruce Stewart
gustavov:
> before nothing, THANKS Simon. I have begun the ghc installation
> process from the 4.08.2 version. By other side, the suse 9.0
> comes with gcc 3.3.1-24.
> thanks again,
> gustavo
> 
> Simon Marlow said:
> > [ moved to [EMAIL PROTECTED] ]
> >
> >> i have running ghc on suse 7.3, but i can't install it on
> >> suse 9.0. the
> >> next error is raising during the HC files compilation:
> >>
> >> 
> >> ...
> >> CTypes.hc:55265: warning: (near initialization for
> >> `CTypes_tpl890_closure.payload') CTypes.hc:55297: warning: excess
> >> elements in array initializer
> >> CTypes.hc:55297: warning: (near initialization for
> >> `CTypes_tpl891_closure.payload') CTypes.hc:55324: warning: excess
> >> elements in array initializer
> >> CTypes.hc:55324: warning: (near initialization for
> >> `CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324:
> >> warning: excess
> >> elements in array initializer
> >> CTypes.hc:55324: warning: (near initialization for
> >> `CTypes_zdfReadCChar_closure.payload') CTypes.hc:55324:
> >> warning: excess
> >> elements in array initializer
> >> CTypes.hc:55324: warning: (near initialization for
> >> `CTypes_zdfReadCChar_closure.payload') Prologue junk?: czvw_ret:
> >> movl$0, 16(%esp)
> >> movl$0, 20(%esp)
> >> movl$0, 8(%esp)
> >> movl$0, 12(%esp)
> >>
> >> gmake[2]: *** [CTypes.o] Error 255
> >> gmake[1]: *** [all] Error 1
> >> gmake: *** [all] Error 1
> >
> > Which GHC version are you compiling?  Which GHC vesrion are you using
> > to compile it?  It might be related to a newer version of gcc: what
> > version is installed on your system?
> >
> > Cheers,
> > Simon
  
If possible, try to use a GHC binary distribution, as installing from
source can be quite difficult. Also, 4.08.2 is quite old now, and
probably doesn't work well with gcc 3.x.

So, if at all unsure, try using a binary distribution before compiling
up from .hc source. There are RPMs available for SuSE for at least
version 5.02.3.

-- Don
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: ANNOUNCE: GHC version 6.2

2003-12-18 Thread Donald Bruce Stewart
simonmar:
> 
>
> The (Interactive) Glasgow Haskell Compiler -- version 6.2
>
> 
> We are pleased to announce a new major release of the Glasgow Haskell
> Compiler (GHC), version 6.2.

A binary distribution for mips64-sgi-irix is available at:

ftp://ftp.cse.unsw.edu.au/pub/users/dons/ghc/6.2/ghc-6.2-mips64-sgi-irix.tar.bz2

This is an unregisterised build, with profiling libs, no docs and no GHCi.

The mips64 port requires an external libgmp. This should come installed
with the "freeware" packages for Irix.

Happy mips'ing,
Don
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell