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. Data.Char: isAlpha vs. isLetter (Stayvoid) 2. Re: sometimes Haskell isn't what you want (Angelos Sphyris) 3. Re: Data.Char: isAlpha vs. isLetter (Brandon Allbery) 4. Re: sometimes Haskell isn't what you want (Nick Vanderweit) 5. Re: sometimes Haskell isn't what you want (Jay Sulzberger) 6. Who discovered map reduce? (Bryce) 7. Re: Who discovered map reduce? (Nick Vanderweit) 8. Re: Who discovered map reduce? (Rustom Mody) ---------------------------------------------------------------------- Message: 1 Date: Mon, 10 Sep 2012 23:09:20 +0400 From: Stayvoid <stayv...@gmail.com> Subject: [Haskell-beginners] Data.Char: isAlpha vs. isLetter To: beginners <beginners@haskell.org> Message-ID: <CAK5fS_HdL+EKx45HmaujtCV2z=eer3obdpj15zu5nczxs-x...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi, What's the reason to have both isAlpha and isLetter? Looks like it's just an alias. I don't understand the purpose. Could you explain? Thanks ------------------------------ Message: 2 Date: Mon, 10 Sep 2012 22:24:44 +0300 From: Angelos Sphyris <knightofmathemat...@hotmail.com> Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want To: <dennis.rad...@gmail.com>, <beginners@haskell.org> Message-ID: <snt107-w90edf53f85dd9dc7ca35fa5...@phx.gbl> Content-Type: text/plain; charset="iso-8859-7" Well, at least you now know that the language exists and you have some idea of where its associated resources (libraries, tutorials...) are located, so that you can take it up again if the need arises in the future... Angelos Date: Sun, 9 Sep 2012 01:10:14 -0700 From: dennis.rad...@gmail.com To: beginners@haskell.org Subject: [Haskell-beginners] sometimes Haskell isn't what you want Sadly, I've decided Haskell is not the right language for my current project. Python is better. I need to hack together data, and strict typing is getting in the way. Most of my algorithms are better served with imperative/mutable-data. I learned a lot about Haskell trying to do it, but my knowledge of the language is not quiet good enough and I feel like I'm fighting the language. Python is better. For now. _______________________________________________ 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/20120910/efedfe73/attachment-0001.htm> ------------------------------ Message: 3 Date: Mon, 10 Sep 2012 15:31:26 -0400 From: Brandon Allbery <allber...@gmail.com> Subject: Re: [Haskell-beginners] Data.Char: isAlpha vs. isLetter To: Stayvoid <stayv...@gmail.com> Cc: beginners <beginners@haskell.org> Message-ID: <cakfcl4v3q4pd3kwbr94ew5cgzhk+lsxxuic-vf1vz-b-pzt...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Mon, Sep 10, 2012 at 3:09 PM, Stayvoid <stayv...@gmail.com> wrote: > What's the reason to have both isAlpha and isLetter? > Probably an alias for backward compatibility; isAlpha is C-style <ctype.h> stuff, which was ASCII only, whereas isLetter is Unicode style. -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120910/576612e2/attachment-0001.htm> ------------------------------ Message: 4 Date: Mon, 10 Sep 2012 14:16:02 -0700 (PDT) From: Nick Vanderweit <nick.vanderw...@gmail.com> Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want To: beginners@haskell.org Message-ID: <2776518.ja9fi27GRP@euler> Content-Type: text/plain; charset="us-ascii" I agree with this. Often it seems that Haskell takes longer to write, but I think this is because it makes you work harder than other languages before it compiles successfully. The tradeoff here is that you wind up with fewer runtime errors, which are more frustrating than compiler errors. A Haskell program is a proof of its own type. Writing proofs is a challenging task. Whether you want to incur this overhead is, of course, up to you as a programmer. Nick On Monday, September 10, 2012 03:28:45 PM damodar kulkarni wrote: > > ... strict typing is getting in the way.... > > When Haskell's strict typing seems to get in your way, chances are more > that you are heading for a big and nasty problem (aka, bug) sometime down > the line, unless you are extremely careful of what you do. > > Strict typing is a boon to software designers in that it helps point out > even major design flaws and that too rather earlier. > > But, apart from this, if one is trying to deal with a computational problem > involving lots and lot of state-change (and things like memoization etc), > then there is no "easy" way out for a beginner in Haskell. IMHO, that's > because, Haskell isn't modelled after the so called state-change model of > computation. > > But I am sure, Haskell Gurus out there may help you out if you give more > inputs about your problem. > > -Damodar > > On Sun, Sep 9, 2012 at 1:45 PM, KC <kc1...@gmail.com> wrote: > > If one programming language suited every computable problem there > > would only be one programming language. > > > > You don't seem to have a point worth making without more description > > of your problem. > > > > > > On Sun, Sep 9, 2012 at 1:10 AM, Dennis Raddle <dennis.rad...@gmail.com> > > > > wrote: > > > Sadly, I've decided Haskell is not the right language for my current > > > project. Python is better. I need to hack together data, and strict > > > > typing > > > > > is getting in the way. Most of my algorithms are better served with > > > imperative/mutable-data. I learned a lot about Haskell trying to do it, > > > > but > > > > > my knowledge of the language is not quiet good enough and I feel like > > > I'm > > > fighting the language. Python is better. For now. > > > > > > > > > _______________________________________________ > > > Beginners mailing list > > > Beginners@haskell.org > > > http://www.haskell.org/mailman/listinfo/beginners > > > > -- > > -- > > Regards, > > KC > > > > _______________________________________________ > > Beginners mailing list > > Beginners@haskell.org > > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ Message: 5 Date: Mon, 10 Sep 2012 17:23:51 -0400 (EDT) From: Jay Sulzberger <j...@panix.com> Subject: Re: [Haskell-beginners] sometimes Haskell isn't what you want To: Haskell Beginners <beginners@haskell.org> Message-ID: <pine.neb.4.64.1209090506130.8...@panix3.panix.com> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sun, 9 Sep 2012, Dennis Raddle <dennis.rad...@gmail.com> wrote: > Sadly, I've decided Haskell is not the right language for my current > project. Python is better. I need to hack together data, and strict typing > is getting in the way. Most of my algorithms are better served with > imperative/mutable-data. I learned a lot about Haskell trying to do it, but > my knowledge of the language is not quiet good enough and I feel like I'm > fighting the language. Python is better. For now. I always recommend Scheme. It is like Haskell in one respect: The Scheme Tribes keep the Ritual and the Law of Lambda. Scheme is different from Haskell in two respects: We Lispers do all our coding under the Great Functor, the Great Functor from Code to Objects in the Lisp World. For most Scheme systems, the Type Sub-System calculates less at compile time. Robert Harper has a new textbook available at http://www.cs.cmu.edu/~rwh/plbook/book.pdf and here is a useful notice of the book http://blog.ezyang.com/2012/08/practical-foundations-for-programming-languages/ ad missing the Great Functor: See remarks on "symbols" in the section 32.3 on page 321, and the discussion of observational equivalence in section 47.1 on page 498. A Lisper reading these sections might say "Ah, the Great Functor is worthy of study by New Type Theorists too. We Lispers consider a symbol to be a symbol first, and nothing else until you pass across one or more functors, and then the symbol might become many different things.". ad "dynamic typing" vs "static typing": Professor Harper's blog post http://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ deals with this. I think the claim made, that "dynamic typing" is a special case of "static typing", is, when sympathetically read, right. oo--JS. ------------------------------ Message: 6 Date: Mon, 10 Sep 2012 16:19:47 -0700 From: Bryce <bryceverd...@gmail.com> Subject: [Haskell-beginners] Who discovered map reduce? To: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <504e7593.7070...@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed In the same vein as the "who discovered the fold operation" thread from last week, I would like to know the same answer for "map". I tried looking it up on wikipedia, but the best line I could find from it is this: "The map function originated in functional programming languages but is today supported (or may be defined) in many procedural, object oriented, and multi-paradigm languages as well: In C++'s Standard Template Library, it is called transform, in C# (3.0)'s LINQ library, it is provided as an extension method called Select." Does anyone have an answer or idea on where I could look? Thanks in advance and sorry if it it's a redundant question. Bryce ------------------------------ Message: 7 Date: Mon, 10 Sep 2012 19:58:11 -0600 From: Nick Vanderweit <nick.vanderw...@gmail.com> Subject: Re: [Haskell-beginners] Who discovered map reduce? To: beginners@haskell.org Message-ID: <10446284.ma92pnosph@euler> Content-Type: text/plain; charset="us-ascii" I can't tell you the history of the map higher-order function, but the underlying concept of a functor has its roots in category theory, which is quite old (dating back to the 1940s). Here's a brief explanation of the mathematics. A category is basically a digraph, whose vertices we call "objects" and whose edges we call "arrows." For each object there is an identity arrow id_a : a -> a, and for each pair of arrows f : a -> b and g : b -> c, there is a composite arrow g . f : a -> c. The identity arrow for some object has to actually be an identity under composition (that is, on the left and on the right), and the composition has to be associative. The category we're really concerned with in Haskell is Hask, the category of Haskell functions, whose objects are Haskell types and whose arrows (AKA morphisms) are functions between these types, f :: a -> b. The identity arrow at a given type A is id :: A -> A, and composition is the (.) operator. We have a structure, so the next natural thing (for the algebraically- inclined, anyway) is to think about a structure-preserving map (a homomorphism). A homomorphism of categories is called a "functor." Let T be a functor from C to B, written T : C -> B. Then T assigns each object in C an object in B, and each arrow in C an arrow in B. In order to be structure- preserving, they have to satisfy the following property: that composing in C and then applying the functor to get to B is the same as applying the functor to the objects in C and then composing in B, and that identities are sent to identities. If we look at the Haskell functor class: class Functor f where fmap :: (a -> b) -> f a -> f b We can pick out the "object function" and "arrow function." For some Functor f, f is the object function. For instance, Maybe sends Int to Maybe Int. For our arrow function, we have fmap, which sends arrows (a -> b) in Hask to arrows (f a -> f b), also in Hask (a functor mapping from a category to itself is called an endofunctor). It satisfies the following properties: fmap g . fmap f = fmap (g . f) fmap id = id Which are precisely the "structure-preserving" properties for functors stated above. So you may be used to thinking of "map f xs" as "map f over the list xs." But a deeper way of thinking about it is that map takes a function f on Haskell types, and turns it into a function on lists parameterized over those types. And this, as it turns out, is a pretty old idea. Nick On Monday, September 10, 2012 04:19:47 PM Bryce wrote: > In the same vein as the "who discovered the fold operation" thread from > last week, I would like to know the same answer for "map". > > I tried looking it up on wikipedia, but the best line I could find from > it is this: > "The map function originated in functional programming languages but is > today supported (or may be defined) in many procedural, object oriented, > and multi-paradigm languages as well: In C++'s Standard Template > Library, it is called transform, in C# (3.0)'s LINQ library, it is > provided as an extension method called Select." > > Does anyone have an answer or idea on where I could look? > > Thanks in advance and sorry if it it's a redundant question. > > Bryce > > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ Message: 8 Date: Tue, 11 Sep 2012 08:49:25 +0530 From: Rustom Mody <rustompm...@gmail.com> Subject: Re: [Haskell-beginners] Who discovered map reduce? To: Bryce <bryceverd...@gmail.com> Cc: "beginners@haskell.org" <beginners@haskell.org> Message-ID: <CAJ+TeofC333Afh43OQqX=Kw=ag4joxzcdpidlein5y1nust...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" On Tue, Sep 11, 2012 at 4:49 AM, Bryce <bryceverd...@gmail.com> wrote: > In the same vein as the "who discovered the fold operation" thread from > last week, I would like to know the same answer for "map". > > I tried looking it up on wikipedia, but the best line I could find from it > is this: > "The map function originated in functional programming languages but is > today supported (or may be defined) in many procedural, object oriented, > and multi-paradigm languages as well: In C++'s Standard Template Library, > it is called transform, in C# (3.0)'s LINQ library, it is provided as an > extension method called Select." > > Does anyone have an answer or idea on where I could look? > > Thanks in advance and sorry if it it's a redundant question. > > Bryce > Among programming languages I think its (again) APL. In the case of map its much more pervasive and implicit than with fold. (In haskell terminology we would say both map and zipwith) http://www.jsoftware.com/papers/APL1.htm#s.5 Heres a small A+ (linux apl) session. A+ Copyright (c) 1990-2008 Morgan Stanley. All rights reserved. This version is Release 4.22 > a ? 4 > v ? 5 6 7 > a + a 8 > a + v 9 10 11 > v + v 10 12 14 > v ? v 25 36 49 > v ? v 1 1 1 > v ? 2 2.5 3 3.5 > v ? 6 1 1 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://www.haskell.org/pipermail/beginners/attachments/20120911/0a8bf9f0/attachment.htm> ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 51, Issue 14 *****************************************