Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: a better way to do this (Heinrich Apfelmus)
2. Cabal install fails to download packages (Cal Paterson)
3. rts package in an invalid state (aditya siram)
4. Re: rts package in an invalid state (Jason Dusek)
5. Re: rts package in an invalid state (aditya siram)
6. Re: rts package in an invalid state (Raja Koduru)
7. Re: rts package in an invalid state (aditya siram)
8. Re: rts package in an invalid state (Raja Koduru)
9. question, chapter 10 Real World Haskell (Michael Mossey)
----------------------------------------------------------------------
Message: 1
Date: Fri, 10 Apr 2009 03:01:20 +0200
From: Heinrich Apfelmus <[email protected]>
Subject: [Haskell-beginners] Re: a better way to do this
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Michael P Mossey wrote:
> Michael P Mossey wrote:
>> This is an early attempt to create some kind of parser, for text that
>> is xml-like but not actually xml. This is probably a disaster by
>> Haskell standards... If someone could point me in the direction of a
>> better way of doing things, that would be great. I don't want to use
>> the existing parser library, not at first, because I want to learn
>> more from first principles (for now).
>>
>
> To follow up my own post, I'm working through chapter 10 of "Real World
> Haskell" right now, and then I'll look at chapter 14 (Monads). I think
> this is a better way of creating parsers. Maybe I'll look at Parsec
> eventually too, although I want to do a lot of stuff myself for the
> learning exprience.
I don't think that doing it "the hard way by hand" is very enlightening,
especially since you are using regular expressions anyway. (By the way,
the latter are a niche in Haskell; any serious and also most non-serious
parsing tasks are best done with parser combinators. The popularity of
regular expressions in languages like Python or Perl is mainly due to
the lack of more general parsing abstractions in these languages.)
A much more rewarding introduction to parsing and parser combinators is
probably to understand and experiment with their implementations, for
instance by starting with
Graham Hutton, Erik Meijer.
Monadic Parser Combinators.
http://www.cs.nott.ac.uk/~gmh/monparsing.ps
Regards,
apfelmus
--
http://apfelmus.nfshost.com
------------------------------
Message: 2
Date: Fri, 10 Apr 2009 12:22:06 +0100
From: Cal Paterson <[email protected]>
Subject: [Haskell-beginners] Cabal install fails to download packages
To: [email protected]
Message-ID: <20090410112206.ga11...@romeo>
Content-Type: text/plain; charset=us-ascii
Hello,
I am new to haskell, and I'm trying to get cabal to download and
install packages for me. However, it seems to fail to download
packages. Having cabal act on already installed packages seems to
work fine. Here is the end of the output:
c...@romeo:~$ cabal install haddock
...
selecting unix-2.3.0.0 (installed)
selecting ghc-paths-0.1.0.5 (hackage) and discarding ghc-paths-0.1,
0.1.0.1,
0.1.0.2, 0.1.0.3 and 0.1.0.4
In order, the following would be installed:
ghc-paths-0.1.0.5 (new package)
haddock-2.4.2 (new package)
Downloading ghc-paths-0.1.0.5...
GET
http://hackage.haskell.org/packages/archive/ghc-paths/0.1.0.5/ghc-paths-0.1.0.5.tar.gz
Sending:
GET /packages/archive/ghc-paths/0.1.0.5/ghc-paths-0.1.0.5.tar.gz
HTTP/1.1
User-Agent: cabal-install/0.6.2
Host: hackage.haskell.org
proxy uri host: , port:
Creating new connection to
cabal: Error: some packages failed to install:
ghc-paths-0.1.0.5 failed while downloading the package.
haddock-2.4.2 depends on ghc-paths-0.1.0.5 which failed to install.
I first guessed that cabal was tripping up over some environment
variable, but it seems that $http_proxy is unset:
c...@romeo:~$ set | grep -i http | xclip
http_proxy=
Can anyone provide some advice as to what is likely to be going
wrong?
Thanks,
Cal
------------------------------
Message: 3
Date: Fri, 10 Apr 2009 16:06:54 -0500
From: aditya siram <[email protected]>
Subject: [Haskell-beginners] rts package in an invalid state
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hi all,
I recently compiled and installed ghc 6.10.2 on a clean system. But a
'ghc-pkg check' shows an error with the rts package [1]. A google
search advised me to install libffi5. I did this but keep getting the
same error. Any ideas?
Thanks ...
deech
[1] http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3630#a3630
------------------------------
Message: 4
Date: Fri, 10 Apr 2009 15:40:15 -0700
From: Jason Dusek <[email protected]>
Subject: Re: [Haskell-beginners] rts package in an invalid state
To: aditya siram <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Oh, look at this:
http://www.nabble.com/ghc-pkg-check-problem-in-6.10.2-td22846037.html
Seems to have come up not too long ago.
--
Jason Dusek
------------------------------
Message: 5
Date: Fri, 10 Apr 2009 18:01:45 -0500
From: aditya siram <[email protected]>
Subject: Re: [Haskell-beginners] rts package in an invalid state
To: Jason Dusek <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Yes, this was it! Thanks for much!
-deech
On Fri, Apr 10, 2009 at 5:40 PM, Jason Dusek <[email protected]> wrote:
> Oh, look at this:
>
> http://www.nabble.com/ghc-pkg-check-problem-in-6.10.2-td22846037.html
>
> Seems to have come up not too long ago.
>
> --
> Jason Dusek
>
------------------------------
Message: 6
Date: Sat, 11 Apr 2009 07:25:37 +0530
From: Raja Koduru <[email protected]>
Subject: Re: [Haskell-beginners] rts package in an invalid state
To: aditya siram <[email protected]>, [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi,
Just did ghc-pkg check on my system just out of curiosity.
Even here I am getting the rts package errors.
But I followed the instructions given at the above url to rectify it.
To my surprise there is one more such error. It is related to haddock-2.4.2.
Pasting here the 'ghc-pkg check's dump
----------------------------------------------------------------------------------------------------------------------------------------------------
C:\Program Files\Haskell>ghc-pkg check
There are problems in package haddock-2.4.2:
import-dirs: c:/builds/slave/x86-win-stable/build/ghc-6.10.2\haddock-2.4.2
doesn't exist or isn't
a directory
library-dirs:
c:/builds/slave/x86-win-stable/build/ghc-6.10.2\haddock-2.4.2 doesn't
exist or isn't
a directory
file Distribution\Haddock.hi is missing
file Haddock\DocName.hi is missing
file Haddock\Types.hi is missing
file Haddock\InterfaceFile.hi is missing
file Haddock\Exception.hi is missing
file Haddock\Utils.hi is missing
file Haddock\GHC\Utils.hi is missing
cannot find libHShaddock-2.4.2.a on library path
The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
haddock-2.4.2
-----------------------------------------------------------------------------------------------------------------------------------------------------
I am using 6.10.2 on windows XP.
Any suggestions on how to rectify this?
-raja
------------------------------
Message: 7
Date: Fri, 10 Apr 2009 21:00:34 -0500
From: aditya siram <[email protected]>
Subject: Re: [Haskell-beginners] rts package in an invalid state
To: Raja Koduru <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
I had this problem with the HTTP package. I followed the following steps:
1. Unregister the offending package with 'ghc-pkg unregister <packagename>'
2. Download the package from Hackage
3. Manually compile and install the package
4. Check that the package is in the list with 'ghc-pkg list'
5. Rerun 'ghc-pkg check'
hth,
deech
On Fri, Apr 10, 2009 at 8:55 PM, Raja Koduru <[email protected]> wrote:
> Hi,
> Just did ghc-pkg check on my system just out of curiosity.
> Even here I am getting the rts package errors.
>
> But I followed the instructions given at the above url to rectify it.
>
> To my surprise there is one more such error. It is related to haddock-2.4.2.
>
> Pasting here the 'ghc-pkg check's dump
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> C:\Program Files\Haskell>ghc-pkg check
> There are problems in package haddock-2.4.2:
> import-dirs: c:/builds/slave/x86-win-stable/build/ghc-6.10.2\haddock-2.4.2
> doesn't exist or isn't
> a directory
> library-dirs:
> c:/builds/slave/x86-win-stable/build/ghc-6.10.2\haddock-2.4.2 doesn't
> exist or isn't
> a directory
> file Distribution\Haddock.hi is missing
> file Haddock\DocName.hi is missing
> file Haddock\Types.hi is missing
> file Haddock\InterfaceFile.hi is missing
> file Haddock\Exception.hi is missing
> file Haddock\Utils.hi is missing
> file Haddock\GHC\Utils.hi is missing
> cannot find libHShaddock-2.4.2.a on library path
>
> The following packages are broken, either because they have a problem
> listed above, or because they depend on a broken package.
> haddock-2.4.2
> -----------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> I am using 6.10.2 on windows XP.
>
> Any suggestions on how to rectify this?
>
> -raja
>
------------------------------
Message: 8
Date: Sat, 11 Apr 2009 07:43:38 +0530
From: Raja Koduru <[email protected]>
Subject: Re: [Haskell-beginners] rts package in an invalid state
To: aditya siram <[email protected]>, [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Thank you. It worked.
Instead of downloading the package from hackage
I used "cabal install <package>".
Now I am not getting that error.
I believe that using cabal and manual compilation are equivalent when
it comes to package installation.
Correct me If am wrong.
-raja
------------------------------
Message: 9
Date: Sat, 11 Apr 2009 02:02:04 -0700
From: Michael Mossey <[email protected]>
Subject: [Haskell-beginners] question, chapter 10 Real World Haskell
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I'll looking at the parser example, page 242 in Chapter 10 of Real World
Haskell, and
they are defining a type of monadic parser with the help of an operator they
call ==>
You can find chapter 10 online. This ebook doesn't have page numbers, but you
can
find the example I'm looking at in the second called "A more interesting
parser",
about 40% of the way down:
<http://book.realworldhaskell.org/read/code-case-study-parsing-a-binary-data-format.html>
The authors have defined their parser by chaining together functions with ==>.
The
first function is "getState". What confuses me is: they use getState to "get
the
state out of the Parser," but a Parser is by definition a function that takes
the
parse state as its lone argument. I don't understand why they can't drop
getState
entirely. Maybe it's a simply a way to avoid wrapping the entire function in
Parser
(...)?
Some of this stuff looks "inefficient" to me, but I realize that in a lazy
language
with an optimizing compiler you can often write long chains of functions (many
of
which discard their results) and not impede efficiency.
Thanks,
Mike
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 10, Issue 10
*****************************************