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. Reactive Banana Data Structures Sanity Check (Michael Litchard)
2. Playing and combining audio files (Tobias)
3. Re: sometimes Haskell isn't what you want (Darren Grant)
4. Re: sometimes Haskell isn't what you want (Mike Meyer)
5. Re: sometimes Haskell isn't what you want (Darren Grant)
6. Re: sometimes Haskell isn't what you want (Jay Sulzberger)
7. Re: sometimes Haskell isn't what you want (Michael Carpenter)
8. Re: Playing and combining audio files (Tom Murphy)
----------------------------------------------------------------------
Message: 1
Date: Tue, 11 Sep 2012 11:38:17 -0700
From: Michael Litchard <[email protected]>
Subject: [Haskell-beginners] Reactive Banana Data Structures Sanity
Check
To: [email protected]
Message-ID:
<caezekyp4gbaboysbu0eefbmqnv_3ywh3lxnsxd9hpfd2gve...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I'm making an implementation of Grand Theft Wumpus using
reactive-banana. I'm using the slot machine example to work from.
For now, I'm just building a simple graph where a Player can move from
Node to Node. I'm not sure I have the Data Structures right, so I
wanted to run it by the community. I'm conceptualizing each Node (a
Street) and the Player as a Behavior. I reason that since the Graph
won't change, just the values inside a Node, I can update any Node as
needed, instead of creating a new Graph whenever a value in a Node
changes. It seems though, as I scale up, I'd end up with a big union
of Behaviors. Does it make sense to describe each Node as a Behavior?
Even though I'm starting simply, I intend to write a complete
implementiation.
http://nostarch.com/download/Lisp08.pdf
data StreetName = Baker
| Main
| Atlantic
| Baltic
| Connecticut
deriving (Enum,Bounded,Show)
type Player t = Behavior t Player_
type Street t = Behavior t Street_
data Player_ = Player {location :: StreetName } deriving Show
data Street_ = Street_ {sName :: StreetName
,player :: Maybe Player_
} deriving Show
data GameEvent = MovePlayer Street
| Look
does that look okay so far?
------------------------------
Message: 2
Date: Tue, 11 Sep 2012 21:12:45 +0200
From: Tobias <[email protected]>
Subject: [Haskell-beginners] Playing and combining audio files
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hello,
I'm searching for a library with which I can process audio files (.wav
or .mp3). All I need is functions with which I can
- play audio files
- concat several audio files to one audio file
Can you suggest a library for this task? I looked through
http://hackage.haskell.org/packages/archive/pkg-list.html#cat:sound but
I didn't manage to find ways to do this respectively sample code for this.
Any hints are welcome- thanks,
Tobias
------------------------------
Message: 3
Date: Tue, 11 Sep 2012 13:21:11 -0700
From: Darren Grant <[email protected]>
Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want
To: Anindya Mozumdar <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID:
<ca+jd6sghtef4ypzq0cunkqyuh8_h--z63cgz-0gndx5ebp1...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Just adding another perspective: I developed the AI for a complex
turn-based strategy game in C++. By the end of the process I found
that I was not only continually repeating myself due to the language
syntax because I needed a *lot* of specialized list manipulations, but
I was also effectively composing pure functions.
This made me think that it could be much more effective to develop AI
in a functional language. There's no way I could do this with Haskell
presently as I am still struggling to approach all problems from the
FP perspective first, but I do think there is the potential.
Cheers,
Darren
On Tue, Sep 11, 2012 at 6:34 AM, Anindya Mozumdar
<[email protected]> wrote:
>> I went back to it
>> for one day (yesterday) and that was enough to make me realize how
>> unpleasant its inconsistencies, inconsistent documentation, awkwardnesses,
>> etc.
>
>> Haskell is a gift and I'm not throwing it away.
>
> Luckily this is a small list, otherwise a flame war would have started by now.
>
> Personally, I learnt the basics of Haskell in the year 2000 in
> college. I am re-learning it again, and it's an absolute delight. I am
> not a programmer by profession - and this is the only language which
> *makes* me want to learn it as I am generally interested in math and
> bit of CS theory. It's also interesting to note that Haskell is being
> used in finance, and maybe I will get to use it professionally one
> day.
>
> Regards,
> Anindya
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 4
Date: Tue, 11 Sep 2012 15:53:44 -0500
From: Mike Meyer <[email protected]>
Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want
To: Darren Grant <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID:
<CAD=7U2B9Y6tJK1DNwWQKkUn3dzKxaPjp=gut3sjgqbezm5h...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Tue, Sep 11, 2012 at 3:21 PM, Darren Grant <[email protected]> wrote:
> Just adding another perspective: I developed the AI for a complex
> turn-based strategy game in C++. By the end of the process I found
> that I was not only continually repeating myself due to the language
> syntax because I needed a *lot* of specialized list manipulations, but
> I was also effectively composing pure functions.
>
> This made me think that it could be much more effective to develop AI
> in a functional language. There's no way I could do this with Haskell
> presently as I am still struggling to approach all problems from the
> FP perspective first, but I do think there is the potential.
This reminds me of a paper on one of the early Go-playing programs -
or more exactly, lessons learned from it. One of those was
(paraphrased): "Don't maintain state. It's easier to recompute values
from the board than correctly update the state information after a
move." Every time I see a program going through grotesque gyrations to
try and keep track of state I'm reminded of this.
> On Tue, Sep 11, 2012 at 6:34 AM, Anindya Mozumdar
> <[email protected]> wrote:
>>> I went back to it
>>> for one day (yesterday) and that was enough to make me realize how
>>> unpleasant its inconsistencies, inconsistent documentation, awkwardnesses,
>>> etc.
>> Luckily this is a small list, otherwise a flame war would have started by
>> now.
Yup. My experience with Python is almost the exact opposite of his. I
suspect that's because 1) I work with the libraries that ship with the
language unless I need something they just don't have, in part
*because* the documentation is almost always pretty good, whereas you
never know what you'll get going to third party libraries. And 2)
realizing that the goal of the languages are different: Python is
designed to make it easy to write clear, readable code using whatever
style is best for the problem at hand. So whether some bit of
functionality winds up being expressed in functional, OO or imperative
styles will depend on which is likely to be more readable in actual
use. Trying to write Python in a single fixed style is going to be as
painful as trying to write functional style code in Java, or OO style
code in Haskell.
<mike
------------------------------
Message: 5
Date: Tue, 11 Sep 2012 15:39:57 -0700
From: Darren Grant <[email protected]>
Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want
To: Mike Meyer <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID:
<CA+jD6Sj=CD5TJQHkT_pPm8DPs65HJFELdWhxStP+j12-gUfk=a...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
On Tue, Sep 11, 2012 at 1:53 PM, Mike Meyer <[email protected]> wrote:
> On Tue, Sep 11, 2012 at 3:21 PM, Darren Grant <[email protected]> wrote:
>> This made me think that it could be much more effective to develop AI
>> in a functional language. There's no way I could do this with Haskell
>> presently as I am still struggling to approach all problems from the
>> FP perspective first, but I do think there is the potential.
>
> This reminds me of a paper on one of the early Go-playing programs -
> or more exactly, lessons learned from it. One of those was
> (paraphrased): "Don't maintain state. It's easier to recompute values
> from the board than correctly update the state information after a
> move." Every time I see a program going through grotesque gyrations to
> try and keep track of state I'm reminded of this.
Yea, and when the rules for the game change frequently, it is vital to
maintain composition.
Cheers,
Darren
------------------------------
Message: 6
Date: Tue, 11 Sep 2012 18:40:21 -0400 (EDT)
From: Jay Sulzberger <[email protected]>
Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Tue, 11 Sep 2012, Darren Grant <[email protected]> wrote:
> Just adding another perspective: I developed the AI for a complex
> turn-based strategy game in C++. By the end of the process I found
> that I was not only continually repeating myself due to the language
> syntax because I needed a *lot* of specialized list manipulations, but
> I was also effectively composing pure functions.
>
> This made me think that it could be much more effective to develop AI
> in a functional language. There's no way I could do this with Haskell
> presently as I am still struggling to approach all problems from the
> FP perspective first, but I do think there is the potential.
>
>
> Cheers,
> Darren
I know of no decent taxonomy of programs. For example the Linux
kernel runs, at least on my machines, for the great majority of
my loads, for literally years without trouble. Most of the time,
my standard stack of Emacs, quack, and Aubrey Jaffer's SCM, works
just fine, though occasionally the repl-Emacs connection fails to
behave properly. Usually one of a small standard set of repair
tricks works to restore the repl. The famous "Unix pipeline of
filters" is an example of part of the stuff that Functional
Programming advocates advertise. And spreadsheets are an example
of another one of the advertised advantages.
Now these four things, the Linux kernel, the Emacs-SCM short
stack, a Unix one liner, and a spreadsheet system, are all
programs. They differ in presentation and in use and in
implementation.
Here is a missing book (I am aware of the just attack that this is too easy.):
A Taxonomy of Computer Programs
which would have at least one chapter for each of the the four
kinds of programs.
oo--JS.
>
>
>
> On Tue, Sep 11, 2012 at 6:34 AM, Anindya Mozumdar
> <[email protected]> wrote:
>>> I went back to it
>>> for one day (yesterday) and that was enough to make me realize how
>>> unpleasant its inconsistencies, inconsistent documentation, awkwardnesses,
>>> etc.
>>
>>> Haskell is a gift and I'm not throwing it away.
>>
>> Luckily this is a small list, otherwise a flame war would have started by
>> now.
>>
>> Personally, I learnt the basics of Haskell in the year 2000 in
>> college. I am re-learning it again, and it's an absolute delight. I am
>> not a programmer by profession - and this is the only language which
>> *makes* me want to learn it as I am generally interested in math and
>> bit of CS theory. It's also interesting to note that Haskell is being
>> used in finance, and maybe I will get to use it professionally one
>> day.
>>
>> Regards,
>> Anindya
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
------------------------------
Message: 7
Date: Tue, 11 Sep 2012 21:03:02 -0400
From: Michael Carpenter <[email protected]>
Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 09/11/2012 08:16 AM, Dennis Raddle wrote:
> I went briefly to Python but guess what? I I U-turned right back to
> Haskell. Because there is nothing like the consistent documentation
> and well-thought-out libraries of Haskell. There is nothing else like
> the help from #haskell or this list.
^This, right here, is one of the strongest things Haskell has going for
it. I'm learning Haskell too and I love how active the community is, how
helpful the documentation is, and how robust the technologies coming out
of it generally are. I don't know why I haven't experienced this with
another language before, but you search "haskell" in the search engine,
immediately click on the Haskell Wiki, and enter a pretty website filled
with everything Haskell related. The two books that you can learn
Haskell from are free online, the #haskell channel chats long into the
night long after all my other channels have dissipated, the subreddit
and stackexchange get used, and the mailing lists are very informative
and helpful. Not to mention the language itself is amazingly versatile,
expressive, and robust. Then there is the fact that GHC manages to
compile this awesomeness into something that's actually fast AND there
is GHCi in case you want it. I'm sure there are things that Haskell
simply isn't made to do, but that's like criticizing duct tape because
it's not a duck.
On 09/11/2012 04:21 PM, Darren Grant wrote:
> This made me think that it could be much more effective to develop AI
> in a functional language. There's no way I could do this with Haskell
> presently as I am still struggling to approach all problems from the
> FP perspective first, but I do think there is the potential.
There is a lot of potential here in my opinion. The two language
families that have built their reputations through their use in AI
research, Lisp and Prolog, share a lot in common with Haskell. AI, along
with a lot of the big problems out there, seem to always boil down to
parallel relationships between sets of data in a model rather than
sequential object-oriented recipes. I would not be surprised if
functional languages like Haskell supersede many of the imperative
languages because of these problem sets. Sometimes I think I'm stupid to
say that, but then I remember what SQL and RDBMS's did for the database
world.
- Michael
------------------------------
Message: 8
Date: Tue, 11 Sep 2012 21:17:21 -0400
From: Tom Murphy <[email protected]>
Subject: Re: [Haskell-beginners] Playing and combining audio files
To: Tobias <[email protected]>
Cc: [email protected]
Message-ID:
<CAO9Q0tUyT_aEFQeNhrwVze1V+oMFK7YBmRY_9=uuok8i9yy...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hsc3 might be more than you're looking for, but it does play audio files
and it does it elegantly. Maybe not the right tool for the task, though.
Tom
On Sep 11, 2012 3:17 PM, "Tobias" <[email protected]> wrote:
> Hello,
>
> I'm searching for a library with which I can process audio files (.wav or
> .mp3). All I need is functions with which I can
> - play audio files
> - concat several audio files to one audio file
>
> Can you suggest a library for this task? I looked through
> http://hackage.haskell.org/**packages/archive/pkg-list.**html#cat:sound<http://hackage.haskell.org/packages/archive/pkg-list.html#cat:sound>but
> I didn't manage to find ways to do this respectively sample code for
> this.
>
> Any hints are welcome- thanks,
> Tobias
>
> ______________________________**_________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/**mailman/listinfo/beginners<http://www.haskell.org/mailman/listinfo/beginners>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120911/c95ae244/attachment.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 51, Issue 17
*****************************************