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:  iterateM (Lukas Braun)
   2.  Recursive XML schema and feeding into data model (ashwin sathya)


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

Message: 1
Date: Tue, 18 Jun 2013 20:51:01 +0200
From: Lukas Braun <[email protected]>
Subject: Re: [Haskell-beginners] iterateM
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

`iterateM_` is in the monad-loops package[1].
Like you suggested, this version returns `m b` and doesn't build up any
list at all.

You can search for functions by name and even type signature on
Hackage[2] or Hayoo[3].

On a different note, for code such as your `iterateM` you should use
do-notation instead of manually writing out the lambdas. It's much
easier on the eyes and this is what do-notation is there for.

[1] 
http://hackage.haskell.org/packages/archive/monad-loops/latest/doc/html/Control-Monad-Loops.html#v:iterateM_
[2] http://www.haskell.org/hoogle/
[3] http://holumbus.fh-wedel.de/hayoo/hayoo.html



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

Message: 2
Date: Wed, 19 Jun 2013 12:36:39 +0530
From: ashwin sathya <[email protected]>
Subject: [Haskell-beginners] Recursive XML schema and feeding into
        data model
To: [email protected]
Message-ID:
        <cajivo_hkvlb7dow7frr3wmvx4oovg0a_jgpzqt1q0ducjdu...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

I have a recursive schema whose data model looks like the following

{-data InformationField = InformationField { name, value :: String }-}
        {-deriving (Show, Eq) -}

{-data Fields = Fields { fields :: [InformationField] }-}
        {-deriving (Show, Eq)-}

{-data Children = Children { childNodes :: [BuildInformationNode] }-}

{-data BuildInformationNode = BuildInformationNode { field :: Fields,
children :: Children }-}


BuildInformationNode has children which has multiple BuildInformationNode.

I am getting started on HXT, using the samples that they had provided i was
able to pull up individual nodes from xml.

I am having difficult in starting to read the entire xml into the data
model and have one single BuildInformationNode created which represents the
entire xml.

The idea is to implement a show on BuildInformationNode wherein i can
implement for displaying the  tree in a format that i require.

Any pointers regarding this would be great.

-- 
Thanks & Regards,
R Ashwin Sathya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130619/d8a38d40/attachment-0001.htm>

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

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 60, Issue 30
*****************************************

Reply via email to