Re: Can't make sense of newArray# docs

2011-01-18 Thread Roman Leshchinskiy
On 18/01/2011, at 22:18, Johan Tibell wrote: > The docs for newArray# states: > > "Create a new mutable array of specified size (in bytes), in the > specified state thread, with each element containing the specified > initial value." The docs are wrong. > I'm trying to implement > the following

Re: Behavior of the inliner on imported class methods

2011-01-18 Thread Roman Leshchinskiy
Have you tried adding another (dummy) method to the class? GHC used to have problems with optimising single-method classes in the past. Roman On 18 Jan 2011, at 10:33, José Pedro Magalhães wrote: > Hello all, > > I fail to understand the behavior of the inliner in the following example: > >

Re: Can't make sense of newArray# docs

2011-01-18 Thread Max Bolingbroke
On 18 January 2011 22:18, Johan Tibell wrote: > Why is the size in bytes? I think the docs are wrong. The code for newArray# (in PrimOps.cmm) interprets n as a size in words: {{{ stg_newArrayzh { W_ words, n, init, arr, p, size; /* Args: R1 = words, R2 = initialisation value */ n =

Re: Can't make sense of newArray# docs

2011-01-18 Thread Antoine Latter
On Tue, Jan 18, 2011 at 4:18 PM, Johan Tibell wrote: > Hi, > > The docs for newArray# states: > > "Create a new mutable array of specified size (in bytes), in the > specified state thread, with each element containing the specified > initial value." > > Why is the size in bytes? Is Array# meant to

Can't make sense of newArray# docs

2011-01-18 Thread Johan Tibell
Hi, The docs for newArray# states: "Create a new mutable array of specified size (in bytes), in the specified state thread, with each element containing the specified initial value." Why is the size in bytes? Is Array# meant to be used both for boxed and unboxed values? For arrays of boxed value

Behavior of the inliner on imported class methods

2011-01-18 Thread José Pedro Magalhães
Hello all, I fail to understand the behavior of the inliner in the following example: module M1 where > > class MyEnum a where myEnum :: [a] > > instance MyEnum () where myEnum = [()] > > module M2 where > > import M1 > > f1 = map (\() -> 'p') [()] > f2 = map (\() -> 'q') myEnum > The generate