Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  HXT and missing or null values (Ian Knopke)
   2.  Difference between Char and Data.Char modules (Ken Overton)
   3. Re:  Difference between Char and Data.Char        modules
      (Stephen Tetley)
   4. Re:  Difference between Char and Data.Char        modules (Brent Yorgey)
   5. Re:  Difference between Char and Data.Char modules (Ken Overton)
   6. Re:  Difference between Char and Data.Char        modules
      (Stephen Tetley)
   7.  the "download" package fail to install (Song Zhang)


----------------------------------------------------------------------

Message: 1
Date: Thu, 14 Jun 2012 17:37:06 +0100
From: Ian Knopke <ian.kno...@gmail.com>
Subject: [Haskell-beginners] HXT and missing or null values
To: beginners@haskell.org
Message-ID:
        <CAC+f4w=atir2atjwxbwgzjidr3ituxev1suykgmwnwpf2ss...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I got it. For anyone else running into the problem from my earlier
email, the way to get a null string is as follows:

Replace this line:
second <- text <<< atTag "second" -< x

with this:
second <- ((text `orElse` (constA "")) <<< atTag "second" -< x


Fixed program:

data Thing = Thing {first :: String, second :: String}

getThings = atTag "thing" >>>
  proc x -> do
      first     <- text <<< atTag "first" -< x
      second <- ((text `orElse` (constA "")) <<< atTag "second" -< x

      returnA -< Thing {first = first,second = second}

atTag tag = deep (isElem >>> hasName tag)

text = getChildren >>> getText

parseThings str = runX (readString [withValidate no] str >>> getThings)



------------------------------

Message: 2
Date: Thu, 14 Jun 2012 19:05:58 +0000
From: Ken Overton <kover...@lab49.com>
Subject: [Haskell-beginners] Difference between Char and Data.Char
        modules
To: "'beginners@haskell.org'" <beginners@haskell.org>
Message-ID:
        <b6368fed4eebe24fac9de115cf5c8c66afe...@exchange04b.lab49.com>
Content-Type: text/plain; charset="utf-8"

I just started looking at the Happy packag; I get a compile error when 
attempting to build examples/glr/expr-eval:

ExprData.hs:9:8:
    Could not find module `Char'
    It is a member of the hidden package `haskell98-2.0.0.1'.

ExprData.hs:9 says  ?import Char? and if I change this to ?import Data.Char? it 
compiles correctly (then I get a similar message for System, but when I 
understand Char I expect I will understand this too).

Could someone kindly explain the difference between these two modules? From the 
look of the error, I?m guessing there?s a history lesson involved?

Thanks,

Ken

________________________________

This email and any attachments may contain information which is confidential 
and/or privileged. The information is intended exclusively for the addressee 
and the views expressed may not be official policy, but the personal views of 
the originator. If you are not the intended recipient, be aware that any 
disclosure, copying, distribution or use of the contents is prohibited. If you 
have received this email and any file transmitted with it in error, please 
notify the sender by telephone or return email immediately and delete the 
material from your computer. Internet communications are not secure and Lab49 
is not responsible for their abuse by third parties, nor for any alteration or 
corruption in transmission, nor for any damage or loss caused by any virus or 
other defect. Lab49 accepts no liability or responsibility arising out of or in 
any way connected to this email.

------------------------------

Message: 3
Date: Thu, 14 Jun 2012 20:27:11 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] Difference between Char and Data.Char
        modules
To: Ken Overton <kover...@lab49.com>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <CAB2TPRBB7du-obYwOghjuc=bgczicmtblfxtgec-p-11ksx...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Char dates from the Haskell 98 specification, before hierarchical
modules were standardised. Data.Char is the newer hierarchical module
- it has been the de facto standard for a long time. Haskell 98 is
still supported by GHC but it is no longer the default - I think you
have to provide flags at the command line to get H98 automatically.

I'm not sure if the GLR (or attribute grammar) bits of Happy are
actively used, so you might expect a few infelicities if you try to
use them.



------------------------------

Message: 4
Date: Thu, 14 Jun 2012 15:32:39 -0400
From: Brent Yorgey <byor...@seas.upenn.edu>
Subject: Re: [Haskell-beginners] Difference between Char and Data.Char
        modules
To: beginners@haskell.org
Message-ID: <20120614193239.ga28...@seas.upenn.edu>
Content-Type: text/plain; charset=us-ascii

On Thu, Jun 14, 2012 at 08:27:11PM +0100, Stephen Tetley wrote:
> Char dates from the Haskell 98 specification, before hierarchical
> modules were standardised. Data.Char is the newer hierarchical module
> - it has been the de facto standard for a long time.

Not only has it been the de facto standard for a long time, it is now
the official standard, since hierarchical module names are included in
the Haskell 2010 standard.

-Brent



------------------------------

Message: 5
Date: Thu, 14 Jun 2012 19:43:50 +0000
From: Ken Overton <kover...@lab49.com>
Subject: Re: [Haskell-beginners] Difference between Char and Data.Char
        modules
To: "'beginners@haskell.org'" <beginners@haskell.org>
Message-ID:
        <b6368fed4eebe24fac9de115cf5c8c66afe...@exchange04b.lab49.com>
Content-Type: text/plain; charset="iso-8859-1"

Thanks; is there a better, more current example that you know of where I might 
start instead?



----- Original Message -----
From: Stephen Tetley [mailto:stephen.tet...@gmail.com]
Sent: Thursday, June 14, 2012 03:27 PM
To: Ken Overton
Cc: beginners@haskell.org <beginners@haskell.org>
Subject: Re: [Haskell-beginners] Difference between Char and Data.Char modules

Char dates from the Haskell 98 specification, before hierarchical
modules were standardised. Data.Char is the newer hierarchical module
- it has been the de facto standard for a long time. Haskell 98 is
still supported by GHC but it is no longer the default - I think you
have to provide flags at the command line to get H98 automatically.

I'm not sure if the GLR (or attribute grammar) bits of Happy are
actively used, so you might expect a few infelicities if you try to
use them.

________________________________

This email and any attachments may contain information which is confidential 
and/or privileged. The information is intended exclusively for the addressee 
and the views expressed may not be official policy, but the personal views of 
the originator. If you are not the intended recipient, be aware that any 
disclosure, copying, distribution or use of the contents is prohibited. If you 
have received this email and any file transmitted with it in error, please 
notify the sender by telephone or return email immediately and delete the 
material from your computer. Internet communications are not secure and Lab49 
is not responsible for their abuse by third parties, nor for any alteration or 
corruption in transmission, nor for any damage or loss caused by any virus or 
other defect. Lab49 accepts no liability or responsibility arising out of or in 
any way connected to this email.



------------------------------

Message: 6
Date: Thu, 14 Jun 2012 22:47:51 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] Difference between Char and Data.Char
        modules
To: Ken Overton <kover...@lab49.com>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <CAB2TPRCdVthnmAorXcvqSHbniDCR9fbO_=-=X5R==1eckyj...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi Ken

If you don't want GLR parsing (or attribute grammars) the Happy docs
should be fine. GHC uses Happy, though an LR grammar, for its front
end, so regular LR parsing always works.

If you want GLR you might want to search the web to find out who
authored the GLR extension. I'm afraid I've forgotten the person, but
I seem to remember there was a thesis (possibly United Kingdom MSc ?)
accompanying it.

IIRC, the Happy GLR extension seemed to focus on natural language
parsing rather than parsing ambiguous programming languages (Happy is
generally used just to parse programming languages rather than natural
language). The GLR parsing algorithm originally came from Natural
Language Processing but because it handles ambiguity it was adopted by
compiler developers. In practice, industrial strength GLR parsers for
programming languages (e.g. SGLR and the commercial DMS from Semantic
Designs) add a fair amount of kit so they can disambiguate what they
parse and make good parse trees - I don't think Happy's GLR extension
had this.

On 14 June 2012 20:43, Ken Overton <kover...@lab49.com> wrote:
> Thanks; is there a better, more current example that you know of where I 
> might start instead?
>



------------------------------

Message: 7
Date: Fri, 15 Jun 2012 13:53:32 +0800
From: Song Zhang <vxan...@gmail.com>
Subject: [Haskell-beginners] the "download" package fail to install
To: beginners@haskell.org
Message-ID:
        <CACGMEOmVT=-0RvUN2gAiNxQMoXHM0kH55U=0d7-faf8vkh_...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi
There is a package for High-level file download based on URLs called
"download", but failed to build on windows, If you don't know it, you can
refer to hackage first. I compiled in C, but did not get useful massage,
anyone can help me a little to fix that.
cabal install download
get a bad header file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120615/01d53d2d/attachment-0001.htm>

------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 48, Issue 19
*****************************************

Reply via email to