RE: bang patterns give fundamentally new capabilities?

2006-12-08 Thread Simon Peyton-Jones
| > | Also, is there a way to do something similar but for 'lazy' rather than | > | 'seq'? I want something of type | > | | > | type World__ = State# RealWorld | > | | > | {-# NOINLINE newWorld__ #-} | > | newWorld__ :: a -> World__ | > | newWorld__ x = realWord# -- ??? | > | | > | except that I

Re: bang patterns give fundamentally new capabilities?

2006-12-04 Thread Kirsten Chevalier
On 12/3/06, John Meacham <[EMAIL PROTECTED]> wrote: On Sat, Dec 02, 2006 at 11:02:28PM +, Simon Peyton-Jones wrote: [snip] > | Also, is there a way to do something similar but for 'lazy' rather than > | 'seq'? I want something of type > | > | type World__ = State# RealWorld > | > | {-# NOIN

Re: bang patterns give fundamentally new capabilities?

2006-12-03 Thread John Meacham
On Sat, Dec 02, 2006 at 11:02:28PM +, Simon Peyton-Jones wrote: > | I was recently presented with the problem of writing a function like so > | > | seqInt__ :: forall a . a -> Int# -> Int# > | seqInt__ x y = x `seq` y > | > | which seems fine, except 'seq' of type forall a b . a -> b -> b canno

RE: bang patterns give fundamentally new capabilities?

2006-12-02 Thread Simon Peyton-Jones
| I was recently presented with the problem of writing a function like so | | seqInt__ :: forall a . a -> Int# -> Int# | seqInt__ x y = x `seq` y | | which seems fine, except 'seq' of type forall a b . a -> b -> b cannot | be applied to an unboxed value. Actually it works fine. Did you try it? S

Re: bang patterns give fundamentally new capabilities?

2006-11-30 Thread Tomasz Zielonka
On Thu, Nov 30, 2006 at 08:13:13PM -0800, John Meacham wrote: > I was recently presented with the problem of writing a function like so > > seqInt__ :: forall a . a -> Int# -> Int# > seqInt__ x y = x `seq` y > > which seems fine, except 'seq' of type forall a b . a -> b -> b cannot > be applied t

bang patterns give fundamentally new capabilities?

2006-11-30 Thread John Meacham
I was recently presented with the problem of writing a function like so seqInt__ :: forall a . a -> Int# -> Int# seqInt__ x y = x `seq` y which seems fine, except 'seq' of type forall a b . a -> b -> b cannot be applied to an unboxed value. I could not think of a way to actually get the behavio