Hi Bulat!

On Aug 24, 2006, at 1:07 PM, Bulat Ziganshin wrote:

Hello Brian,

Thursday, August 24, 2006, 4:16:41 PM, you wrote:

I would make all the fields strict here, to be sure that no lazyness can
creep about unseen eg:

     data Tag s = Tag {
         tagID :: !Int,
         state :: !(STRef s TagState),
         count :: !(STRef s Integer)
   }

perhaps better:

      data Tag s = Tag {
          tagID :: !Int,
          state :: STRef s !TagState,
          count :: STRef s !Integer
    }

although i don't even sure that this will compile (in this case we can
request it as wishful feature). in theory, this should allow to omit
'$!' from writeRef calls


Alas, at the moment the last gives (in ghc-6.4.2),

    Unexpected strictness annotation: !TagState
    In the data type declaration for `Tag'
Failed, modules loaded: none.
Prelude>


also, one can implement strict write operations:

writeRef r x = writeSTRef r $! x

or use my unboxed references (but not with Integer) -
http://haskell.org/haskellwiki/Library/ArrayRef


I will look at this. Thanks!

Best Wishes,
Greg


--
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to