[Haskell-cafe] broken on install encoding 0.6.6

2011-08-17 Thread Gang Yu
hi, cafe:

I go through to the encoding package installation problem again.

 cabal install encoding
Resolving dependencies...
/tmp/encoding-0.6.68093/encoding-0.6.6/dist/setup/setup: 4: Syntax error:
";" unexpected

when I have a check on the this issue, I get:

file ~/.cabal/packages/
hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup
/home/gang/.cabal/packages/
hackage.haskell.org/encoding/0.6.6/encoding-0.6.6/dist/setup/setup: ELF
64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses
shared libs), for GNU/Linux 2.6.27, not stripped

My machine is:

gang@gang-laptop:~$ uname -a
Linux gang-laptop 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC
2011 i686 i686 i386 GNU/Linux

is this related? How can I manually install the package from scratch? Any
helps or directs will be appreciated

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


Re: [Haskell-cafe] broken on build encoding

2011-04-05 Thread Gang Yu
On Tue, Apr 5, 2011 at 5:10 PM, Daniel Fischer <
daniel.is.fisc...@googlemail.com> wrote:

>
> Short of changing the code, try installing encoding-0.6.3; that built with
> ghc-6.12 on hackage, so it should work for you.
>
>
Thanks, Daniel, it does work. I summarize as bundle of

ghc-6.12
mtl-1.1(no mtl-2)
encoding-0.6.3

works

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


Re: [Haskell-cafe] broken on build encoding

2011-04-04 Thread Gang Yu
Hi Daniel,

> To circumvent the build failure, have an mtl-1.*, but no mtl-2.* available,
> then it should build (or you could edit the source to replace all
> occurrences of the data constructor State with the function state to make
> it build with mtl-2.*).
>
>   It does not work, I cleaned up my ghc and unregistered the mtl-2.0.1.0,
then reinstall encoding, it gets the following failure:

[ 6 of 65] Compiling Data.Encoding.ByteSource ( Data/Encoding/ByteSource.hs,
dist/build/Data/Encoding/ByteSource.o )

Data/Encoding/ByteSource.hs:131:9:
No instance for (Monad (Either DecodingException))
  arising from the superclasses of an instance declaration
   at Data/Encoding/ByteSource.hs:131:9-61
Possible fix:
  add an instance declaration for (Monad (Either DecodingException))
In the instance declaration for `ByteSource
   (StateT [Char] (Either
DecodingException))'

Data/Encoding/ByteSource.hs:141:13:
No instance for (Monad (Either DecodingException))
  arising from a use of `get'
   at Data/Encoding/ByteSource.hs:141:13-15
Possible fix:
  add an instance declaration for (Monad (Either DecodingException))
In a stmt of a 'do' expression: chs <- get
In the expression:
do { chs <- get;
 res <- act;
 put chs;
 return res }
In the definition of `fetchAhead':
fetchAhead act
 = do { chs <- get;
res <- act;
put chs;
 }

Data/Encoding/ByteSource.hs:160:9:
No instance for (Monad (Either DecodingException))
  arising from the superclasses of an instance declaration
   at Data/Encoding/ByteSource.hs:160:9-68
Possible fix:
  add an instance declaration for (Monad (Either DecodingException))
In the instance declaration for `ByteSource
   (StateT BS.ByteString (Either
DecodingException))'

Data/Encoding/ByteSource.hs:171:9:
No instance for (Monad (Either DecodingException))
  arising from the superclasses of an instance declaration
   at Data/Encoding/ByteSource.hs:171:9-69
Possible fix:
  add an instance declaration for (Monad (Either DecodingException))
In the instance declaration for `ByteSource
   (StateT LBS.ByteString (Either
DecodingException))'
cabal: Error: some packages failed to install:
encoding-0.6.4 failed during the building phase. The exception was:
ExitFailure 1
gang@gang-laptop:~$ ghc-pkg list
/var/lib/ghc-6.12.1/package.conf.d
   Cabal-1.8.0.2
   array-0.3.0.0
   base-3.0.3.2
   base-4.2.0.0
   bin-package-db-0.0.0.0
   bytestring-0.9.1.5
   containers-0.3.0.0
   directory-1.0.1.0
   dph-base-0.4.0
   dph-par-0.4.0
   dph-prim-interface-0.4.0
   dph-prim-par-0.4.0
   dph-prim-seq-0.4.0
   dph-seq-0.4.0
   extensible-exceptions-0.1.1.1
   filepath-1.1.0.3
   ghc-6.12.1
   ghc-binary-0.5.0.2
   ghc-prim-0.2.0.0
   haskell98-1.0.1.1
   hpc-0.5.0.4
   integer-gmp-0.2.0.0
   old-locale-1.0.0.2
   old-time-1.0.0.3
   pretty-1.0.1.1
   process-1.0.1.2
   random-1.0.0.2
   rts-1.0
   syb-0.1.0.2
   template-haskell-2.4.0.0
   time-1.1.4
   unix-2.4.0.0
   utf8-string-0.3.4
/home/gang/.ghc/i386-linux-6.12.1/package.conf.d
   HaXml-1.20.2
   binary-0.5.0.2
   directory-1.1.0.0
   mtl-1.1.0.2
   polyparse-1.5
   regex-base-0.93.2
   regex-compat-0.93.1
   regex-posix-0.94.4
   transformers-0.2.2.0

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


[Haskell-cafe] broken on build encoding

2011-04-04 Thread Gang Yu
Hi, cafe,

   I always get the following build failure when I try to install encoding:

 Configuring encoding-0.6.4...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package haskell98-1.0.1.1 requires random-1.0.0.2
package HaXml-1.20.2 requires random-1.0.0.2
package random-1.0.0.2 requires time-1.1.4
package random-1.0.0.2 requires time-1.2.0.4
Preprocessing library encoding-0.6.4...
Building encoding-0.6.4...

Data/Encoding/ByteSource.hs:124:0:
 warning: extra tokens at end of #ifndef directive

Data/Encoding/ByteSink.hs:104:0:
 warning: extra tokens at end of #ifndef directive
[ 1 of 65] Compiling Data.Static  ( Data/Static.hs,
dist/build/Data/Static.o )
[ 2 of 65] Compiling Data.Array.Static ( Data/Array/Static.hs,
dist/build/Data/Array/Static.o )

Data/Array/Static.hs:14:35:
Warning: Bindings containing unlifted types must use an outermost bang
pattern:
 { (I# ri) = index (s, e) i }
 *** This will be an error in GHC 6.14! Fix your code now!
In the expression: let (I# ri) = index (s, e) i in extract addr ri
In the definition of `!':
! (StaticArray s e addr) i
= let (I# ri) = index ... i in extract addr ri
[ 3 of 65] Compiling Data.Map.Static  ( Data/Map/Static.hs,
dist/build/Data/Map/Static.o )
[ 4 of 65] Compiling Control.Throws   ( Control/Throws.hs,
dist/build/Control/Throws.o )
[ 5 of 65] Compiling Data.Encoding.Exception ( Data/Encoding/Exception.hs,
dist/build/Data/Encoding/Exception.o )
[ 6 of 65] Compiling Data.Encoding.ByteSource ( Data/Encoding/ByteSource.hs,
dist/build/Data/Encoding/ByteSource.o )

Data/Encoding/ByteSource.hs:151:17:
Not in scope: data constructor `State'
cabal: Error: some packages failed to install:
encoding-0.6.4 failed during the building phase. The exception was:
ExitFailure 1https://mail.google.com/mail/?shva=1#compose

I manually installed a ghc-6.12.3, a ubuntu ghc-6.12.1, all the same?

anybody can provide helps? thanks

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


[Haskell-cafe] help for the usage on mfix

2011-02-22 Thread Gang Yu
hello cafe,

  I just want to do cursion to a fixpoint in an IO function, I write sth.
like this,

handle_ar::(Set String,Set String)->FilePath-> IO (Set String, Set String)
handle_ar (def,undef) ar=do
  let gs = def
  gu = undef
  syms <- liftM (map (\x -> (symb x, x))) $ defined_syms ar
  usyms <- liftM (map (\x -> (symb x, x))) $ undefined_syms ar
  mfix (\(gs,gu) -> do
   case find_obj gu usyms of Nothing -> return (gs,gu)
 Just z ->
   do
 let
   fout = fromList . map fst .
filter ((== (objf z)) . objf . snd)
   ls = fout syms
   lu = fout usyms
 handle_obj_ar (gs,gu) (ls,lu))
What I want to express is:

gs and gu are initiliazed to def and undef, then do recursion until
"find_obj gu usyms" is nothing, i.e, (gs,gu) reaches a fixpoint (suppose
handle_obj_ar always change the pair).

I am not sure I am on the right track since there is no room for def and
undef stand in the function.

Anyone can help?

thanks a lot.

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


[Haskell-cafe] building hslogger error windows

2011-01-23 Thread Gang Yu
Hi cafe,

   I just get a build error on install config-file (which depends on
hslogger),

C:\Documents and Settings\lenovo>cabal install hslogger
Resolving dependencies...
Downloading hslogger-1.1.1...
Configuring hslogger-1.1.1...
Preprocessing library hslogger-1.1.1...
Preprocessing executables for hslogger-1.1.1...
Building hslogger-1.1.1...

src\System\Log\Handler\Rotating.hs:48:7:
Could not find module `System.FilePath.Windows':
  It is a member of the hidden package `filepath-1.1.0.4'.
  Perhaps you need to add `filepath' to the build-depends in your .cabal
fil
e.
  Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
hslogger-1.1.1 failed during the building phase. The exception was:
ExitFailure 1

I am using platform-2.0, How can I solve it?

Thanks in advance

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