On Mon, Jan 08, 2007 at 08:36:19AM +0000, Simon Peyton-Jones wrote:
> | OK, so I'll need to put p77 in the pipe along with x and z.  I think
> | my problem is I'm using collectPatsBinders to get the vars bound by
> | a pattern, but it deliberately doesn't include dictionary binders
> | from ConPatOut.  Am I going to get the same issue everywhere there
> | are patterns?
> 
> I guess so.  It's very much as if instead of
> 
> >                 case compare x y of
> >                   GT { p77 = plusInt } -> returnA -< p77 z x
> 
> you had
> 
>         case compare x y of
>                 GT -> let p77 = plusInt in  returnA -< p77 z x

In the comment under collectPatsBinders, ignoring dictionary binders in
ConPatOut is justified in terms of lazy patterns.  Presumably there is
more to this story, because if such dictionaries are guaranteed to be
unused it would be safe for arrows too.

> Hmm.  Would it be possible to desugar in the ordinary way first, and
> only *then* run over the result doing the proc-isng stuff?  Then you
> would not have to deal with nested patterns etc.

Desugar Core?  Hmm.  Binding sites might be a bit easier to find,
but we'd also need to expand the Core language, not just with proc,
but with an arrow type system.  That would make it hard to share the
desugaring too, I imagine.

_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to