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: [Haskell-cafe] For class Monoid; better names than
mempty & mappend might have been: mid (mident) & mbinop (KC)
2. Re: [Haskell-cafe] For class Monoid; better names than
mempty & mappend might have been: mid (mident) & mbinop
(Julian Porter)
3. Re: a problem with maps (Dennis Raddle)
4. Re: a problem with maps (Dennis Raddle)
----------------------------------------------------------------------
Message: 1
Date: Sun, 24 Jul 2011 11:19:13 -0700
From: KC <[email protected]>
Subject: Re: [Haskell-beginners] [Haskell-cafe] For class Monoid;
better names than mempty & mappend might have been: mid (mident) &
mbinop
To: Yves Par?s <[email protected]>, [email protected],
haskell-cafe <[email protected]>,
[email protected]
Message-ID:
<CAMLKXymWV1EOE0SDbbF4m=jnipnrf-gy2x7ujpidhy1geke...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
I like the following but again "+" denotes addition and not a general
binary operation.
> I personally often define the alias:
>
> (<+>) = mappend
A lot of math books use "+" or "x" enclosed in a circle to indicate
that the usual meaning of "+" nor "x" is intended for the meaning of
the binary operation.
I can't figure out if this would compile, the inside "()" representing a circle.
((+)) = mappend
It would be easier for beginners to "grok".
>I don't think so... but while we're at it, what's with that weird name
>"Monoid" anyway, let alone "Functor", "Monad", etc.? ;-)
Ivan: I had thought those were words expressing valid mathematical concepts.
In order to find similarities between apparently different operations
& data one wants to reason abstractly; similar to mathematics.
--
--
Regards,
KC
------------------------------
Message: 2
Date: Sun, 24 Jul 2011 19:29:16 +0100
From: Julian Porter <[email protected]>
Subject: Re: [Haskell-beginners] [Haskell-cafe] For class Monoid;
better names than mempty & mappend might have been: mid (mident) &
mbinop
To: Haskell Beginners <[email protected]>, haskell-cafe
<[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
On 24 Jul 2011, at 19:19, KC wrote:
> I like the following but again "+" denotes addition and not a general
> binary operation.
>
>
>> I personally often define the alias:
>>
>> (<+>) = mappend
>
> A lot of math books use "+" or "x" enclosed in a circle to indicate
> that the usual meaning of "+" nor "x" is intended for the meaning of
> the binary operation.
Er no. Both symbols have extremely precise meanings. $\oplus$ is the direct
sum of two modules and $\otimes$ is their tensor product.
Personally, I wish, given that an additive monad is a kind of monoid, that the
names for the zero and addition operations for the two classes were the same.
That said, I am not especially happy with mzero and madd, given that their
implication, that the monoid is abelian, is generally false.
>
> I can't figure out if this would compile, the inside "()" representing a
> circle.
>
> ((+)) = mappend
>
>
>
>
> It would be easier for beginners to "grok".
>
>> I don't think so... but while we're at it, what's with that weird name
>> "Monoid" anyway, let alone "Functor", "Monad", etc.? ;-)
>
> Ivan: I had thought those were words expressing valid mathematical concepts.
>
> In order to find similarities between apparently different operations
> & data one wants to reason abstractly; similar to mathematics.
>
> --
> --
> Regards,
> KC
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110724/db7d22c6/attachment-0001.htm>
------------------------------
Message: 3
Date: Sun, 24 Jul 2011 12:08:44 -0700
From: Dennis Raddle <[email protected]>
Subject: Re: [Haskell-beginners] a problem with maps
To: David Place <[email protected]>
Cc: [email protected], Ertugrul Soeylemez <[email protected]>
Message-ID:
<cakxlvopzz7t7bzmnh7utdnreunkvojzmlhd8ygkcmfbj4ph...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Sat, Jul 23, 2011 at 6:25 AM, David Place <[email protected]> wrote:
> On Jul 23, 2011, at 9:17 AM, Dennis Raddle wrote:
>
> That's how I understand the spirit of Haskell, although I could have a
> limited perspective.
>
>
> I think this is a valid point of view, but needs to be balanced by a need
> for perspicuity. After all, you aren't really using Arrows. It's just a
> coincidence that this function does what you want on a concrete
> implementation level.
>
"Coincidence"? "Not really using arrows"? What I've learned from Haskellers
is that it marvelous how we can find useful instances of the important
types. What I've been taught is to celebrate that by using every useful
instance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110724/f79e5103/attachment-0001.htm>
------------------------------
Message: 4
Date: Sun, 24 Jul 2011 12:18:40 -0700
From: Dennis Raddle <[email protected]>
Subject: Re: [Haskell-beginners] a problem with maps
To: Julian Porter <[email protected]>
Cc: Haskell Beginners <[email protected]>
Message-ID:
<CAKxLvopAz0wj7YSvT2x-N=804vp4mkbwwekkrqo4drq5rys...@mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
I understood your code and I agree it's elegant.
On Sun, Jul 24, 2011 at 8:44 AM, Julian Porter
<[email protected]>wrote:
> Well, speaking of rigour, I don't think applicative functors, etc are
> actually the right approach. Using the list monad gives a much clearer idea
> of what's going on, plus it's massively generalisable.
>
> See
> http://jpembeddedsolutions.wordpress.com/2011/07/24/combining-haskell-lists-with-monads/
> for
> a description.
>
> *Julian Porter
> [email protected]
> **http://www.porternet.org* <http://www.porternet.org/>
>
>
> On 24 Jul 2011, at 01:13, aditya siram wrote:
>
> Ertugul,
> I admire your passion for rigor and discipline. It is not natural for
> me but I am slowly coming to the same place.
>
> I also feel that Haskell development is like learning to play music.
> I've seen many a student (myself included) turn away from an
> instrument because of an over-emphasis on scales, arpeggios etc. and
> less on playing what sounds good. It is true that eventually to play
> seriously some understanding of that theory is required but the
> musician will come to that conclusion on their own.
>
> They will hear a pattern over and over and wonder if it has a name -
> then you show them the major scale and it will all make sense because
> it will be a solution to a problem, not a solution waiting for a
> problem.
>
> In some ways I feel that the Haskell community because of their
> expertise and enthusiasm gives users answers to questions they haven't
> asked yet. When they do (inevitably) ask your awesome monad tutorial
> (which helped me a great deal) will be there.
>
> -deech
>
> On Sat, Jul 23, 2011 at 6:39 PM, Ertugrul Soeylemez <[email protected]> wrote:
>
> David Place <[email protected]> wrote:
>
>
> Point taken, but to get serious with Haskell you will want to learn
>
> applicative functors and at least the function arrow anyway.
>
>
> Interesting thoughts, Ertugrul. I would argue that you can get very
>
> serious with Haskell without understanding applicative functors and
>
> the function arrow. The very basic aspects of the language (the type
>
> system, higher-order functions, lazy evaluation, etc?) are already so
>
> powerful, that you really don't need to add complexity to simple
>
> programs by including some of the more obscure extensions. I could
>
> see if it made the code substantially more compact. In this case, it
>
> makes the code more verbose as you need to import the two modules to
>
> do something which can be so trivially expressed as an abstraction.
>
>
> Haskell application development is more than just the language. The
>
> language itself is very powerful, yes, but serious applications I write
>
> usually have quite a few dependencies. If you want to reinvent the
>
> wheel for everything, then yes, I'm exaggerating. Personally I don't
>
> want to, because there are great libraries and design patterns out
>
> there, for which you simply need to understand more than just the
>
> language.
>
>
> It's as simple as this: To get serious with Haskell, you need to
>
> understand Haskell monads. Understanding them implies understanding
>
> applicative functors (not necessarily the applicative style). For many
>
> of the useful libraries you will want to go further and understand monad
>
> transformers and more.
>
>
> I'm not talking about any ideals here. I'm talking about real world
>
> application development, which is what I am doing.
>
>
>
> When you write a program, do you think of it as a document only for
>
> the compiler to understand, or might some other people need to
>
> understand it someday?
>
>
> "It"? For me type signatures are specification for the compiler and
>
> documentation for humans, along with Haddock-style comments. My code is
>
> usually very well documented. In most cases Haddock shows me a coverage
>
> of 100% for all of my source files, and every top-level and
>
> 'where'-definition has a type signature. I'm very rigorous here.
>
>
> All of the power I get from Haskell itself, the base library and the
>
> many libraries I use I view as tools to get stuff done quickly, safely
>
> and elegantly. As said, there is always a simpler way to write stuff,
>
> but I have a certain style, which I follow consistently, and in that
>
> style I write 'second pure'. That's it.
>
>
> Why not '(:[])'? Simply because I hate it and find it confusing. Why
>
> not 'return'? Because I write my code reasonably general. Not that
>
> using 'return' would change the type signature in question, but it is
>
> just my style. In a do-block I use 'return'. Everywhere else I use
>
> 'pure'. Consistently. Why 'second'? Because it's convenient.
>
>
>
> Greets,
>
> Ertugrul
>
>
>
> --
>
> nightmare = unsafePerformIO (getWrongWife >>= sex)
>
> http://ertes.de/
>
>
>
>
> _______________________________________________
>
> Beginners mailing list
>
> [email protected]
>
> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110724/ef514730/attachment.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 37, Issue 55
*****************************************