[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 21, Issue 27

Samuel Bronson naesten at gmail.com
Wed May 11 13:21:21 EDT 2005


On 11/05/05, Stijn De Saeger <stijndesaeger at gmail.com> wrote:
> Quinn Dunkan <qdunkan at gmail.com> wrote :
> 
> > ... It is very natural to
> > write in a somewhat functional style, especially in regards to
> > sequence processing: higher order functions and listcomps provide the
> > processing and its built in generators and iterator protocol provide
> > some of the benefits of laziness.  Its elementary pattern matching
> > encourages you to return as many values from a function as you need
> > and use zip() (another haskell steal) to iterate over parallel
> > sequences (all pattern matches are irrefutable, though).
> 
> I'm confused... Python has pattern matching ?

Well, we usually call it unpacking. You can only do it on sequences
(maybe just tuples?), it looks like this:

(x, y) = (1, 2)

or this:

x, y = 1, 2

-- Sam


More information about the Haskell-Cafe mailing list