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.  Are these statements about Haskell correct? (Costello, Roger L.)
   2. Re:  problem installing checkers (Britt Anderson)
   3. Re:  Are these statements about Haskell correct? (Tom Murphy)
   4.  Generating Code To Embed in an Event Loop (Darrin Thompson)
   5. Re:  Are these statements about Haskell correct? (Brent Yorgey)
   6. Re:  problem installing checkers (Kyle Murphy)
   7.  When to use ST (Alex Rozenshteyn)


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

Message: 1
Date: Tue, 25 Oct 2011 11:58:37 +0000
From: "Costello, Roger L." <coste...@mitre.org>
Subject: [Haskell-beginners] Are these statements about Haskell
        correct?
To: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <b5fee00b53cf054aa8439027e8fe1775017...@imcmbx04.mitre.org>
Content-Type: text/plain; charset="us-ascii"

Hi Folks,

Are these statements accurate:

1. The Haskell language is a layer of abstraction on top of Lambda Calculus.

2. Haskell programs may be expressed entirely using Lambda expressions.

3. The non-Lambda stuff in Haskell is syntactic sugar to make Haskell programs 
easier to write.

4. The field of Lambda Calculus is formal and rich and enables powerful 
properties of Lambda expressions to be proven.

5. A Haskell program may be translated to consist entirely of Lambda 
expressions. Then, Lambda Calculus may be employed to prove powerful properties 
about the program.

/Roger  



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

Message: 2
Date: Tue, 25 Oct 2011 13:15:29 +0000 (UTC)
From: Britt Anderson <britt.uwater...@gmail.com>
Subject: Re: [Haskell-beginners] problem installing checkers
To: beginners@haskell.org
Message-ID: <loom.20111025t150812-...@post.gmane.org>
Content-Type: text/plain; charset=us-ascii

Britt Anderson <britt.uwaterloo <at> gmail.com> writes:

As a follow-up, I uninstalled my ghc and rm my /usr/lib/ghc directory and
reinstalled ghc and the haskell platform from archlinux and then used cabal
install --global to try and get reactive and failed at the same point. When
loading haskell-extras which seems to be needing checkers. Same error messages
as before.

I was hoping to avoid arrows, for a while at least, but decided to try
grapefruit-frp anyway, to at least have something to play with, but this also
fails to install because of 

cabal: cannot configure grapefruit-frp-0.0.0.0. It requires base >=3.0 && <4.1
For the dependency on base >=3.0 && <4.1 there are these packages:
base-3.0.3.1, base-3.0.3.2 and base-4.0.0.0. However none of them are
available.
base-3.0.3.1 was excluded because of the top level dependency base -any
base-3.0.3.2 was excluded because of the top level dependency base -any
base-4.0.0.0 was excluded because of the top level dependency base -any


So, my main question at this point relates to which frp should I try to install.
My goal is to begin to experiment/play with frp ideas. I hope that whatever I
begin to use will be around long enough, in some form or another, that I can
make use of it beyond the learning stage. Is there a recommendation for which
frp library a beginner should try both from the standpoint that it will install
and that it is expected to endure?

Thank you,
Britt




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

Message: 3
Date: Tue, 25 Oct 2011 12:26:05 -0400
From: Tom Murphy <amin...@gmail.com>
Subject: Re: [Haskell-beginners] Are these statements about Haskell
        correct?
To: "Costello, Roger L." <coste...@mitre.org>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <cao9q0tub9ivk+-kotiy_6qpccbs9_gq4mrdtcnhuacm1cgr...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

A big chunk of Haskell can be represented with a typed Lambda Calculus, but
it would be very tricky to turn, say, hGetLine into a Lambda expression.

Tom / amindfv


On Tue, Oct 25, 2011 at 7:58 AM, Costello, Roger L. <coste...@mitre.org>wrote:

> Hi Folks,
>
> Are these statements accurate:
>
> 1. The Haskell language is a layer of abstraction on top of Lambda
> Calculus.
>
> 2. Haskell programs may be expressed entirely using Lambda expressions.
>
> 3. The non-Lambda stuff in Haskell is syntactic sugar to make Haskell
> programs easier to write.
>
> 4. The field of Lambda Calculus is formal and rich and enables powerful
> properties of Lambda expressions to be proven.
>
> 5. A Haskell program may be translated to consist entirely of Lambda
> expressions. Then, Lambda Calculus may be employed to prove powerful
> properties about the program.
>
> /Roger
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20111025/082bd433/attachment-0001.htm>

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

Message: 4
Date: Tue, 25 Oct 2011 12:54:41 -0400
From: Darrin Thompson <darri...@gmail.com>
Subject: [Haskell-beginners] Generating Code To Embed in an Event Loop
To: beginners@haskell.org
Message-ID:
        <CABe4vZVtVu=gsv9jqzes6g21eaeh2o5ne06a9b1_tfcozdo...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I've been thinking about how I could use Haskell for programming just the
"business logic" for games.

So for a mobile game I might use an existing library such as libgdx or
cocos2d for input handling and sprite batching. Where I'd like to use
Haskell is for writing the big function to process the inputs and output a
sprite list and audio triggers.

Why Haskell? In even a simple 2d platformer there's a lot of polish needed
to get the game to feel good to a player. For instance, if I was using box2d
physics to take care of movement and collisions, I might still need to
detect that inputs indicate applying a force vector opposite to the player's
current velocity and the player is "on the floor". A naive game would show
the player moon walking. A more sophisticated game would show a skidding
player sprite or animation until the player's velocity reaches 0.

I was hoping to use Haskell to capture a lot of little details like that
more elegantly than I can in C or Java.

However, my program needs to be compiled for a mobile device.

I'm wary of trying to use GHC to generate arm machine code. I've had bad
luck with cross compilers.

It seemed to me that I could design a GADT to model my game actors and their
relationships. I would then (misused term I'm sure) "lift" my behavior
functions into some context where they can produce Java or C code for use in
Xcode or Eclipse. That's my favored approach.

Is there some background I could look at to save myself some dead ends
pursuing this?

-- 
Darrin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20111025/6abfd60c/attachment-0001.htm>

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

Message: 5
Date: Tue, 25 Oct 2011 13:23:56 -0400
From: Brent Yorgey <byor...@seas.upenn.edu>
Subject: Re: [Haskell-beginners] Are these statements about Haskell
        correct?
To: beginners@haskell.org
Message-ID: <20111025172356.ga7...@seas.upenn.edu>
Content-Type: text/plain; charset=us-ascii

On Tue, Oct 25, 2011 at 11:58:37AM +0000, Costello, Roger L. wrote:
> Hi Folks,
> 
> Are these statements accurate:

I'll give it a shot, hopefully others can chime in with corrections or
alternative points of view.

> 1. The Haskell language is a layer of abstraction on top of Lambda
> Calculus.

There are a great many different lambda calculi.  Haskell (with the
exception of IO) can be seen as a layer of abstraction on top of a
particular lambda calculus variant known as System F-omega [1]
(extended with a fixpoint primitive and various primitive types).  In
particular, System F omega is a typed lambda calculus with explicit
lambdas and applications for *types* (i.e. polymorphism) as well as
allowing type operators (i.e. higher kinds).

[1] http://en.wikipedia.org/wiki/System_F

> 2. Haskell programs may be expressed entirely using Lambda
> expressions.

If you stick to Haskell 98/2010 without IO, this is essentially true.
In fact the Haskell Report specifies what amount to translations from
various Haskell syntax constructs into System F_omega.  Once you add
various extensions like GADTs and type families you need something
beyond F_omega, but it is still based on a variant lambda calculus.

> 3. The non-Lambda stuff in Haskell is syntactic sugar to make
> Haskell programs easier to write.

More or less, yes.  See the answer to #2.

> 4. The field of Lambda Calculus is formal and rich and enables
> powerful properties of Lambda expressions to be proven.

It is true that all sorts of lambda calculi have been studied in great
depth.  The field is indeed formal and rich. Usually, though, the
focus is on proving properties of entire *systems* (e.g. there are no
infinite reductions, they are type-safe, etc.) rather than of
individual expressions.  One interesting counterexample, however, is
the study of *parametricity* (a property of an entire system,
including F-omega) which can also be used to prove things about
individual expressions (e.g. any expression of type forall a. [a] ->
[a] commutes with 'map g' for any function g, that is, it can only
rearrange elements of the list, and it must do so in the same way
every tiem, regardless of the list contents).

> 5. A Haskell program may be translated to consist entirely of Lambda
> expressions. Then, Lambda Calculus may be employed to prove powerful
> properties about the program.

I don't think it's necessary to translate into F_omega before proving
properties of your program.  Actually, I think this would be
counterproductive.  There is already a large body of literature
devoted to proving things about Haskell programs directly.

-Brent



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

Message: 6
Date: Tue, 25 Oct 2011 13:49:43 -0400
From: Kyle Murphy <orc...@gmail.com>
Subject: Re: [Haskell-beginners] problem installing checkers
To: Britt Anderson <britt.uwater...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CA+y6Jcy__xugnjex8t6nxpN8sR2E8_r=6-whlgh2nxtp8hq...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

To avoid the Haskell version of DLL hell, I'd recommend using cabal-dev
rather than cabal --global. Just to clarify cabal-dev is an alternative to
cabal that installs a projects dependencies in its own private library
cache. To use it you do need to create a cabal file  for your project, but
it allows cabal to do a much better job of resolving version conflicts.

-R. Kyle Murphy
Sent from my phone.
On Oct 25, 2011 9:21 AM, "Britt Anderson" <britt.uwater...@gmail.com> wrote:

> Britt Anderson <britt.uwaterloo <at> gmail.com> writes:
>
> As a follow-up, I uninstalled my ghc and rm my /usr/lib/ghc directory and
> reinstalled ghc and the haskell platform from archlinux and then used cabal
> install --global to try and get reactive and failed at the same point. When
> loading haskell-extras which seems to be needing checkers. Same error
> messages
> as before.
>
> I was hoping to avoid arrows, for a while at least, but decided to try
> grapefruit-frp anyway, to at least have something to play with, but this
> also
> fails to install because of
>
> cabal: cannot configure grapefruit-frp-0.0.0.0. It requires base >=3.0 &&
> <4.1
> For the dependency on base >=3.0 && <4.1 there are these packages:
> base-3.0.3.1, base-3.0.3.2 and base-4.0.0.0. However none of them are
> available.
> base-3.0.3.1 was excluded because of the top level dependency base -any
> base-3.0.3.2 was excluded because of the top level dependency base -any
> base-4.0.0.0 was excluded because of the top level dependency base -any
>
>
> So, my main question at this point relates to which frp should I try to
> install.
> My goal is to begin to experiment/play with frp ideas. I hope that whatever
> I
> begin to use will be around long enough, in some form or another, that I
> can
> make use of it beyond the learning stage. Is there a recommendation for
> which
> frp library a beginner should try both from the standpoint that it will
> install
> and that it is expected to endure?
>
> Thank you,
> Britt
>
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20111025/dc277c96/attachment-0001.htm>

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

Message: 7
Date: Tue, 25 Oct 2011 14:45:51 -0400
From: Alex Rozenshteyn <rpglove...@gmail.com>
Subject: [Haskell-beginners] When to use ST
To: Haskell Beginners <beginners@haskell.org>
Message-ID:
        <CALm==BWCFJOROW5CVnN=DLeG1-jeLh=nrrzo1zop_jodn98...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Does anyone have any guidelines on when to use ST in an algorithm vs looking
for a non-monadic, pure solution?

The reason I ask is that I have just implemented an Earley parser for class
(in Python) and would like to re-implement it in Haskell. The algorithm
makes heavy use of mutable state, some of which can clearly be refactored
out, but some of which can't be done so clearly.

Thanks.
-- 
          Alex R
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20111025/c9d38dab/attachment.htm>

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

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


End of Beginners Digest, Vol 40, Issue 39
*****************************************

Reply via email to