Re: [Haskell-cafe] ByteString install issues with GHC 7.0.3 on Windows 7

2011-10-01 Thread Ralph Hodgson
Resolved my problems by going after later versions of ByteString:

 

>cabal install bytestring-0.9.2.0

Resolving dependencies...

cabal: bytestring.cabal:70: The 'type' field is required for test suites.
The

available test types are: exitcode-stdio-1.0

cabal: Error: some packages failed to install:

bytestring-0.9.2.0 failed during the configure step. The exception was:

ExitFailure 1

 

That did not work, but the following:

 

>cabal install bytestring-0.9.1.10

Resolving dependencies...

No packages to be installed. All the requested packages are already
installed.

If you want to reinstall anyway then use the --reinstall flag.

 

tells me that I already had a working version. I was chasing the wrong
problem. 

 

Looking at my BlazeHtml code again, there were imports declared as follows:

 

> import Prelude hiding (head, id, div)

> import Text.Blaze.Html4.Strict as H hiding (map)

> import Text.Blaze.Html4.Strict.Attributes as A

> import Control.Monad

> import Data.Monoid (Monoid, mappend, mempty, mconcat)

> import Text.Blaze.Renderer.Utf8 (renderHtml)

>  import Data.ByteString.UTF8 as B

 

The last import was the problem. Something changed in the libraries to make
this 'UTF8' line break. I worked around this for now.

 

Need to research some more, quick glance at the bytestring library versions
suggest 'Char8' not 'UTF8' .  However Data.ByteString.UTF8 is in the
utf8-string-0.3 library
(http://hackage.haskell.org/packages/archive/utf8-string/0.3/doc/html/Data-B
yteString-UTF8.html).

 

So my question becomes "Can someone tell me if there are notes somewhere on
the state of play of the UTF8 ByteString Libraries"

 

Ralph Hodgson,  <http://twitter.com/ralphtq> @ralphtq

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Saturday, October 01, 2011 8:31 PM
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] ByteString install issues with GHC 7.0.3 on Windows
7

 

This morning I was successfully running BlazeHtml on Windows 7. Then I
installed some libraries from other packages and BlazeHtml broke.

 

I then decided to go from ghc 6.12.1 to ghc 7.0.3 and reinstall everything.

 

BlazeHtml installed OK. But my program also needed ByteString. So I did the
following:

 

First I tried the stable version:

 

>cabal install bytestring-0.9.1.4

Resolving dependencies...

Configuring bytestring-0.9.1.4...

Preprocessing library bytestring-0.9.1.4...

Building bytestring-0.9.1.4...

 

Data\ByteString.hs:3:24:

Cannot parse LANGUAGE pragma

Expecting comma-separated list of language options,

each starting with a capital letter

  E.g. {-# LANGUAGE RecordPuns, Generics #-}

cabal: Error: some packages failed to install:

bytestring-0.9.1.4 failed during the building phase. The exception was:

ExitFailure 1

 

I am not experienced enough to fix this, so I tried a previous ByteString
version:

 

>cabal install bytestring-0.9.1.3

Resolving dependencies...

Configuring bytestring-0.9.1.3...

Preprocessing library bytestring-0.9.1.3...

Building bytestring-0.9.1.3...

[1 of 8] Compiling Data.ByteString.Fusion ( Data\ByteString\Fusion.hs,
dist\buil

d\Data\ByteString\Fusion.o )

[2 of 8] Compiling Data.ByteString.Internal ( Data\ByteString\Internal.hs,
dist\

build\Data\ByteString\Internal.o )

 

Data\ByteString\Internal.hs:79:42:

Module `GHC.IOBase' does not export `RawBuffer'

cabal: Error: some packages failed to install:

bytestring-0.9.1.3 failed during the building phase. The exception was:

ExitFailure 1

 

No joy.

 

Help appreciated.

 

May try all this on my MAC tomorrow.

 

Ralph Hodgson,  <http://twitter.com/ralphtq> @ralphtq

Mobile Phone: +1 781-789-1664

 

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


[Haskell-cafe] ByteString install issues with GHC 7.0.3 on Windows 7

2011-10-01 Thread Ralph Hodgson
This morning I was successfully running BlazeHtml on Windows 7. Then I
installed some libraries from other packages and BlazeHtml broke.

 

I then decided to go from ghc 6.12.1 to ghc 7.0.3 and reinstall everything.

 

BlazeHtml installed OK. But my program also needed ByteString. So I did the
following:

 

First I tried the stable version:

 

>cabal install bytestring-0.9.1.4

Resolving dependencies...

Configuring bytestring-0.9.1.4...

Preprocessing library bytestring-0.9.1.4...

Building bytestring-0.9.1.4...

 

Data\ByteString.hs:3:24:

Cannot parse LANGUAGE pragma

Expecting comma-separated list of language options,

each starting with a capital letter

  E.g. {-# LANGUAGE RecordPuns, Generics #-}

cabal: Error: some packages failed to install:

bytestring-0.9.1.4 failed during the building phase. The exception was:

ExitFailure 1

 

I am not experienced enough to fix this, so I tried a previous ByteString
version:

 

>cabal install bytestring-0.9.1.3

Resolving dependencies...

Configuring bytestring-0.9.1.3...

Preprocessing library bytestring-0.9.1.3...

Building bytestring-0.9.1.3...

[1 of 8] Compiling Data.ByteString.Fusion ( Data\ByteString\Fusion.hs,
dist\buil

d\Data\ByteString\Fusion.o )

[2 of 8] Compiling Data.ByteString.Internal ( Data\ByteString\Internal.hs,
dist\

build\Data\ByteString\Internal.o )

 

Data\ByteString\Internal.hs:79:42:

Module `GHC.IOBase' does not export `RawBuffer'

cabal: Error: some packages failed to install:

bytestring-0.9.1.3 failed during the building phase. The exception was:

ExitFailure 1

 

No joy.

 

Help appreciated.

 

May try all this on my MAC tomorrow.

 

Ralph Hodgson,  <http://twitter.com/ralphtq> @ralphtq

Mobile Phone: +1 781-789-1664

 

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


Re: [Haskell-cafe] Server hosting

2011-05-07 Thread Ralph Hodgson
I am considering hetzner online in Germany - 
http://www.hetzner.de/en/hosting/produkte_rootserver/eq4

Ralph Hodgson
@ralphtq

On May 7, 2011, at 6:27 AM, Charles-Pierre Astolfi  wrote:

> I'm using tilaa.nl. It starts at ~10€/month and they are quite
> friendly and competent.
> --
> Cp
> 
> 
> 
> On Sat, May 7, 2011 at 13:53, Nicolas Wu  wrote:
>> On 7 May 2011 13:52, Nicolas Wu  wrote:
>>>> Then again,
>>>> I haven't found many companies that list prices in GBP.)
>>> 
>>> I use rackhost.co.uk
>> 
>> Oops, I mean rackspace.co.uk, who I believe are the people behind
>> slicehost.com which comes highly recommended.
>> 
>> Nick
>> 
>> ___
>> Haskell-Cafe mailing list
>> Haskell-Cafe@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>> 
> 
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

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


RE: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec and others

2010-06-02 Thread Ralph Hodgson
This appeared to be the case - re-installing the Haskell Platform as opposed to 
the latest GHC got things working again.

-Original Message-
From: daniel.is.fisc...@web.de [mailto:daniel.is.fisc...@web.de] 
Sent: Tuesday, June 01, 2010 2:03 PM
To: haskell-cafe@haskell.org; rhodg...@topquadrant.com
Subject: Re: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec 
and others

On Tuesday 01 June 2010 22:31:21, Ralph Hodgson wrote:
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to override)
>

You probably have a package.conf from the previous GHC still lying around.
If your new GHC is in the system space, it'll probably be enough to remove 
all package.conf files from the user space, if your new GHC lives in user 
space, remove all package.conf files from the user space *except the one 
ghc-6.12.2 created* (that's the one containing the package ghc-6.12.2).

>
>
> Having installed GHC 6.12.2, I am hitting these problems with every
> package I tried to install:
>
>
>
> C:\Users\Ralph>cabal install parsec
>
> Resolving dependencies...
>
> Configuring parsec-2.1.0.1...
>
> Preprocessing library parsec-2.1.0.1...
>
> Building parsec-2.1.0.1...
>
> [ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos (
> Text\ParserCombinators\
>
> Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )
>
>
>
> [snip]
>
>
>
> [ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm (
> Text\ParserCombinators
>
> \Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )
>
>
>
> Text\ParserCombinators\Parsec\Perm.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> [10 of 10] Compiling Text.ParserCombinators.Parsec.Language (
> Text\ParserCombina
>
> tors\Parsec\Language.hs,
> dist\build\Text\ParserCombinators\Parsec\Language.o )
>
>
>
> Text\ParserCombinators\Parsec\Language.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> Registering parsec-2.1.0.1...
>
> Installing library in
>
> C:\Users\Ralph\AppData\Roaming\cabal\parsec-2.1.0.1\ghc-6.12.2
>
> Registering parsec-2.1.0.1...
>
> cabal: parsec-2.1.0.1: dependency
>
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to
>
> override)
>
> cabal: Error: some packages failed to install:
>
> parsec-2.1.0.1 failed during the final install step. The exception was:
>
> exit: ExitFailure 1
>
>
>
> I wonder what to do next?

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


RE: [Haskell-cafe] Installing Curl on Windows 7 - permissions problem

2010-06-02 Thread Ralph Hodgson
Yes - I understand more now - thanks.

-Original Message-
From: daniel.is.fisc...@web.de [mailto:daniel.is.fisc...@web.de] 
Sent: Tuesday, June 01, 2010 10:49 AM
To: haskell-cafe@haskell.org; rhodg...@topquadrant.com
Cc: 'Don Stewart'; 'Henning Thielemann'
Subject: Re: [Haskell-cafe] Installing Curl on Windows 7 - permissions problem

On Monday 31 May 2010 23:50:58, Ralph Hodgson wrote:
> Don,
>
>
>
> More angst with Windows 7 permissions.  I hope this is a simple thing
> for you or someone else to help me with.
>
>
>
> I have successfully installed other packages into my private cabal area.
>
>
>
> When it came to the Haskell curl package, I got permission errors.
>
>
>
> Just to prove that things go to the right places, here is a successful
> run with the Parseargs Package.
>
>
>
> C:\Users\Ralph>cabal install parseargs
>

>
> Now for curl.
>
> This is what happened when I went to my windows shell:
>
> C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup build
>
> Preprocessing library curl-1.3.5...
>
> Building curl-1.3.5...
>
> Registering curl-1.3.5...
>
>
>
> C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup install
>
> setup: permission denied
>
>
>
> I am wondering if the curl package is trying to put things in system
> folders?

It's not the library, it's

runhaskell ./Setup.hs ...

versus

cabal install

The previous defaults to global installs, the latter to user installs.

So you can either

- run cabal install in the package directory (if you don't give a package 
name to install, it installs [tries to install] the package from the 
current directory)

- pass the --user flag to runhaskell ./Setup.hs,

runhaskell ./Setup.hs configure --user --prefix=C:\Users\Ralph\...

Getting into the habit of always using cabal install prevents such 
predicaments.

>
> Help much appreciated - tight deadlines
>
> Ralph

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


RE: [Haskell-cafe] Installing Curl on Windows 7 - permissions problem

2010-06-02 Thread Ralph Hodgson
Thanks - Yes that is what I did. I have curl working fine on the MAC - I
will have to devote more time to Windows 7.

The MAC work has revealed a strange problem in download-curl. I'll have more
to say about that later.

-Original Message-
From: Stephen Tetley [mailto:stephen.tet...@gmail.com] 
Sent: Tuesday, June 01, 2010 10:25 AM
To: rhodg...@topquadrant.com
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Installing Curl on Windows 7 - permissions
problem

On 31 May 2010 22:50, Ralph Hodgson  wrote:

>
> This is what happened when I went to my windows shell:
>
>
>
> C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup build
>
> Preprocessing library curl-1.3.5...
>
> Building curl-1.3.5...
>
> Registering curl-1.3.5...
>
>
>
> C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup install
>
> setup: permission denied
>
>


Don't you want to be installing the curl binding through MinGW's shell
rather than going back to the Windows shell?

Best wishes

Stephen

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


RE: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec and others

2010-06-02 Thread Ralph Hodgson
I decided to remove everything and start again with the Haskell Platform. I am 
back up and running enough to make progress.

-Original Message-
From: haskell-cafe-boun...@haskell.org 
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Tuesday, June 01, 2010 4:34 PM
To: daniel.is.fisc...@web.de; haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec 
and others

Thanks Daniel, I will give it a try

I just did some work on the MAC to verify that everything worked there. And all 
is well with MAC GHC 6.12.1

-Original Message-
From: daniel.is.fisc...@web.de [mailto:daniel.is.fisc...@web.de] 
Sent: Tuesday, June 01, 2010 2:03 PM
To: haskell-cafe@haskell.org; rhodg...@topquadrant.com
Subject: Re: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec 
and others

On Tuesday 01 June 2010 22:31:21, Ralph Hodgson wrote:
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to override)
>

You probably have a package.conf from the previous GHC still lying around.
If your new GHC is in the system space, it'll probably be enough to remove 
all package.conf files from the user space, if your new GHC lives in user 
space, remove all package.conf files from the user space *except the one 
ghc-6.12.2 created* (that's the one containing the package ghc-6.12.2).

>
>
> Having installed GHC 6.12.2, I am hitting these problems with every
> package I tried to install:
>
>
>
> C:\Users\Ralph>cabal install parsec
>
> Resolving dependencies...
>
> Configuring parsec-2.1.0.1...
>
> Preprocessing library parsec-2.1.0.1...
>
> Building parsec-2.1.0.1...
>
> [ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos (
> Text\ParserCombinators\
>
> Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )
>
>
>
> [snip]
>
>
>
> [ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm (
> Text\ParserCombinators
>
> \Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )
>
>
>
> Text\ParserCombinators\Parsec\Perm.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> [10 of 10] Compiling Text.ParserCombinators.Parsec.Language (
> Text\ParserCombina
>
> tors\Parsec\Language.hs,
> dist\build\Text\ParserCombinators\Parsec\Language.o )
>
>
>
> Text\ParserCombinators\Parsec\Language.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> Registering parsec-2.1.0.1...
>
> Installing library in
>
> C:\Users\Ralph\AppData\Roaming\cabal\parsec-2.1.0.1\ghc-6.12.2
>
> Registering parsec-2.1.0.1...
>
> cabal: parsec-2.1.0.1: dependency
>
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to
>
> override)
>
> cabal: Error: some packages failed to install:
>
> parsec-2.1.0.1 failed during the final install step. The exception was:
>
> exit: ExitFailure 1
>
>
>
> I wonder what to do next?

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

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


RE: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec and others

2010-06-01 Thread Ralph Hodgson
Thanks Daniel, I will give it a try

I just did some work on the MAC to verify that everything worked there. And all 
is well with MAC GHC 6.12.1

-Original Message-
From: daniel.is.fisc...@web.de [mailto:daniel.is.fisc...@web.de] 
Sent: Tuesday, June 01, 2010 2:03 PM
To: haskell-cafe@haskell.org; rhodg...@topquadrant.com
Subject: Re: [Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec 
and others

On Tuesday 01 June 2010 22:31:21, Ralph Hodgson wrote:
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to override)
>

You probably have a package.conf from the previous GHC still lying around.
If your new GHC is in the system space, it'll probably be enough to remove 
all package.conf files from the user space, if your new GHC lives in user 
space, remove all package.conf files from the user space *except the one 
ghc-6.12.2 created* (that's the one containing the package ghc-6.12.2).

>
>
> Having installed GHC 6.12.2, I am hitting these problems with every
> package I tried to install:
>
>
>
> C:\Users\Ralph>cabal install parsec
>
> Resolving dependencies...
>
> Configuring parsec-2.1.0.1...
>
> Preprocessing library parsec-2.1.0.1...
>
> Building parsec-2.1.0.1...
>
> [ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos (
> Text\ParserCombinators\
>
> Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )
>
>
>
> [snip]
>
>
>
> [ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm (
> Text\ParserCombinators
>
> \Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )
>
>
>
> Text\ParserCombinators\Parsec\Perm.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> [10 of 10] Compiling Text.ParserCombinators.Parsec.Language (
> Text\ParserCombina
>
> tors\Parsec\Language.hs,
> dist\build\Text\ParserCombinators\Parsec\Language.o )
>
>
>
> Text\ParserCombinators\Parsec\Language.hs:1:0:
>
> Warning: Module `Prelude' is deprecated:
>
>You are using the old package `base' version 3.x.
>
>Future GHC versions will not support base version 3.x.
> You
>
>should update your code to use the new base version 4.x.
>
> Registering parsec-2.1.0.1...
>
> Installing library in
>
> C:\Users\Ralph\AppData\Roaming\cabal\parsec-2.1.0.1\ghc-6.12.2
>
> Registering parsec-2.1.0.1...
>
> cabal: parsec-2.1.0.1: dependency
>
> "base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use
> --force to
>
> override)
>
> cabal: Error: some packages failed to install:
>
> parsec-2.1.0.1 failed during the final install step. The exception was:
>
> exit: ExitFailure 1
>
>
>
> I wonder what to do next?

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


[Haskell-cafe] Dependency issues with GHC 6.12.2 installing parsec and others

2010-06-01 Thread Ralph Hodgson
"base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use --force
to override)

 

Having installed GHC 6.12.2, I am hitting these problems with every package
I tried to install:

 

C:\Users\Ralph>cabal install parsec

Resolving dependencies...

Configuring parsec-2.1.0.1...

Preprocessing library parsec-2.1.0.1...

Building parsec-2.1.0.1...

[ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos (
Text\ParserCombinators\

Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )

 

[snip]

 

[ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm (
Text\ParserCombinators

\Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )

 

Text\ParserCombinators\Parsec\Perm.hs:1:0:

Warning: Module `Prelude' is deprecated:

   You are using the old package `base' version 3.x.

   Future GHC versions will not support base version 3.x. You

   should update your code to use the new base version 4.x.

[10 of 10] Compiling Text.ParserCombinators.Parsec.Language (
Text\ParserCombina

tors\Parsec\Language.hs, dist\build\Text\ParserCombinators\Parsec\Language.o
)

 

Text\ParserCombinators\Parsec\Language.hs:1:0:

Warning: Module `Prelude' is deprecated:

   You are using the old package `base' version 3.x.

   Future GHC versions will not support base version 3.x. You

   should update your code to use the new base version 4.x.

Registering parsec-2.1.0.1...

Installing library in

C:\Users\Ralph\AppData\Roaming\cabal\parsec-2.1.0.1\ghc-6.12.2

Registering parsec-2.1.0.1...

cabal: parsec-2.1.0.1: dependency

"base-3.0.3.2-b2241f4c659fe250ebb821a4173f40c9" doesn't exist (use --force
to

override)

cabal: Error: some packages failed to install:

parsec-2.1.0.1 failed during the final install step. The exception was:

exit: ExitFailure 1

 

I wonder what to do next?

 

 

From: Ralph Hodgson [mailto:rhodg...@topquadrant.com] 
Sent: Tuesday, June 01, 2010 11:19 AM
To: rhodg...@topquadrant.com; 'Don Stewart'
Cc: 'Henning Thielemann'; haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] Installing Curl on Windows 7 - no longer a
permissions problem - due to dependency conflicts

 

Permissions issue was straight-forward to resolve.

 

Yesterday I tracked this down to a conflict with versions of bytestring.

 

ghc.6.10.4 needs bytestring-0.9.1.4 

 

 

ghc-pkg: unregistering bytestring-0.9.1.4 would break the following
packages: ha

ddock-2.4.2 ghc-6.10.4 Win32-2.2.0.0 regex-base-0.72.0.2
regex-posix-0.72.0.3 re

gex-compat-0.71.0.1 zlib-0.5.0.0 HTTP-4000.0.6 cgi-3001.1.7.1 curl-1.3.5
QuickCh

eck-2.1.0.3 tagsoup-0.9 feed-0.3.7 tagsoup-0.10 utf8-string-0.3.6 xml-1.3.7
(use

 --force to override)

 

other libraries need bytestring-09.1.6

 

ghc-pkg: unregistering bytestring-0.9.1.6 would break the following
packages: Wi

n32-2.2.0.0 Win32-2.2.0.2 HTTP-4000.0.9 (use --force to override)

 

Yesterday I could not  access haskell.org  to see if I can install a newer
version of GHC - network or server is done.

 

Today I am upgrading everything to ghc-6.12.2

 

There must be a tool somewhere that can assess potential conflicts :

 

A needs B (>2)

A needs C (>1) but 

C needs B (<2)

 

I will look once I get passed these install issues

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 31, 2010 2:51 PM
To: 'Don Stewart'
Cc: 'Henning Thielemann'; haskell-cafe@haskell.org
Subject: [Haskell-cafe] Installing Curl on Windows 7 - permissions problem

 

Don,

 

More angst with Windows 7 permissions.  I hope this is a simple thing for
you or someone else to help me with.

 

I have successfully installed other packages into my private cabal area.   

 

When it came to the Haskell curl package, I got permission errors.

 

Just to prove that things go to the right places, here is a successful run
with the Parseargs Package.

 

C:\Users\Ralph>cabal install parseargs

Resolving dependencies...

Downloading parseargs-0.1.3...

Configuring parseargs-0.1.3...

Preprocessing library parseargs-0.1.3...

Preprocessing executables for parseargs-0.1.3...

Building parseargs-0.1.3...

[1 of 1] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\System\Console\ParseArgs.o )

Registering parseargs-0.1.3...

[1 of 2] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\parseargs-example\parseargs-example-tmp\System\Console\ParseArgs.o )

[2 of 2] Compiling Main ( parseargs-example.hs,
dist\build\parseargs

-example\parseargs-example-tmp\Main.o )

Linking dist\build\parseargs-example\parseargs-example.exe ...

Installing library in

C:\Users\Ralph\AppData\Roaming\cabal\parseargs-0.1.3\ghc-6.10.4

Installing executable(s) in C:\Users\Ralph\AppData\Roaming\cabal\bin

Registering parsearg

RE: [Haskell-cafe] Installing Curl on Windows 7 - no longer a permissions problem - due to dependency conflicts

2010-06-01 Thread Ralph Hodgson
Permissions issue was straight-forward to resolve.

 

Yesterday I tracked this down to a conflict with versions of bytestring.

 

ghc.6.10.4 needs bytestring-0.9.1.4 

 

 

ghc-pkg: unregistering bytestring-0.9.1.4 would break the following
packages: ha

ddock-2.4.2 ghc-6.10.4 Win32-2.2.0.0 regex-base-0.72.0.2
regex-posix-0.72.0.3 re

gex-compat-0.71.0.1 zlib-0.5.0.0 HTTP-4000.0.6 cgi-3001.1.7.1 curl-1.3.5
QuickCh

eck-2.1.0.3 tagsoup-0.9 feed-0.3.7 tagsoup-0.10 utf8-string-0.3.6 xml-1.3.7
(use

 --force to override)

 

other libraries need bytestring-09.1.6

 

ghc-pkg: unregistering bytestring-0.9.1.6 would break the following
packages: Wi

n32-2.2.0.0 Win32-2.2.0.2 HTTP-4000.0.9 (use --force to override)

 

Yesterday I could not  access haskell.org  to see if I can install a newer
version of GHC - network or server is done.

 

Today I am upgrading everything to ghc-6.12.2

 

There must be a tool somewhere that can assess potential conflicts :

 

A needs B (>2)

A needs C (>1) but 

C needs B (<2)

 

I will look once I get passed these install issues

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 31, 2010 2:51 PM
To: 'Don Stewart'
Cc: 'Henning Thielemann'; haskell-cafe@haskell.org
Subject: [Haskell-cafe] Installing Curl on Windows 7 - permissions problem

 

Don,

 

More angst with Windows 7 permissions.  I hope this is a simple thing for
you or someone else to help me with.

 

I have successfully installed other packages into my private cabal area.   

 

When it came to the Haskell curl package, I got permission errors.

 

Just to prove that things go to the right places, here is a successful run
with the Parseargs Package.

 

C:\Users\Ralph>cabal install parseargs

Resolving dependencies...

Downloading parseargs-0.1.3...

Configuring parseargs-0.1.3...

Preprocessing library parseargs-0.1.3...

Preprocessing executables for parseargs-0.1.3...

Building parseargs-0.1.3...

[1 of 1] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\System\Console\ParseArgs.o )

Registering parseargs-0.1.3...

[1 of 2] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\parseargs-example\parseargs-example-tmp\System\Console\ParseArgs.o )

[2 of 2] Compiling Main ( parseargs-example.hs,
dist\build\parseargs

-example\parseargs-example-tmp\Main.o )

Linking dist\build\parseargs-example\parseargs-example.exe ...

Installing library in

C:\Users\Ralph\AppData\Roaming\cabal\parseargs-0.1.3\ghc-6.10.4

Installing executable(s) in C:\Users\Ralph\AppData\Roaming\cabal\bin

Registering parseargs-0.1.3...

 

Parseargs installed fine and the package list shows it in my cabal
directory.

 

C:\Users\Ralph>ghc-pkg list

C:/Program Files (x86)/Haskell Platform/2009.2.0.2\package.conf:

Cabal-1.6.0.3, GLUT-2.1.1.2, HTTP-4000.0.6, HUnit-1.2.0.3,

OpenGL-2.2.1.1, QuickCheck-1.2.0.0, Win32-2.2.0.0, array-0.2.0.0,

base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4, cgi-3001.1.7.1,

containers-0.2.0.1, directory-1.0.0.3, (dph-base-0.3),

(dph-par-0.3), (dph-prim-interface-0.3), (dph-prim-par-0.3),

(dph-prim-seq-0.3), (dph-seq-0.3), extensible-exceptions-0.1.1.0,

fgl-5.4.2.2, filepath-1.1.0.2, (ghc-6.10.4), ghc-prim-0.1.0.0,

haddock-2.4.2, haskell-src-1.0.1.3, haskell98-1.0.1.0, hpc-0.5.0.3,

html-1.0.1.2, integer-0.1.0.1, mtl-1.1.0.2, network-2.2.1.4,

old-locale-1.0.0.1, old-time-1.0.0.2, packedstring-0.1.0.1,

parallel-1.1.0.1, parsec-2.1.0.1, pretty-1.0.1.0, process-1.0.1.1,

random-1.0.0.1, regex-base-0.72.0.2, regex-compat-0.71.0.1,

regex-posix-0.72.0.3, rts-1.0, stm-2.1.1.2, syb-0.1.0.1,

template-haskell-2.3.0.1, time-1.1.2.4, xhtml-3000.2.0.1,

zlib-0.5.0.0

C:\Users\Ralph\AppData\Roaming\ghc\i386-mingw32-6.10.4\package.conf:

Cabal-1.8.0.4, ListZipper-1.1.1.0, QuickCheck-2.1.0.3,

bytestring-0.9.1.6, deepseq-1.1.0.0, parseargs-0.1.3, tagsoup-0.9

 

C:\Users\Ralph>

 

Now for curl. 

 

I installed Mingw32 (following the advice at
http://old.nabble.com/cURL-under-Windows-again-td21789068.html#a21789068)

 

This is what happened when I went to my windows shell:

 

C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup build

Preprocessing library curl-1.3.5...

Building curl-1.3.5...

Registering curl-1.3.5...

 

C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup install

setup: permission denied

 

I am wondering if the curl package is trying to put things in system
folders?

 

Help much appreciated - tight deadlines

 

Ralph

 

 

-Original Message-
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Don Stewart
Sent: Wednesday, May 19, 2010 1:37 PM
To: Henning Thielemann
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] TagSoup 0.9

 

schlepptop:

> Don Stewar

[Haskell-cafe] Installing Curl on Windows 7 - permissions problem

2010-06-01 Thread Ralph Hodgson
Don,

 

More angst with Windows 7 permissions.  I hope this is a simple thing for
you or someone else to help me with.

 

I have successfully installed other packages into my private cabal area.   

 

When it came to the Haskell curl package, I got permission errors.

 

Just to prove that things go to the right places, here is a successful run
with the Parseargs Package.

 

C:\Users\Ralph>cabal install parseargs

Resolving dependencies...

Downloading parseargs-0.1.3...

Configuring parseargs-0.1.3...

Preprocessing library parseargs-0.1.3...

Preprocessing executables for parseargs-0.1.3...

Building parseargs-0.1.3...

[1 of 1] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\System\Console\ParseArgs.o )

Registering parseargs-0.1.3...

[1 of 2] Compiling System.Console.ParseArgs ( System\Console\ParseArgs.hs,
dist\

build\parseargs-example\parseargs-example-tmp\System\Console\ParseArgs.o )

[2 of 2] Compiling Main ( parseargs-example.hs,
dist\build\parseargs

-example\parseargs-example-tmp\Main.o )

Linking dist\build\parseargs-example\parseargs-example.exe ...

Installing library in

C:\Users\Ralph\AppData\Roaming\cabal\parseargs-0.1.3\ghc-6.10.4

Installing executable(s) in C:\Users\Ralph\AppData\Roaming\cabal\bin

Registering parseargs-0.1.3...

 

Parseargs installed fine and the package list shows it in my cabal
directory.

 

C:\Users\Ralph>ghc-pkg list

C:/Program Files (x86)/Haskell Platform/2009.2.0.2\package.conf:

Cabal-1.6.0.3, GLUT-2.1.1.2, HTTP-4000.0.6, HUnit-1.2.0.3,

OpenGL-2.2.1.1, QuickCheck-1.2.0.0, Win32-2.2.0.0, array-0.2.0.0,

base-3.0.3.1, base-4.1.0.0, bytestring-0.9.1.4, cgi-3001.1.7.1,

containers-0.2.0.1, directory-1.0.0.3, (dph-base-0.3),

(dph-par-0.3), (dph-prim-interface-0.3), (dph-prim-par-0.3),

(dph-prim-seq-0.3), (dph-seq-0.3), extensible-exceptions-0.1.1.0,

fgl-5.4.2.2, filepath-1.1.0.2, (ghc-6.10.4), ghc-prim-0.1.0.0,

haddock-2.4.2, haskell-src-1.0.1.3, haskell98-1.0.1.0, hpc-0.5.0.3,

html-1.0.1.2, integer-0.1.0.1, mtl-1.1.0.2, network-2.2.1.4,

old-locale-1.0.0.1, old-time-1.0.0.2, packedstring-0.1.0.1,

parallel-1.1.0.1, parsec-2.1.0.1, pretty-1.0.1.0, process-1.0.1.1,

random-1.0.0.1, regex-base-0.72.0.2, regex-compat-0.71.0.1,

regex-posix-0.72.0.3, rts-1.0, stm-2.1.1.2, syb-0.1.0.1,

template-haskell-2.3.0.1, time-1.1.2.4, xhtml-3000.2.0.1,

zlib-0.5.0.0

C:\Users\Ralph\AppData\Roaming\ghc\i386-mingw32-6.10.4\package.conf:

Cabal-1.8.0.4, ListZipper-1.1.1.0, QuickCheck-2.1.0.3,

bytestring-0.9.1.6, deepseq-1.1.0.0, parseargs-0.1.3, tagsoup-0.9

 

C:\Users\Ralph>

 

Now for curl. 

 

I installed Mingw32 (following the advice at
http://old.nabble.com/cURL-under-Windows-again-td21789068.html#a21789068)

 

This is what happened when I went to my windows shell:

 

C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup build

Preprocessing library curl-1.3.5...

Building curl-1.3.5...

Registering curl-1.3.5...

 

C:\Users\Ralph\AppData\Roaming\cabal\curl-1.3.5>runhaskell setup install

setup: permission denied

 

I am wondering if the curl package is trying to put things in system
folders?

 

Help much appreciated - tight deadlines

 

Ralph

 

 

-Original Message-
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Don Stewart
Sent: Wednesday, May 19, 2010 1:37 PM
To: Henning Thielemann
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] TagSoup 0.9

 

schlepptop:

> Don Stewart schrieb:

> > Or use things from the download-curl package, which provides a nice

> > openURL function.

> 

> The openURL function from TagSoup is lazy, which the proposed

> replacement 'getResponseBody =<< simpleHTTP (getRequest x)' is not. Is

> the openURL function from download-curl lazy?

> 

 

Yes, see:

 

Network.Curl.Download.Lazy.openLazyURI

 

though I think it is possible that I strictified the code. Have a play

around with it if it doesn't meet your needs -- should be /trivial/ to

ensure it is chunk-wise lazy.

___

Haskell-Cafe mailing list

Haskell-Cafe@haskell.org

http://www.haskell.org/mailman/listinfo/haskell-cafe

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


RE: [Haskell-cafe] TagSoup 0.9

2010-05-23 Thread Ralph Hodgson
Thanks Neil,

 

Using Network.HTTP worked.

 

However something else I have just run into concerns some web pages that
start with:

 



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

 

I get the following bad result:

 

TagText "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nLast-Modified: Tue,
27 Oct 2009 19:30:40 GMT\r\nETag: \"6f248cf73b57ca1:25e2\"\r\nDate: Sun, 23
May 2010 22:46:41 GMT\r\nTransfer-Encoding:  chunked\r\nConnection:
close\r\nConnection:
Transfer-Encoding\r\n\r\n4000\r\n\255\254<\NUL?\NULx\NULm\NULl\NUL
\NULv\NULe\NULr\NULs\NULi\NULo\NULn\NUL=\NUL\"\NUL1\NUL.\NUL0\NUL\"\NUL
\NULe\NULn\NULc\NULo\NULd\NULi\NULn\NULg\NUL=\NUL\"\NULi\NULs\NULo\NUL-\NUL8
\NUL8\NUL5\NUL9\NUL-\NUL1\NUL\"\NUL

 

etc etc

 

Is this an easy thing to fix? I've started to look over the code.

 

-Original Message-
From: Neil Mitchell [mailto:ndmitch...@gmail.com] 
Sent: Wednesday, May 19, 2010 12:19 PM
To: Ralph Hodgson
Cc: Daniel Fischer; haskell-cafe@haskell.org; Don Stewart
Subject: Re: [Haskell-cafe] TagSoup 0.9

 

Hi Ralph,

 

> I was using TagSoup 0.8 with great success. On upgrading to 0.9 I have
this error:

> 

> TQ\TagSoup\TagSoupExtensions.lhs:29:17:

>`Tag' is not applied to enough type arguments

>Expected kind `*', but `Tag' has kind `* -> *'

>In the type synonym declaration for `Bundle'

> Failed, modules loaded: TQ.Common.TextAndListHandling.

 

My change notes have this being a change between 0.6 and 0.8. As

Malcolm says, any old uses of "Tag" should become "Tag String". The

reason is that Tag is now parameterised, and you can use Tag

ByteString etc. However, I should point out that Tag ByteString won't

be any faster than Tag String in this version (it's in the future work

pile).

 

>> > Forgot to add: I now need to understand the following warnings on this

>> > line "> import Text.HTML.Download":

 

Everyone's comments have been right. I previously included

Text.HTML.Download so that it was easy to test tagsoup against the

web. Since I first wrote that snippet the HTTP downloading libraries

have improved substantially, so people should use those in favour of

the version in tagsoup - you'll be able to connect to more websites in

more reliable ways, go through proxies etc. I don't intend to remove

the Download module any time soon, but I will do eventually.

 

Thanks, Neil

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


RE: [Haskell-cafe] TagSoup 0.9

2010-05-19 Thread Ralph Hodgson
Forgot to add: I now need to understand the following warnings on this line "> 
import Text.HTML.Download":

 

TagSoupExtensions.lhs:24:2:

Warning: In the use of `openItem'

 (imported from Text.HTML.Download):

 Deprecated: "Use package HTTP, module Network.HTTP, getResponseBody

 =<< simpleHTTP (getRequest url)"

 

TagSoupExtensions.lhs:24:2:

Warning: In the use of `openURL'

 (imported from Text.HTML.Download):

 Deprecated: "Use package HTTP, module Network.HTTP, getResponseBody

 =<< simpleHTTP (getRequest url)"

Ok, modules loaded: TQ.TagSoup.TagSoupExtensions.

*TQ.TagSoup.TagSoupExtensions>

 

 

From: haskell-cafe-boun...@haskell.org 
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Wednesday, May 19, 2010 10:30 AM
To: 'Malcolm Wallace'
Cc: haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] TagSoup 0.9

 

Thanks Malcolm,

 

Providing a 'String' type argument worked:

 

> type Bundle = [Tag String]

 

> extractTags :: Tag String -> Tag String -> Bundle -> Bundle

> extractTags fromTag toTag tags = takeWhile (~/= toTag ) $ dropWhile (~/= 
> fromTag ) tags

 

 

 

From: Malcolm Wallace [mailto:malcolm.wall...@me.com] 
Sent: Wednesday, May 19, 2010 1:48 AM
To: rhodg...@topquadrant.com
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] TagSoup 0.9

 

Neil says that the API of TagSoup changed in 0.9.
All usages of the type Tag should now take a type argument, e.g. Tag String.
 
 
Regards,
Malcolm
 
 
On Wednesday, May 19, 2010, at 08:05AM, "Ralph Hodgson" 
 wrote:
>___
>Haskell-Cafe mailing list
>Haskell-Cafe@haskell.org
>http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

Hello Neil ,

 

I was using TagSoup 0.8 with great success. On upgrading to 0.9 I have this 
error:

 

TQ\TagSoup\TagSoupExtensions.lhs:29:17:

`Tag' is not applied to enough type arguments

Expected kind `*', but `Tag' has kind `* -> *'

In the type synonym declaration for `Bundle'

Failed, modules loaded: TQ.Common.TextAndListHandling.

 

where line 29 is the type declaration for 'bundle' in the following code:

 

> module TQ.TagSoup.TagSoupExtensions where 

 

> import TQ.Common.TextAndListHandling

> import Text.HTML.TagSoup

> import Text.HTML.Download

> import Control.Monad

> import Data.List

> import Data.Char

 

> type Bundle = [Tag]

 

[snip]

 

> tagsOnPage :: String -> IO(String)

> tagsOnPage url = do

>  tags <- liftM parseTags $ openURL url

>  let results = unlines $ map(show) $ tags

>  return (results)

 

> extractTags :: Tag -> Tag -> [Tag] -> [Tag]

> extractTags fromTag toTag tags = takeWhile (~/= toTag ) $ dropWhile (~/= 
> fromTag ) tags 

 

> extractTagsBetween ::  Tag -> [Tag] -> [Tag]

> extractTagsBetween _ [] = []

> extractTagsBetween markerTag tags = if startTags == []

>  then []

>  else [head startTags] ++ (takeWhile (~/= markerTag ) $ tail 
> startTags) 

>  where

>startTags = dropWhile (~/= markerTag ) tags

 

I need to repair this code quickly. I am hoping you can quickly help me resolve 
this. Thanks.

 

Ralph Hodgson, 

@ralphtq <http://twitter.com/ralphtq> 

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


RE: [Haskell-cafe] TagSoup 0.9

2010-05-19 Thread Ralph Hodgson
Thanks Malcolm,

 

Providing a 'String' type argument worked:

 

> type Bundle = [Tag String]

 

> extractTags :: Tag String -> Tag String -> Bundle -> Bundle

> extractTags fromTag toTag tags = takeWhile (~/= toTag ) $ dropWhile (~/= 
> fromTag ) tags

 

 

 

From: Malcolm Wallace [mailto:malcolm.wall...@me.com] 
Sent: Wednesday, May 19, 2010 1:48 AM
To: rhodg...@topquadrant.com
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] TagSoup 0.9

 

Neil says that the API of TagSoup changed in 0.9.
All usages of the type Tag should now take a type argument, e.g. Tag String.
 
 
Regards,
Malcolm
 
 
On Wednesday, May 19, 2010, at 08:05AM, "Ralph Hodgson" 
 wrote:
>___
>Haskell-Cafe mailing list
>Haskell-Cafe@haskell.org
>http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

Hello Neil ,

 

I was using TagSoup 0.8 with great success. On upgrading to 0.9 I have this 
error:

 

TQ\TagSoup\TagSoupExtensions.lhs:29:17:

`Tag' is not applied to enough type arguments

Expected kind `*', but `Tag' has kind `* -> *'

In the type synonym declaration for `Bundle'

Failed, modules loaded: TQ.Common.TextAndListHandling.

 

where line 29 is the type declaration for 'bundle' in the following code:

 

> module TQ.TagSoup.TagSoupExtensions where 

 

> import TQ.Common.TextAndListHandling

> import Text.HTML.TagSoup

> import Text.HTML.Download

> import Control.Monad

> import Data.List

> import Data.Char

 

> type Bundle = [Tag]

 

[snip]

 

> tagsOnPage :: String -> IO(String)

> tagsOnPage url = do

>  tags <- liftM parseTags $ openURL url

>  let results = unlines $ map(show) $ tags

>  return (results)

 

> extractTags :: Tag -> Tag -> [Tag] -> [Tag]

> extractTags fromTag toTag tags = takeWhile (~/= toTag ) $ dropWhile (~/= 
> fromTag ) tags 

 

> extractTagsBetween ::  Tag -> [Tag] -> [Tag]

> extractTagsBetween _ [] = []

> extractTagsBetween markerTag tags = if startTags == []

>  then []

>  else [head startTags] ++ (takeWhile (~/= markerTag ) $ tail 
> startTags) 

>          where

>startTags = dropWhile (~/= markerTag ) tags

 

I need to repair this code quickly. I am hoping you can quickly help me resolve 
this. Thanks.

 

Ralph Hodgson, 

@ralphtq <http://twitter.com/ralphtq> 

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


[Haskell-cafe] TagSoup 0.9

2010-05-19 Thread Ralph Hodgson
Hello Neil ,

 

I was using TagSoup 0.8 with great success. On upgrading to 0.9 I have this
error:

 

TQ\TagSoup\TagSoupExtensions.lhs:29:17:

`Tag' is not applied to enough type arguments

Expected kind `*', but `Tag' has kind `* -> *'

In the type synonym declaration for `Bundle'

Failed, modules loaded: TQ.Common.TextAndListHandling.

 

where line 29 is the type declaration for 'bundle' in the following code:

 

> module TQ.TagSoup.TagSoupExtensions where 

 

> import TQ.Common.TextAndListHandling

> import Text.HTML.TagSoup

> import Text.HTML.Download

> import Control.Monad

> import Data.List

> import Data.Char

 

> type Bundle = [Tag]

 

[snip]

 

> tagsOnPage :: String -> IO(String)

> tagsOnPage url = do

>  tags <- liftM parseTags $ openURL url

>  let results = unlines $ map(show) $ tags

>  return (results)

 

> extractTags :: Tag -> Tag -> [Tag] -> [Tag]

> extractTags fromTag toTag tags = takeWhile (~/= toTag ) $ dropWhile (~/=
fromTag ) tags 

 

> extractTagsBetween ::  Tag -> [Tag] -> [Tag]

> extractTagsBetween _ [] = []

> extractTagsBetween markerTag tags = if startTags == []

>  then []

>  else [head startTags] ++ (takeWhile (~/= markerTag ) $ tail
startTags) 

>  where

>startTags = dropWhile (~/= markerTag ) tags

 

I need to repair this code quickly. I am hoping you can quickly help me
resolve this. Thanks.

 

Ralph Hodgson, 

@ralphtq <http://twitter.com/ralphtq> 

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


RE: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

2010-05-17 Thread Ralph Hodgson
Thanks for your help - that worked beautifully.

 

From: Phyx [mailto:loneti...@gmail.com] 
Sent: Monday, May 17, 2010 1:38 AM
To: rhodg...@topquadrant.com; haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Right, the problem is that under windows 7 and vista the Program Files
folder if not "yours" as in you don't have direct permission to write there
without elevation. 

You could go to the Haskell folder, and grand your current user full rights,
but any new tools installed will inherit the original and not modified
permission (I believe).

 

The other approach I like much better is instead of doing global installs,
do user installs. In fact, I made it my default. Which solves any permission
error, but means every user on that machine has to install the libs
separately which shouldn't be a problem if you're the only one.

 

To do this go to C:\Users\\AppData\Roaming\cabal\ and open the
file "config" in a text editor and inside that, uncomment the bit that says
"user-install: True"

 

That should do it.

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 17, 2010 09:51
To: haskell-cafe@haskell.org
Subject: RE: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Providing more evidence of the issue by running cabal with -v flag:

 

...

...

Linking...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ar.exe -r
dist\build\libHSCabal-1.8.0.4.a dist\build\Distribution\Compiler.o
dist\build\Distribution\InstalledPackageInfo.o 

...

...

...

Registering Cabal-1.8.0.4...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ghc-pkg.exe update -
--global --no-user-package-conf --package-conf=dist\package.conf.inplace

Creating
C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setu
p(and its parents)

C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setu
p\setup.exe install --verbose=2

directory dist\doc\html\Cabal does exist: False

Creating C:\Program Files (x86)\Haskell\doc\Cabal-1.8.0.4 (and its parents)

setup.exe: permission denied

cabal: Error: some packages failed to install:

Cabal-1.8.0.4 failed during the final install step. The exception was:

exit: ExitFailure 1

cabal-install-0.8.2 depends on Cabal-1.8.0.4 which failed to install.

 

C:\Users\Ralph>

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 17, 2010 12:18 AM
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Following a successful install of the Haskell Platform on MAC OSX,  I
proceed to update my Windows PC. 

 

Frustration followed. I am blocked by a "Permission Denied" error when I do
a "Setup install":

 

>ghc --make Setup

[58 of 58] Compiling Main ( Setup.hs, Setup.o )

Linking Setup.exe ...

 

>Setup configure

Configuring Cabal-1.8.0.4...

 

>Setup build

Preprocessing library Cabal-1.8.0.4...

Building Cabal-1.8.0.4...

Registering Cabal-1.8.0.4...

 

>Setup install

Setup: permission denied

 

> 

 

I changed the permission on folders in the "Haskell Platform" directories to
"full control", without any effect.

 

I have searched the web for help but  could not find my problem. Can't help
but think it is something trivial but what?

 

Help appreciated.

 

Ralph Hodgson, @ralphtq <http://twitter.com/ralphtq> 

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


RE: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

2010-05-17 Thread Ralph Hodgson
Providing more evidence of the issue by running cabal with -v flag:

 

...

...

Linking...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ar.exe -r
dist\build\libHSCabal-1.8.0.4.a dist\build\Distribution\Compiler.o
dist\build\Distribution\InstalledPackageInfo.o 

...

...

...

Registering Cabal-1.8.0.4...

C:\Program Files (x86)\Haskell Platform\2009.2.0.2\bin\ghc-pkg.exe update -
--global --no-user-package-conf --package-conf=dist\package.conf.inplace

Creating
C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setu
p(and its parents)

C:\Users\Ralph\AppData\Local\Temp\Cabal-1.8.0.411920\Cabal-1.8.0.4\dist\setu
p\setup.exe install --verbose=2

directory dist\doc\html\Cabal does exist: False

Creating C:\Program Files (x86)\Haskell\doc\Cabal-1.8.0.4 (and its parents)

setup.exe: permission denied

cabal: Error: some packages failed to install:

Cabal-1.8.0.4 failed during the final install step. The exception was:

exit: ExitFailure 1

cabal-install-0.8.2 depends on Cabal-1.8.0.4 which failed to install.

 

C:\Users\Ralph>

 

From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Ralph Hodgson
Sent: Monday, May 17, 2010 12:18 AM
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

 

Following a successful install of the Haskell Platform on MAC OSX,  I
proceed to update my Windows PC. 

 

Frustration followed. I am blocked by a "Permission Denied" error when I do
a "Setup install":

 

>ghc --make Setup

[58 of 58] Compiling Main ( Setup.hs, Setup.o )

Linking Setup.exe ...

 

>Setup configure

Configuring Cabal-1.8.0.4...

 

>Setup build

Preprocessing library Cabal-1.8.0.4...

Building Cabal-1.8.0.4...

Registering Cabal-1.8.0.4...

 

>Setup install

Setup: permission denied

 

> 

 

I changed the permission on folders in the "Haskell Platform" directories to
"full control", without any effect.

 

I have searched the web for help but  could not find my problem. Can't help
but think it is something trivial but what?

 

Help appreciated.

 

Ralph Hodgson, @ralphtq <http://twitter.com/ralphtq> 

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


[Haskell-cafe] Windows 7 Permission Denied Problem on Cabal

2010-05-17 Thread Ralph Hodgson
Following a successful install of the Haskell Platform on MAC OSX,  I
proceed to update my Windows PC. 

 

Frustration followed. I am blocked by a "Permission Denied" error when I do
a "Setup install":

 

>ghc --make Setup

[58 of 58] Compiling Main ( Setup.hs, Setup.o )

Linking Setup.exe ...

 

>Setup configure

Configuring Cabal-1.8.0.4...

 

>Setup build

Preprocessing library Cabal-1.8.0.4...

Building Cabal-1.8.0.4...

Registering Cabal-1.8.0.4...

 

>Setup install

Setup: permission denied

 

> 

 

I changed the permission on folders in the "Haskell Platform" directories to
"full control", without any effect.

 

I have searched the web for help but  could not find my problem. Can't help
but think it is something trivial but what?

 

Help appreciated.

 

Ralph Hodgson, @ralphtq <http://twitter.com/ralphtq> 

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


Re: [Haskell-cafe] Passing Constructors as arguments

2005-04-13 Thread Ralph Hodgson
Thanks for your help Daniel - I am clarifying my message
Daniel Fischer wrote:
Am Mittwoch, 13. April 2005 15:43 schrieb Ralph Hodgson:
 

I am learning Haskell and have set a small exercise for myself on a
frames and slots program.
Would appreciate some help on how to pass constructors of data
structures as arguments to a function.
Thanks,
-- Ralph
   


 

Now I need a way to extract properties from the frame. Start by testing
pattern matching
without using parameters. Then I need to find out how to pass a
constructor as a parameter.
   

Your code works fine. 
I'm not sure, what your problem is.
Given type-correctness, data constructors can be passed as arguments to 
functions like any other function. Probably that's not your question, 
however. 
 

I would like to see an example of passing constructors as arguments. I 
am still getting familiar with constructs like:

> getProperty ( a -> b) -> [ContactProperty] -> b
I am not sure how to test the Constructor passed as the argument. Do I 
say the following:

> getProperty c ((c v:_) = v
> getProperty c ((_:xs) = getProperty c xs
..
I have tried doing this but GHC gives me parse errors. There is  Haskell 
syntax that I don't know yet that I need to learn.

As a wild guess, maybe you should use labelled records,
data Contact = Contact
{ firstName :: FirstName
, lastName :: LastName
, ...
}
and you have your selector-functions.
 

thanks - very useful
And it's possible to define partial contacts as
me = Contact{firstName="Daniel", lastName="Fischer"}
-- just don't ask for my phone-number or anything else which is undefined.
If I'm far off, state your problem more precisely.
 

> getProperty:: [ContactProperty] -> FirstName
> getProperty ((FN fn):_) = fn
> getProperty (_:xs)  = getProperty xs
> getProperty  [] = "unknown"
>
> firstName:: Contact -> FirstName
> firstName (Contact cpl) = getProperty cpl
   

Cheers,
Daniel
 

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


[Haskell-cafe] Passing Constructors as arguments

2005-04-13 Thread Ralph Hodgson




I am learning Haskell and have set a small exercise for myself on a
frames and slots program. 
Would appreciate some help on how to pass constructors of data
structures as arguments to a function. 

Thanks,

-- Ralph
__

A
Frames test


> module Frames

> where 


Define frame slots:


> type FirstName = String -- first name

> type LastName    = String   -- last name

> type Organization = String

> type Email = String

> type WorkPhone = String

> type CellPhone = String

> type TelephoneNumber = String


Define slots for a contact


> data ContactProperty = FN FirstName

>   | LN LastName

>   | OR Organization

>   | EM Email

>   | WP TelephoneNumber

>   | MP TelephoneNumber

> deriving (Show, Eq)


> data Contact = Contact [ContactProperty]

> deriving (Show, Eq)


> type Contacts = [ Contact]


Now I need a way to extract properties from the frame. Start by testing
pattern matching

without using parameters. Then I need to find out how to pass a
constructor as a parameter.


> getProperty:: [ContactProperty] -> FirstName

> getProperty ((FN fn):_) = fn

> getProperty (_:xs)  = getProperty xs

> getProperty  [] = "unknown"


> firstName:: Contact -> FirstName

> firstName (Contact cpl) = getProperty cpl



Define Contacts


> c1::Contacts

> c1 =

>  [ ( Contact  [(FN "Ralph"),(LN "Hodgson"),(OR "TopQuadrant"),(EM "[EMAIL PROTECTED]")]),

>    ( Contact  [(FN "Mills"),(LN "Davis"),(EM "[EMAIL PROTECTED]")])]


Tests


> t1=firstName $ head c1 -- should be "Ralph"

> t2=firstName $ last c1 -- should be "Mills"

___











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