Re: [Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-14 Thread Derek Elkins
On Tue, 2008-10-14 at 07:13 -0500, Antoine Latter wrote:
> On Tue, Oct 14, 2008 at 12:03 AM, Magicloud
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >   I wanted to install this package. Well,
> > Building hprotoc-0.3.1...
> > ...
> > [3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...
> >
> > Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
> >   Type synonym `GenParser' should have 2 arguments, but has been given 1
> >   In the type synonym declaration for `P'
> >
> >   And it just stopped here.
> 
> This is an incompatibility between parsec-2 and parsec-3.  In
> parsec-2, 'GenParser' is declared with a 'data' declaration, whereas
> in parsec-3 it's a type synonym.  Since type-synonym declared
> type-constructors cannot be partially applied this doesn't work.
> 
> Currently in parsec-3 'GenParser' is declared as:
> 
> > type GenParser tk st = Parsec [tk] st
> 
> We should be able to change it to:
> 
> > type GenParser tk = Parsec [tk]
> 
> in Text.Parsec.String, unless I'm forgetting something else tricky
> about type synonyms.
> 
> Derek, does this sound reasonable?

The problem is Parsec itself is a type synonym.
type Parsec s u = ParsecT s u Identity
so that latter definition of GenParser leads to a partial application of
Parsec.

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


Re: [Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-14 Thread Antoine Latter
On Tue, Oct 14, 2008 at 12:03 AM, Magicloud
<[EMAIL PROTECTED]> wrote:
> Hi,
>   I wanted to install this package. Well,
> Building hprotoc-0.3.1...
> ...
> [3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...
>
> Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
>   Type synonym `GenParser' should have 2 arguments, but has been given 1
>   In the type synonym declaration for `P'
>
>   And it just stopped here.

This is an incompatibility between parsec-2 and parsec-3.  In
parsec-2, 'GenParser' is declared with a 'data' declaration, whereas
in parsec-3 it's a type synonym.  Since type-synonym declared
type-constructors cannot be partially applied this doesn't work.

Currently in parsec-3 'GenParser' is declared as:

> type GenParser tk st = Parsec [tk] st

We should be able to change it to:

> type GenParser tk = Parsec [tk]

in Text.Parsec.String, unless I'm forgetting something else tricky
about type synonyms.

Derek, does this sound reasonable?

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


Re: [Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-14 Thread Chris Kuklewicz
Wow...I have a user.  I wrote hprotoc, and I am adding support for 
protobuf-2.0.2 options in the next version of protocol-buffers and hprotoc.  Let 
me see if I can help


I just tested the tarball again and it "Works for me".  I bet you are compiling 
without the necessary ghc flags.  Cabal should be including those.  I am using 
ghc-6.8.3 with Cabal-1.4.0.2 and tested with the command:


cabal-install --verbose --user hprotoc-0.3.1.tar.gz 


Of course, I already have protocol-buffer-0.3.1 and 
protocol-buffers-descriptor-0.3.1 installed.


The line 48 in my copy of Parser.hs says


type P = GenParser Lexed


Changing that to


type P a = GenParser Lexed a


still compiles and works for me.  But I would be surprised if that fixed all 
your problems.


Thanks for asking for help instead of giving up,
  Chris


Magicloud wrote:

$ cabal --version
cabal-install version 0.5.2
using version 1.4.0.2 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.3

Don Stewart wrote:

magicloud.magiclouds:
 

Hi,
   I wanted to install this package. Well,
Building hprotoc-0.3.1...
...
[3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...

Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
   Type synonym `GenParser' should have 2 arguments, but has been 
given 1

   In the type synonym declaration for `P'



Works for me with GHC 6.10,

What's your system configuration? Which GHC, which version of Cabal,
which libraries already installed?

-- Don   
  




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


Re: [Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-13 Thread Magicloud

$ cabal --version
cabal-install version 0.5.2
using version 1.4.0.2 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.8.3

Don Stewart wrote:

magicloud.magiclouds:
  

Hi,
   I wanted to install this package. Well,
Building hprotoc-0.3.1...
...
[3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...

Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
   Type synonym `GenParser' should have 2 arguments, but has been given 1
   In the type synonym declaration for `P'



Works for me with GHC 6.10,

What's your system configuration? Which GHC, which version of Cabal,
which libraries already installed?

-- Don

  


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


Re: [Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-13 Thread Don Stewart
magicloud.magiclouds:
> Hi,
>I wanted to install this package. Well,
> Building hprotoc-0.3.1...
> ...
> [3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...
> 
> Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
>Type synonym `GenParser' should have 2 arguments, but has been given 1
>In the type synonym declaration for `P'

Works for me with GHC 6.10,

What's your system configuration? Which GHC, which version of Cabal,
which libraries already installed?

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


[Haskell-cafe] There is something wrong with hprotoc-0.3.1 package.

2008-10-13 Thread Magicloud

Hi,
   I wanted to install this package. Well,
Building hprotoc-0.3.1...
...
[3 of 7] Compiling Text.ProtocolBuffers.ProtoCompile.Parser ...

Text/ProtocolBuffers/ProtoCompile/Parser.hs:48:0:
   Type synonym `GenParser' should have 2 arguments, but has been given 1
   In the type synonym declaration for `P'

   And it just stopped here.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe