[Haskell-cafe] Irrefutable pattern love and new regex engine.

Stefan O'Rear stefanor at cox.net
Tue Jan 22 17:33:24 EST 2008


On Tue, Jan 22, 2008 at 02:09:05PM -0800, Ryan Ingram wrote:
> > > On Tue, 2008-01-22 at 11:55 -0500, Michael Speer wrote:
> > > >       rexn ns pps = let ( ~( xs , rps ) ,
> > > >                           ~( ~( nxs ) ,
> > > >                              ~( rxs , rrps ) ) ) = ( exn nxs pps ,
> 
> > Not one of the lazy marks was required in the current version.
> 
> Pattern bindings via let are always irrefutable; the ~s here are all redundant.

False; let's irrefutability only applies at the topmost level.

Prelude> let (a,b) = undefined in 2
2
Prelude> let (a,(b,c)) = (2,undefined) in a
*** Exception: Prelude.undefined
Prelude> let (a,~(b,c)) = (2,undefined) in a
2

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080122/27863564/attachment.bin


More information about the Haskell-Cafe mailing list