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:  Re: Enforcing Monad Laws (Jorden M)
   2. Re:  Re: Enforcing Monad Laws (Jorden M)
   3.  Is haskell a good choice for someone,    who never programmed
      before? (edgar klerks)
   4. Re:  Is haskell a good choice for someone, who    never
      programmed before? (Jorden M)
   5. Re:  Is haskell a good choice for someone, who    never
      programmed before? (edgar klerks)
   6. Re:  Is haskell a good choice for someone,        who never
      programmed before? (Daniel Fischer)


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

Message: 1
Date: Fri, 2 Jul 2010 15:40:16 -0400
From: Jorden M <jrm8...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Enforcing Monad Laws
To: Brandon S Allbery KF8NH <allb...@ece.cmu.edu>
Cc: beginners@haskell.org
Message-ID:
        <aanlktinrykslkpol-c8h_ddijaicl_mvtcsw6kbt7...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Jul 2, 2010 at 11:12 AM, Brandon S Allbery KF8NH
<allb...@ece.cmu.edu> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 7/2/10 04:04 , Heinrich Apfelmus wrote:
>> Jorden M wrote:
>>> C++ `Concepts', which almost made it into the C++0x standard, are
>>> roughly similar to Haskell type classes. The proposal for concepts in
>>> C++ had a feature called axioms, which allow the programmer to specify
>>> semantics on the functions the concept contains. This allows for
>>> enforcing things such as the Monad Laws, as well as letting the
>>> compiler make certain optimizations it may not have been able to make
>>> without axiomatic guarantees.
>>
>> I have a hard time imagining that axioms are being used to prove properties
>> about programs in a language such as C++... :) Any pointers?
>
> I just took a look at it, and Concepts look to me like Haskell
> contexts/constraints; an example is:
>
>> concept LessThanComparable<typename T> {
>>   bool operator<(const T& x, const T& y);
>> }
>>
>> template<typename T>
>> requires LessThanComparable<T>
>> const T& min(const T& x, const T& y) {
>>   return x < y? x : y;
>> }
>
> which is obviously just an Ord costraint on min().
>
> (My initial thought before looking at this was that it was programming by
> contract, or possibly just making invariants explicit; the latter wouldn't
> actually prove anything, though.)

requires statements are like contexts. concepts are like type classes.
concept_maps are like instances.

The particular feature I'm talking about are axioms, which go inside
concepts, and allow the programmer to express certain semantic
behavior, such as commutativity. Currently, such things are left to
the `honest' programmer in Haskell.

>
> - --
> brandon s. allbery     [linux,solaris,freebsd,perl]      allb...@kf8nh.com
> system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
> electrical and computer engineering, carnegie mellon university      KF8NH
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.10 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkwuAfYACgkQIn7hlCsL25URBQCeOsh3m3jfmifLeG8kzLC6Df74
> PU4AoJwho/HN9IClcBw6RTN6kzVxRvX1
> =B0SX
> -----END PGP SIGNATURE-----
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


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

Message: 2
Date: Fri, 2 Jul 2010 15:44:25 -0400
From: Jorden M <jrm8...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Enforcing Monad Laws
To: Heinrich Apfelmus <apfel...@quantentunnel.de>
Cc: beginners@haskell.org
Message-ID:
        <aanlktikdqxflwnwz-l6vgtrlnqk50krtw78osvx1d...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Jul 2, 2010 at 4:04 AM, Heinrich Apfelmus
<apfel...@quantentunnel.de> wrote:
> Jorden M wrote:
>>
>> C++ `Concepts', which almost made it into the C++0x standard, are
>> roughly similar to Haskell type classes. The proposal for concepts in
>> C++ had a feature called axioms, which allow the programmer to specify
>> semantics on the functions the concept contains. This allows for
>> enforcing things such as the Monad Laws, as well as letting the
>> compiler make certain optimizations it may not have been able to make
>> without axiomatic guarantees.
>
> I have a hard time imagining that axioms are being used to prove properties
> about programs in a language such as C++... :) Any pointers?

That is not what they are for. Axiom is probably not a good choice of
terminology. Axioms let a concept enforce certain statements about
functions inside the concept. E.g., in a concept that describes
addition, one could use an axiom statement to enforce commutativity of
that addition operation. There seems to be no way to do this in
Haskell, hence my question.

>
>> Why does Haskell not have a similar
>> functionality in its type classes? Was there not time, desire, etc.?
>> Or are there technical limitations?
>
> If you want to exploit algebraic identities like, say,
>
>    map f . map g = map (f . g)
>
> for program optimization, you can use the RULE pragma in GHC.
>
> If you want to use the axioms to prove your program correct, you are
> beginning to leave the scope of Haskell. Have a look at dependently typed
> languages and proof assistants like  Agda  and  Coq . For instance, the
> latter can extract Haskell programs from proofs.
>
> That being said, enforcing invariants in the types, using quickcheck and
> good old pen & paper calculations can carry you a long way towards program
> correctness in Haskell.

Certainly. My question was as to why there isn't something like this
right in the syntax for type classes. Seems like it would go a long
way, esp. for things like enforcing the monad laws.

>
>
> Regards,
> Heinrich Apfelmus
>
> --
> http://apfelmus.nfshost.com
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


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

Message: 3
Date: Fri, 2 Jul 2010 22:36:46 +0200
From: edgar klerks <edgar.kle...@gmail.com>
Subject: [Haskell-beginners] Is haskell a good choice for someone,      who
        never programmed before?
To: beginners <beginners@haskell.org>
Message-ID:
        <aanlktinxfw0txwejabt0-3y7dswwtgshekrfahihg...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi All,

I have a question. A friend of mine wants to learn a programming language,
because we work together. He studied economics and is busy in the financial
sector. I understood Haskell is used there pretty much, so he got interested
in it. But is haskell a good language for someone, who never even tried a
language like basic?

I also want to know if someone has an idea, what a good approach is to
start. I think real world haskell is a bit tough to begin with. He is an
analytical thinker, so I think he can learn it, but I don't want to scare
him away.

He is interested in functional languages, because he knows the banking
sector uses it a lot. Maybe lisp is a better start?

I thought I first let him read:
http://learnyouahaskell.com/introductionbecause it start with using
haskell as a calculator. That seems to be pretty
basic.

And mathematics, where to start? I thought algebra, but I am not sure if
that is too advanced. He doesn't want to be programming wonder, but he would
like to solve simple things.

Tnx for your help, your input is appreciated.

Greetings,

Edgar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100702/255c4aa8/attachment-0001.html

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

Message: 4
Date: Fri, 2 Jul 2010 16:43:56 -0400
From: Jorden M <jrm8...@gmail.com>
Subject: Re: [Haskell-beginners] Is haskell a good choice for someone,
        who     never programmed before?
To: edgar klerks <edgar.kle...@gmail.com>
Cc: beginners <beginners@haskell.org>
Message-ID:
        <aanlktimbqihazuqre9tqwnlyudhtprgfumarlevhq...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Reading The Haskell Road to Logic, Maths, and Programming would be a
great way for someone with no more than high school level math to get
started with programming and higher mathematics.

On Fri, Jul 2, 2010 at 4:36 PM, edgar klerks <edgar.kle...@gmail.com> wrote:
> Hi All,
>
> I have a question. A friend of mine wants to learn a programming language,
> because we work together. He studied economics and is busy in the financial
> sector. I understood Haskell is used there pretty much, so he got interested
> in it. But is haskell a good language for someone, who never even tried a
> language like basic?
>
> I also want to know if someone has an idea, what a good approach is to
> start. I think real world haskell is a bit tough to begin with. He is an
> analytical thinker, so I think he can learn it, but I don't want to scare
> him away.
>
> He is interested in functional languages, because he knows the banking
> sector uses it a lot. Maybe lisp is a better start?
>
> I thought I first let him read: http://learnyouahaskell.com/introduction
> because it start with using haskell as a calculator. That seems to be pretty
> basic.
>
> And mathematics, where to start? I thought algebra, but I am not sure if
> that is too advanced. He doesn't want to be programming wonder, but he would
> like to solve simple things.
>
> Tnx for your help, your input is appreciated.
>
> Greetings,
>
> Edgar
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>


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

Message: 5
Date: Fri, 2 Jul 2010 22:48:19 +0200
From: edgar klerks <edgar.kle...@gmail.com>
Subject: Re: [Haskell-beginners] Is haskell a good choice for someone,
        who     never programmed before?
To: Jorden M <jrm8...@gmail.com>
Cc: beginners <beginners@haskell.org>
Message-ID:
        <aanlktinfunhsvcqui0x95urddsawfo_8jy8vsntjm...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Ah thanks, that one looks good. It takes both mathematics and programming.

On Fri, Jul 2, 2010 at 10:43 PM, Jorden M <jrm8...@gmail.com> wrote:

> Reading The Haskell Road to Logic, Maths, and Programming would be a
> great way for someone with no more than high school level math to get
> started with programming and higher mathematics.
>
> On Fri, Jul 2, 2010 at 4:36 PM, edgar klerks <edgar.kle...@gmail.com>
> wrote:
> > Hi All,
> >
> > I have a question. A friend of mine wants to learn a programming
> language,
> > because we work together. He studied economics and is busy in the
> financial
> > sector. I understood Haskell is used there pretty much, so he got
> interested
> > in it. But is haskell a good language for someone, who never even tried a
> > language like basic?
> >
> > I also want to know if someone has an idea, what a good approach is to
> > start. I think real world haskell is a bit tough to begin with. He is an
> > analytical thinker, so I think he can learn it, but I don't want to scare
> > him away.
> >
> > He is interested in functional languages, because he knows the banking
> > sector uses it a lot. Maybe lisp is a better start?
> >
> > I thought I first let him read: http://learnyouahaskell.com/introduction
> > because it start with using haskell as a calculator. That seems to be
> pretty
> > basic.
> >
> > And mathematics, where to start? I thought algebra, but I am not sure if
> > that is too advanced. He doesn't want to be programming wonder, but he
> would
> > like to solve simple things.
> >
> > Tnx for your help, your input is appreciated.
> >
> > Greetings,
> >
> > Edgar
> >
> > _______________________________________________
> > Beginners mailing list
> > Beginners@haskell.org
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >
>



-- 
Flatliner ICT Service,
Email: edgar.kle...@gmail.com,
Tel: +31727851429
Fax: +31848363080
Skype: edgar.klerks
Website: flatlinerict.nl
Adres: Koelmalaan 258,
1813JD, Alkmaar
Nederland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100702/860f9718/attachment-0001.html

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

Message: 6
Date: Fri, 2 Jul 2010 22:50:01 +0200
From: Daniel Fischer <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] Is haskell a good choice for someone,
        who never programmed before?
To: beginners@haskell.org
Message-ID: <201007022250.01983.daniel.is.fisc...@web.de>
Content-Type: text/plain;  charset="utf-8"

On Friday 02 July 2010 22:36:46, edgar klerks wrote:
> Hi All,
>
> I have a question. A friend of mine wants to learn a programming
> language, because we work together. He studied economics and is busy in
> the financial sector. I understood Haskell is used there pretty much, so
> he got interested in it. But is haskell a good language for someone, who
> never even tried a language like basic?

Actually, the rumour goes that Haskell is easier to learn if your brain 
hasn't been conditioned by years of imperative programming.

>
> I also want to know if someone has an idea, what a good approach is to
> start. I think real world haskell is a bit tough to begin with. He is an
> analytical thinker, so I think he can learn it, but I don't want to
> scare him away.

Analytical thinker sounds like a good fit, I'd think he'd see the beauty 
before being scared.

>
> He is interested in functional languages, because he knows the banking
> sector uses it a lot. Maybe lisp is a better start?

Perhaps, perhaps not, depends on your friend.

>
> I thought I first let him read:
> http://learnyouahaskell.com/introductionbecause it start with using
> haskell as a calculator. That seems to be pretty
> basic.

That, and the wikibook, I think for analytical people without much 
mathematical background, Simon Thompson's Craft of Functional Programming 
is an excellent fit.

>
> And mathematics, where to start? I thought algebra, but I am not sure if
> that is too advanced.

Elementary number theory is a pretty good method to lead people into 
algebra. Start by giving problems that can be solved by trial and error and 
build a more systematic view upon those excursions.

> He doesn't want to be programming wonder, but he
> would like to solve simple things.
>
> Tnx for your help, your input is appreciated.
>
> Greetings,
>
> Edgar



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

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


End of Beginners Digest, Vol 25, Issue 7
****************************************

Reply via email to