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:  an observation about Haskell vs. Python (Daniel Trstenjak)
   2. Re:  an observation about Haskell vs. Python (Ertugrul S?ylemez)
   3.  combinator (Christopher Howard)
   4. Re:  combinator (Henk-Jan van Tuyl)
   5. Re:  FRP (Heinrich Apfelmus)
   6. Re:  combinator (Brent Yorgey)
   7. Re:  Strange new Haskell Platform (bucephalus org)
   8. Re:  Strange new Haskell Platform (Brent Yorgey)


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

Message: 1
Date: Thu, 20 Sep 2012 12:01:10 +0200
From: Daniel Trstenjak <[email protected]>
Subject: Re: [Haskell-beginners] an observation about Haskell vs.
        Python
To: Dennis Raddle <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID: <20120920100110.GA6688@machine>
Content-Type: text/plain; charset=us-ascii


Hi Dennis,

> Haskell creates compile-time error messages that are somewhat hard to
> understand for beginners.

I don't think that it's possible to have intuitive understandable error
messages for something as complex as a programming language like Haskell.

There even isn't something like intuitive unterstanding, because it's
alwasy based on knowledge and familiarity.

You have to learn the meaning of the error messages or what the possible
reasons for some kind of error might be.

I'm now even able to decode C++ template error messages, which might be
the most horrible error messages on earth ;).


Greetings,
Daniel



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

Message: 2
Date: Thu, 20 Sep 2012 12:12:10 +0200
From: Ertugrul S?ylemez <[email protected]>
Subject: Re: [Haskell-beginners] an observation about Haskell vs.
        Python
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Daniel Trstenjak <[email protected]> wrote:

> I don't think that it's possible to have intuitive understandable
> error messages for something as complex as a programming language like
> Haskell.

It isn't related to complexity, but just to certain type system
features, in particular type classes and rank-n types.  Confusing error
message in the context of the former are the most common ones as
explained in my answer.

The latter can be even more confusing, when the compiler starts
complaining about types that aren't polymorphic enough or even about
"escaping type variables".  But I'd say most people observe those
messages only when they try to use ST in an unsafe way.


Greets,
Ertugrul

-- 
Not to be or to be and (not to be or to be and (not to be or to be and
(not to be or to be and ... that is the list monad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120920/0dee9dc1/attachment-0001.pgp>

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

Message: 3
Date: Thu, 20 Sep 2012 02:59:11 -0800
From: Christopher Howard <[email protected]>
Subject: [Haskell-beginners] combinator
To: Haskell Beginners <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Is there some kind soul who would elaborate somewhat on what exactly a
combinator is, and the significance they have in Haskell programming? Is
there anything special about the way that we use the term in a Haskell
programming context? Are combinators tied into everything we do in
Haskell, or is it more of a special branch of study?

A year or two ago I studied some lambda calculus, and I remember some
interesting (but rather theoretical) little problems involving
properties of certain combinators, and how they behaved when combined
with others. But in some Haskell module documentation, it seems like
everything and anything is referred to as a "combinator", so I'm getting
a bit confused.

-- 
frigidcode.com
indicium.us

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120920/93fed250/attachment-0001.pgp>

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

Message: 4
Date: Thu, 20 Sep 2012 13:24:54 +0200
From: "Henk-Jan van Tuyl" <[email protected]>
Subject: Re: [Haskell-beginners] combinator
To: "Haskell Beginners" <[email protected]>, "Christopher Howard"
        <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
        delsp=yes

On Thu, 20 Sep 2012 12:59:11 +0200, Christopher Howard  
<[email protected]> wrote:

> Is there some kind soul who would elaborate somewhat on what exactly a
> combinator is, and the significance they have in Haskell programming? Is
> there anything special about the way that we use the term in a Haskell
> programming context? Are combinators tied into everything we do in
> Haskell, or is it more of a special branch of study?
>
> A year or two ago I studied some lambda calculus, and I remember some
> interesting (but rather theoretical) little problems involving
> properties of certain combinators, and how they behaved when combined
> with others. But in some Haskell module documentation, it seems like
> everything and anything is referred to as a "combinator", so I'm getting
> a bit confused.
>

There is a short explanation in the HaskellWiki[0]

Regards,
Henk-Jan van Tuyl


[0] http://www.haskell.org/haskellwiki/Combinator


-- 
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--



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

Message: 5
Date: Thu, 20 Sep 2012 14:02:58 +0200
From: Heinrich Apfelmus <[email protected]>
Subject: Re: [Haskell-beginners] FRP
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Ertugrul S?ylemez wrote:
> Wire is also an Alternative, which
> allows concise and efficient switching with very little cruft.  The
> following wire renders "yes" when the "keyDown Space" event happens and
> "no" otherwise:
> 
>     pure "yes" . keyDown Space <|> pure "no"
> 
> Or with the OverloadedStrings extension:
> 
>     "yes" . keyDown Space <|> "no"
> 
> All classic (non-wire) FRP implementations need switching or another
> ad-hoc combinator for this.  If you happen to need switching it's also a
> lot simpler using wires:
> 
>     "please press space" . notE (keyDown Space) --> "thanks"
> 
> This one waits for the Space key and then outputs "thanks" forever.  So
> far Netwire has the fastest and most elegant way of dealing with events
> compared to all other libraries I have tried.

These examples look neat!

I'm a bit confused about the model you are using, though. If I 
understand that correctly, you don't distinguish between events and 
behaviors; rather, you are working with data streams in discrete time 
steps. Still, I don't quite understand. What is

     pure "yes" . keyDown Space <|> pure "no"

supposed to mean? If it's a function  Time -> String , how long does it 
have the  "yes"  value? 439.7 milliseconds? If it's an event, how often 
does the "no" event fire?

Concerning the other example, I don't understand what the expression

    "please press space" . notE (keyDown Space)

means. If it's a function, what value does it have when the key was 
pressed? If it's an event, how often does it "fire" the string value?


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




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

Message: 6
Date: Thu, 20 Sep 2012 08:30:43 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] combinator
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Thu, Sep 20, 2012 at 01:24:54PM +0200, Henk-Jan van Tuyl wrote:
> On Thu, 20 Sep 2012 12:59:11 +0200, Christopher Howard
> <[email protected]> wrote:
> 
> >Is there some kind soul who would elaborate somewhat on what exactly a
> >combinator is, and the significance they have in Haskell programming? Is
> >there anything special about the way that we use the term in a Haskell
> >programming context? Are combinators tied into everything we do in
> >Haskell, or is it more of a special branch of study?
> >
> >A year or two ago I studied some lambda calculus, and I remember some
> >interesting (but rather theoretical) little problems involving
> >properties of certain combinators, and how they behaved when combined
> >with others. But in some Haskell module documentation, it seems like
> >everything and anything is referred to as a "combinator", so I'm getting
> >a bit confused.
> >
> 
> There is a short explanation in the HaskellWiki[0]
> 
> Regards,
> Henk-Jan van Tuyl
> 
> 
> [0] http://www.haskell.org/haskellwiki/Combinator


The reason you are getting confused is quite simple: there are two
distinct meanings of the word "combinator"!  The definition on the
page Henk-Jan referred to above is a technical meaning, which is the
same as what you encountered when studying the lambda calculus.  A
"function with no free variables" is a pure lambda-expression that
refers only to its arguments, like

  \a -> a
  \a -> \b -> a
  \f -> \a -> \b -> f b a

and so on.  If you hear about the study of "combinatory logic", this
is what is being discussed.  We do use such things in Haskell -- the
examples above are id, const, and flip respectively.  Many of the
functions involved in the Applicative instance for ((->) e) also fall
into this category.  But such examples are fairly limited.

However, when you read about "combinators" in module documentation,
99% of the time the word is being used with a different
meaning. There, it is a more informal sense referring to a style of
organizing libraries, centered around the idea of combining things.
Usually there is some type T, some functions for constructing
"primitive" values of type T, and some "combinators" which can
*combine* values of type T in various ways to build up more complex
values of type T.  For example, my diagrams library (see
e.g. http://hackage.haskell.org/package/diagrams%2Dlib) is organized
in this way: there are various ways to construct "primitive" diagrams
(e.g. 'square', 'circle', etc.)  and then a large collection of
combinators for combining diagrams into more complex diagrams
(e.g. putting them on top of each other, next to each other, in a row,
etc.).

Hope this helps clear things up.  And I guess I really ought to update
that wiki page.

-Brent



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

Message: 7
Date: Thu, 20 Sep 2012 15:29:36 +0200
From: bucephalus org <[email protected]>
Subject: Re: [Haskell-beginners] Strange new Haskell Platform
To: Corentin Dupont <[email protected]>
Cc: [email protected]
Message-ID:
        <caj6-dtqo51id+xomq+eg8dz9kfrsrwectquaaggkow9gcvo...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Dear Corentin, Dear Chaddai, Dear Lorenzo,

Thank you for your replies, they explain everything I didn't understand.

Only, I cannot find the new equivalent for the old
  System.system
function, which doesn't appear anymore? At least not in
http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-index-S.htm?

Actually, I always use it in a little helper file I apply in all my Haskell
projects. For example, if a project has modules M1.hs and M2.hs, this
helper file is
     -- helper.hs
     import System
     import M1
     import M2
     myhaddock = System.system "haddock -h M1.hs M2.hs"
so that I can start each session simply with
    $ ghci
    Prelude> :l helper.hs
and I can generate the docs M1.html and M2.html for my project simply with
    Main> myhaddock

I could probably do all this with some built-in tools. For example there is
  Distribution.Simple.Haddock.haddock :: PackageDescription ->
LocalBuildInfo -> [PPSuffixHandler] -> IO ()
but all this might be well programmed, but is so poorly documented, that I
am not able figure that out.

A while ago I did an intensive study on this whole Cabal, and at that stage
I became really frustrated with Haskell. I had spent a lot of time in
realizing two nice projects, but I was not able to cabalize and publish
them. Since then, I am just waiting and hoping for a thorough introduction
(beyond the overwhelming Cabal manual) that explains all that to mere
mortals.

Anyway, thank you very much again.
Regards, Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20120920/8dda80ce/attachment-0001.htm>

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

Message: 8
Date: Thu, 20 Sep 2012 09:35:07 -0400
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Strange new Haskell Platform
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Thu, Sep 20, 2012 at 03:29:36PM +0200, bucephalus org wrote:
> Dear Corentin, Dear Chaddai, Dear Lorenzo,
> 
> Thank you for your replies, they explain everything I didn't understand.
> 
> Only, I cannot find the new equivalent for the old
>   System.system
> function, which doesn't appear anymore? At least not in
>
http://www.haskell.org/ghc/docs/7.4-latest/html/libraries/base-4.5.1.0/doc-index-S.htm?

Searching with Hoogle (haskell.org/hoogle) finds it immediately:

  http://www.haskell.org/hoogle/?q=system

It now lives in System.Process, and is also re-exported by System.Cmd
(the latter should be preferred if you only want to use the 'system'
function and do not need any of the more complex interface provided by
System.Process).

-Brent



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

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


End of Beginners Digest, Vol 51, Issue 32
*****************************************

Reply via email to