Am Freitag 04 September 2009 21:57:27 schrieb Peter Verswyvelen:
> When ones makes an ADT with data constructors that has strict (and
> maybe unpacked) fields,
>
> e.g.
>
> data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
>
> how does one define an NFData instance?
>
> Like this?
>
> instanc
On Fri, Sep 4, 2009 at 12:57 PM, Peter Verswyvelen wrote:
> When ones makes an ADT with data constructors that has strict (and
> maybe unpacked) fields,
>
> e.g.
>
> data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
>
> how does one define an NFData instance?
>
> Like this?
>
> instance NFDat
When ones makes an ADT with data constructors that has strict (and
maybe unpacked) fields,
e.g.
data Vec2 a = Vec2 {-# UNPACK #-} !a {-# UNPACK #-} !a
how does one define an NFData instance?
Like this?
instance NFData a => NFData (Vec2 a) where
rnf (Vec2 x y) = rnf x `seq` rnf y
Or is it e