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.  Re: suggested course of action (prad)
   2.  howto reason infinite lists (prad)
   3.  XML (Michael Mossey)
   4. Re:  XML (Thomas Davie)
   5. Re:  howto reason infinite lists (Chadda? Fouch?)
   6. Re:  howto reason infinite lists (Brandon S Allbery KF8NH)
   7. Re:  XML (Wilson MacGyver)
   8. Re:  XML (Stephen Tetley)
   9. Re:  XML (Michael Mossey)
  10.  for those who wondered where I was... (Michael Mossey)


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

Message: 1
Date: Mon, 21 Jun 2010 10:53:06 -0700
From: prad <p...@towardsfreedom.com>
Subject: [Haskell-beginners] Re: suggested course of action
To: beginners@haskell.org
Message-ID: <20100621105306.0ff75...@gom>
Content-Type: text/plain; charset=US-ASCII

On Mon, 21 Jun 2010 16:57:12 +0900
dekudekup...@yahoo.com (Benjamin L. Russell) wrote:

>   Rosetta Code
>   A programming chrestomathy site
>   http://rosettacode.org/wiki/Main_Page
>
this is a fantasting site, benjamin!
it is surprisingly comprehensive and the ability to look at different
language solutions for the same problem is most instructive.

thanks also for the link to the irc - something i haven't looked at
before. now to find an irc client!

from what you have written i imagine the more advanced people hang out
on haskell-cafe, though i have to say i'm surprised at the high level
of questions (and answers) are right here in the beginners group! i was
planning to just stay here for now till getting more confidence and
competence, but may take your advice.

-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's




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

Message: 2
Date: Mon, 21 Jun 2010 11:58:11 -0700
From: prad <p...@towardsfreedom.com>
Subject: [Haskell-beginners] howto reason infinite lists
To: haskellbeginners <beginners@haskell.org>
Message-ID: <20100621115811.4a072...@gom>
Content-Type: text/plain; charset=US-ASCII

i'm trying to figure out how to think out the circular definition for
an infinite list and would appreciate suggestions.

consider
ones = 1 : ones
this essentially says 1 : (1 : (1 : (1 : ones))) with ones being given
by the original def.

however, i had trouble with this one
fib = 1 : 1 : [ a+b | (a,b) <- zip fib (tail fib) ]

initially, i tried building it element by element and got stuck when i
thought of what was
fib
tail fib
and what was being zipped

so i thought it out differently by assuming the infinite list was
already created in the following fashion.

fib is      [1,1,a,b,c,d,e, ..]
tail fib is [1,a,b,c,d,e,f, ..]

to find a, we zip fib and tail fib getting (1,1) and add getting 2:

fib is      [1,1,2,b,c,d,e, ..]
tail fib is [1,2,b,c,d,e,f, ..]

get b from the next zip (1,2) and add giving 3:

fib is      [1,1,2,3,c,d,e, ..]
tail fib is [1,2,3,c,d,e,f, ..]

c comes from (2,3) which adds to 5:

fib is      [1,1,2,3,5,d,e, ..]
tail fib is [1,2,3,5,d,e,f, ..]


this way of thinking about it makes sense to me, but i'd be curious to
know if it is proper thinking.

it seems to me that if we consider the list to be already built, we can
apply zip successively to get the next part of it, but if we think
recursively we start at the beginning at each recursive level and go
nowhere.


-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's


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

Message: 3
Date: Mon, 21 Jun 2010 14:14:11 -0700
From: Michael Mossey <m...@alumni.caltech.edu>
Subject: [Haskell-beginners] XML
To: haskellbeginners <beginners@haskell.org>
Message-ID: <4c1fd623.9040...@alumni.caltech.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

What's the easiest way for a beginner such as myself to parse XML data, 
specifically MusicXML files? I want to load a partial representation of 
  a MusicXML file into Haskell datatypes and manipulate it. I don't need 
to validate the file, and I can make some safe assumptions about the 
content, so this is really a pretty simple task.

Thanks,
Mike


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

Message: 4
Date: Mon, 21 Jun 2010 22:29:19 +0100
From: Thomas Davie <tom.da...@gmail.com>
Subject: Re: [Haskell-beginners] XML
To: Michael Mossey <m...@alumni.caltech.edu>
Cc: haskellbeginners <beginners@haskell.org>
Message-ID: <ac6c5fe7-4066-4435-b17f-e79d96725...@gmail.com>
Content-Type: text/plain; charset=us-ascii


On 21 Jun 2010, at 22:14, Michael Mossey wrote:

> What's the easiest way for a beginner such as myself to parse XML data, 
> specifically MusicXML files? I want to load a partial representation of  a 
> MusicXML file into Haskell datatypes and manipulate it. I don't need to 
> validate the file, and I can make some safe assumptions about the content, so 
> this is really a pretty simple task.

You probably want to grab HaXml and get on with it :)

Thanks

Bob

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

Message: 5
Date: Mon, 21 Jun 2010 23:43:13 +0200
From: Chadda? Fouch? <chaddai.fou...@gmail.com>
Subject: Re: [Haskell-beginners] howto reason infinite lists
To: prad <p...@towardsfreedom.com>
Cc: haskellbeginners <beginners@haskell.org>
Message-ID:
        <aanlktilzhfun8uvdkqbx8q3kvlmg1gzfu101dr-vf...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Mon, Jun 21, 2010 at 8:58 PM, prad <p...@towardsfreedom.com> wrote:
> it seems to me that if we consider the list to be already built, we can
> apply zip successively to get the next part of it, but if we think
> recursively we start at the beginning at each recursive level and go
> nowhere.

That's a funny way to say it : to me recursive thinking has always
been about assuming I already have a function that works on smaller
(in some sense) cases, writing the function knowing that and then
figuring what's the base case we're tending toward and handling it
non-recursively. That's what recursion is about for me and I've always
found easier to think about it like that rather than always expansing
the recursive calls (I also find it easier than thinking iteratively
nowadays but YMMV).

In other words what you describe as your new method to think about
infinite structure is the only way I approach recursion (of structure
or functions). I would say it's a perfectly valid approach as long as
you don't forget to handle the base case (here it's the explicit
definition of the first two elements).
-- 
Jedaï


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

Message: 6
Date: Mon, 21 Jun 2010 17:46:34 -0400
From: Brandon S Allbery KF8NH <allb...@ece.cmu.edu>
Subject: Re: [Haskell-beginners] howto reason infinite lists
To: beginners@haskell.org
Message-ID: <4c1fddba.6080...@ece.cmu.edu>
Content-Type: text/plain; charset=UTF-8

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 6/21/10 17:43 , Chaddaï Fouché wrote:
> On Mon, Jun 21, 2010 at 8:58 PM, prad <p...@towardsfreedom.com> wrote:
>> it seems to me that if we consider the list to be already built, we can
>> apply zip successively to get the next part of it, but if we think
>> recursively we start at the beginning at each recursive level and go
>> nowhere.
> 
> That's a funny way to say it : to me recursive thinking has always
> been about assuming I already have a function that works on smaller
> (in some sense) cases, writing the function knowing that and then
> figuring what's the base case we're tending toward and handling it
> non-recursively. That's what recursion is about for me and I've always
> found easier to think about it like that rather than always expansing
> the recursive calls (I also find it easier than thinking iteratively
> nowadays but YMMV).

I think of it a bit like proofs:  prove the base case, prove the inductive
case, therefore the proof applies to all cases (which is equivalent to being
infinite).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwf3boACgkQIn7hlCsL25UI9ACeM7OBLjSZnUuzHmfC0ZKge4ti
n2UAoLn09TYwvUAvSTCOeJHMAQZa/3FI
=rDt7
-----END PGP SIGNATURE-----


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

Message: 7
Date: Mon, 21 Jun 2010 17:46:47 -0400
From: Wilson MacGyver <wmacgy...@gmail.com>
Subject: Re: [Haskell-beginners] XML
To: Michael Mossey <m...@alumni.caltech.edu>
Cc: haskellbeginners <beginners@haskell.org>
Message-ID:
        <aanlktinydp19dkocnmk7gdankczrwvocdh8t9tfq4...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I'd suggest HaXML. and here is the ch from Real World Haskell that
talks about HaXML

http://book.realworldhaskell.org/read/extended-example-web-client-programming.html

On Mon, Jun 21, 2010 at 5:14 PM, Michael Mossey <m...@alumni.caltech.edu> wrote:
> What's the easiest way for a beginner such as myself to parse XML data,
> specifically MusicXML files? I want to load a partial representation of  a
> MusicXML file into Haskell datatypes and manipulate it. I don't need to
> validate the file, and I can make some safe assumptions about the content,
> so this is really a pretty simple task.
>
> Thanks,
> Mike
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



-- 
Omnem crede diem tibi diluxisse supremum.


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

Message: 8
Date: Mon, 21 Jun 2010 22:48:59 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] XML
Cc: haskellbeginners <beginners@haskell.org>
Message-ID:
        <aanlktik1-ppj5cvy1jbxeyutitpkdcc4bkkyqbygo...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

There is a package for this on Hackage:

http://hackage.haskell.org/package/musicxml


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

Message: 9
Date: Mon, 21 Jun 2010 18:48:07 -0700
From: Michael Mossey <m...@alumni.caltech.edu>
Subject: Re: [Haskell-beginners] XML
To: Stephen Tetley <stephen.tet...@gmail.com>
Cc: haskellbeginners <beginners@haskell.org>
Message-ID: <4c201657.1030...@alumni.caltech.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


If I can get the musicxml package to work, this is no doubt the best 
choice for me. I am running Haskell Platform 2010.1.0.0 on Windows XM. I 
just installed musicxml and it finished, but I got a vast number of 
warnings. I hope it's okay. Stuff about shadowing bindings, deprecated 
Prelude module, and much else.

I will now see if I can get musicxml to run.

Mike


Stephen Tetley wrote:
> There is a package for this on Hackage:
> 
> http://hackage.haskell.org/package/musicxml
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners


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

Message: 10
Date: Tue, 22 Jun 2010 04:03:55 -0700
From: Michael Mossey <m...@alumni.caltech.edu>
Subject: [Haskell-beginners] for those who wondered where I was...
To: haskellbeginners <beginners@haskell.org>
Message-ID: <4c20989b.5040...@alumni.caltech.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

I started to learn Haskell last year when I wanted a better language to 
implement a computer-assisted music composition system. As GUI-heavy, it 
proved too much of a challenge... learning a new paradigm (functional 
programming), trying to deal with GUI libraries and their documentation 
shortcomings, and dealing with my actual problem on top of that proved 
too much.

I went back to Python.

However, after a time I reassessed my reason for writing any of this 
code in the first place. I realized it made more sense to put my 
available time into ear-training in order to make the meat computer 
between my ears into a better composition system, rather than 
programming one.

In the meantime, some smaller programming tasks came up (non-gui) and I 
started on them a few weeks ago, writing in Python. This involves 
translating a MusicXML document into a midi file, applying some custom 
algorithms I've written to provide greater expressive qualities.

The first Python challenge was to parse the document. I am not aware of 
a MusicXML-specific Python module, so I used their more general XML code.

It took me a few weeks to get a basic input system working. I.e. 
MusicXML documents translated into my own representation, and reasonable 
error checking.

Then I thought, what the heck am I doing? This is a good task for 
Haskell! It was only the GUI challenge that turned me off to Haskell 
last year, but this program is smaller and is purely file-in file-out.

Working with Haskell tonight, in about four hours I replicated several 
weeks of Python work. Yup, this is the right approach.

Mike



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

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


End of Beginners Digest, Vol 24, Issue 26
*****************************************

Reply via email to