caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Till Varoquaux" <till.varoquaux@gmail.com>
To: "Jon Harrop" <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Help me find this pdf
Date: Thu, 18 Oct 2007 11:15:57 -0400	[thread overview]
Message-ID: <9d3ec8300710180815r5dba9da1v2a163f6fc3847aab@mail.gmail.com> (raw)
In-Reply-To: <200710181417.20870.jon@ffconsultancy.com>

Lat time I checked Don Syme was working to optimize active patterns.
At the time there wasn't (AFAIK) any way to "group" computation
beetween active patterns.
In ocaml pattern matching happens on all the patterns at once, as you
go forward impossible cases are dropped, this is probably what is also
done in Haskell.
Ideally you'd want to:
_Have a number of comparaisons that, in worst case complexity is
O(n+m) where n is the length of your longest pattern and m is the
number of your patterns. I don't know how this could be achieved with
views.
_Force a minimal number of values.
I believe you need your pattern matching compilation to handle lazy
cases specifically in order to get both of the above requirements.
AliceML might do it.

Cheers,
Till


On 10/18/07, Jon Harrop <jon@ffconsultancy.com> wrote:
> On Thursday 18 October 2007 13:40:43 Arnaud Spiwack wrote:
> > > Scala can do something similar by controlling evaluation simply by
> > > altering the signature. However, I've reviewed Haskell recently and I
> > > think complete laziness is more of a hindrance than a benefit. The only
> > > think I'd like to see added to eager FPLs is the ability to pattern match
> > > over lazy values, forcing them only when necessary.
> >
> > Which might simply need to have a support for views, wouldn't it ?
>
> Yes. F# provides pattern matching over lazy lists using exactly that technique
> and views are more generally useful when dissecting data structures held in
> foreign formats without copying them.
>
> However, implementing views is probably a lot harder than just implementing
> pattern matching over lazy values. I suspect pattern matching over lazy
> values could be implemented much more efficiently that the more general case
> of views.
>
> --
> Dr Jon D Harrop, Flying Frog Consultancy Ltd.
> http://www.ffconsultancy.com/products/?e
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
http://till-varoquaux.blogspot.com/


  reply	other threads:[~2007-10-18 15:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18  9:52 Tom
2007-10-18 10:33 ` [Caml-list] " skaller
2007-10-18 11:01   ` Andreas Rossberg
2007-10-18 12:25 ` Jon Harrop
2007-10-18 12:40   ` Arnaud Spiwack
2007-10-18 13:17     ` Jon Harrop
2007-10-18 15:15       ` Till Varoquaux [this message]
2007-10-18 12:46   ` Jacques Garrigue
2007-10-18 13:57     ` Jon Harrop
2007-10-18 14:22       ` Brian Hurt
2007-10-18 14:52         ` Robert Fischer
2007-10-18 15:04           ` Eric Cooper
2007-10-18 17:18         ` Jon Harrop
2007-10-19  1:16           ` skaller
2007-10-19  5:09           ` Bárður Árantsson
2007-10-19  5:23             ` [Caml-list] " Erik de Castro Lopo
2007-10-19  5:46               ` Bárður Árantsson
2007-10-19 12:25               ` [Caml-list] " Christophe Raffalli
2007-10-19 12:47                 ` Luc Maranget
2007-10-20 14:26                   ` Christophe Raffalli
2007-10-19 14:48                 ` Robert Fischer
2007-10-19 21:43                   ` Andreas Rossberg
2007-10-19 21:51                     ` Robert Fischer
2007-10-20 13:10                       ` Andreas Rossberg
2007-10-19 23:10                     ` Jon Harrop
2007-10-20  1:13                       ` skaller
2007-10-20  6:36                         ` Tom
2007-10-21 11:17                           ` skaller
2007-10-19  8:55             ` Zheng Li
2007-10-19 22:27             ` [Caml-list] " Jon Harrop
2007-10-19 13:00           ` [Caml-list] " Brian Hurt
2007-10-19 13:49             ` Loup Vaillant
2007-10-19 14:41               ` Zheng Li
2007-10-19 23:09             ` [Caml-list] " Jon Harrop
2007-10-18 20:07   ` Tom
2007-10-19  0:59     ` skaller
2007-10-18 20:48 ` Lauri Alanko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d3ec8300710180815r5dba9da1v2a163f6fc3847aab@mail.gmail.com \
    --to=till.varoquaux@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).