Changeset 14219 for third-party

Show
Ignore:
Timestamp:
10/11/06 05:36:48 (2 years ago)
Author:
audreyt
Message:

* Judy.Refeable: Put the default instance of Refeable into

the class itself, so one can turn off needGC without having
to write the entire instance.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • third-party/HsJudy/Judy/Refeable.hs

    r12571 r14219  
    2323class Refeable a where 
    2424    toRef :: a -> IO Value 
     25    toRef = GC.newRef 
    2526    fromRef :: Value -> IO a 
     27    fromRef = deRefStablePtr . castPtrToStablePtr . wordPtrToPtr 
    2628    needGC :: a -> Bool 
     29    needGC _ = True 
    2730     
    2831--instance Dummy a => Refeable a where 
    2932instance Refeable a where 
    30     toRef = GC.newRef 
    31     fromRef v = do 
    32         a <- deRefStablePtr (castPtrToStablePtr (wordPtrToPtr v)) 
    33         return a 
    34     needGC _ = True 
    3533 
    3634instance Refeable Int where