Skip to content

Commit c86e68f

Browse files
committed
Make the interface linear again
1 parent a58768d commit c86e68f

File tree

5 files changed

+101
-88
lines changed

5 files changed

+101
-88
lines changed

memory/Bench/Compact/SExpr.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,15 @@ parseWithoutDest s = case parseWithoutDest' NotInSList s of
135135
defaultSExpr :: SExpr
136136
defaultSExpr = SInteger 0
137137

138-
readStringUsingDest :: forall r. (IsRegion r) => Dest r String %1 -> Bool -> String -> Either (Ur SExprParseError) String
138+
readStringUsingDest :: forall r. (RegionContext r) => Dest r String %1 -> Bool -> String -> Either (Ur SExprParseError) String
139139
readStringUsingDest = \cases
140140
d escaped [] -> d <| C @"[]" `lseq` Left (Ur $ UnexpectedEOFSString escaped Nothing)
141141
d True ('n' : xs) -> case d <| C @":" of (dx, dxs) -> dx <|.. '\n' `lseq` readStringUsingDest dxs False xs -- TODO: add other escape chars
142142
d False ('\\' : xs) -> readStringUsingDest d True xs
143143
d False ('"' : xs) -> d <| C @"[]" `lseq` Right xs
144144
d _ (x : xs) -> case d <| C @":" of (dx, dxs) -> dx <|.. x `lseq` readStringUsingDest dxs False xs
145145

146-
parseUsingDest' :: forall r. (IsRegion r) => DSContext r %1 -> String -> Either (Ur SExprParseError) String
146+
parseUsingDest' :: forall r. (RegionContext r) => DSContext r %1 -> String -> Either (Ur SExprParseError) String
147147
parseUsingDest' = \cases
148148
(DNotInSList d) [] -> d <|.. defaultSExpr `lseq` Left $ Ur UnexpectedEOFSExpr
149149
(DInSList d) [] -> d <| C @"[]" `lseq` Left (Ur $ UnexpectedEOFSList Nothing)
@@ -186,8 +186,8 @@ parseUsingDest' = \cases
186186

187187
parseUsingDest :: String -> Either SExprParseError SExpr
188188
parseUsingDest str =
189-
case withRegion $ \(_ :: RegionContext r) ->
190-
case completeExtract $ (alloc @r) <&> DNotInSList <&> flip parseUsingDest' str <&> finalizeResults of
189+
case withRegion $ \r ->
190+
case completeExtract $ (alloc r) <&> DNotInSList <&> flip parseUsingDest' str <&> finalizeResults of
191191
Ur (expr, Right ()) -> Ur (Right expr)
192192
Ur (expr, Left errFn) -> Ur (Left $ errFn expr) of
193193
Ur res -> res

memory/Main.hs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module Main (main) where
22

33
import qualified Bench.Compact.Pure as Compact
44
import Bench.Compact.SExpr
5-
import Test.Tasty.Bench (defaultMain)
6-
import System.Environment
75
import Control.DeepSeq (rnf)
86
import Control.Exception (evaluate)
7+
import System.Environment
8+
import Test.Tasty.Bench (defaultMain)
99

1010
-- Launch regular benchmark with
1111
-- stack bench linear-base:bench:memory --ba '+RTS -T'
@@ -27,13 +27,14 @@ main = do
2727
args <- getArgs
2828
case args of
2929
"runParseWithoutDest" : _ -> do
30-
sampleData <- loadSampleData
31-
let res = parseWithoutDest sampleData
32-
evaluate $ rnf $ res
30+
sampleData <- loadSampleData
31+
let res = parseWithoutDest sampleData
32+
evaluate $ rnf $ res
3333
"runParseUsingDest" : _ -> do
34-
sampleData <- loadSampleData
35-
let res = parseUsingDest sampleData
36-
evaluate $ rnf $ res
37-
_ -> defaultMain
38-
[ Compact.benchmarks
39-
]
34+
sampleData <- loadSampleData
35+
let res = parseUsingDest sampleData
36+
evaluate $ rnf $ res
37+
_ ->
38+
defaultMain
39+
[ Compact.benchmarks
40+
]

src/Compact/Pure.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ module Compact.Pure
66
( ShowHeap (_showHeap),
77
_showHeapPrim,
88
showHeap,
9-
Region,
10-
IsRegion,
119
RegionContext,
12-
pattern RegionContext,
10+
RegionToken,
1311
withRegion,
1412
Dest,
1513
Fill (fill),

src/Compact/Pure/Internal.hs

Lines changed: 58 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ import Data.Functor.Linear qualified as Data
2323
import Data.Kind (Type)
2424
import Data.List (intercalate)
2525
import Data.Reflection (Reifies (reflect), reify)
26+
import Data.Replicator.Linear.Internal (Replicator (Moved))
2627
import Data.Semigroup (stimesMonoid)
28+
import Data.Unrestricted.Linear.Internal.Consumable
29+
import Data.Unrestricted.Linear.Internal.Dupable
2730
import Data.Unrestricted.Linear.Internal.Ur
2831
import Foreign (Storable (poke), peek, plusPtr)
2932
import GHC.Compact (Compact, compact, compactAdd, getCompact)
30-
import Unsafe.Coerce (unsafeCoerce)
3133
import GHC.Exts
3234
import GHC.Generics
3335
import GHC.IO (unsafePerformIO)
3436
import GHC.TypeLits
37+
import Unsafe.Coerce (unsafeCoerce)
3538
import Unsafe.Linear (toLinear, toLinear2)
3639

3740
-------------------------------------------------------------------------------
@@ -62,9 +65,6 @@ putDebugLn x = if debugEnabled then putStrLn $ "[DEBUG] " ++ x else return ()
6265
placeholder :: Int
6366
placeholder = 1339
6467

65-
unknownName :: String
66-
unknownName = "<unknown>"
67-
6868
-------------------------------------------------------------------------------
6969
-- Primitives to do unsafe things
7070
-------------------------------------------------------------------------------
@@ -341,26 +341,30 @@ firstInhabitant = FirstInhabitant 1234
341341

342342
newtype Region = Region {root :: Compact FirstInhabitant}
343343

344-
type IsRegion r = Reifies r Region
344+
data RegionToken r where RegionToken :: Region -> RegionToken r
345345

346-
type RegionContext r = Proxy r
346+
instance Consumable (RegionToken r) where
347+
consume (RegionToken _) = ()
347348

348-
pattern RegionContext :: RegionContext r
349-
pattern RegionContext = Proxy
349+
instance Dupable (RegionToken r) where
350+
dupR (RegionToken c) = Moved (RegionToken c)
350351

351-
getRegionRoot :: forall r. (IsRegion r) => Compact FirstInhabitant
352+
type RegionContext r = Reifies r Region
353+
354+
getRegionRoot :: forall r. (RegionContext r) => Compact FirstInhabitant
352355
getRegionRoot = root $ reflect (Proxy :: Proxy r)
353356

354357
{-# NOINLINE withRegion #-}
355-
withRegion :: forall b. (forall (r :: Type). (IsRegion r) => RegionContext r -> Ur b) -> Ur b
358+
withRegion :: forall b. (forall (r :: Type). (RegionContext r) => RegionToken r %1 -> Ur b) -> Ur b
356359
withRegion f =
357360
unsafePerformIO $ do
358361
c <- (compact firstInhabitant)
359-
let firstPtr = ptrToWord $ aToRawPtr $ getCompact c
362+
let !firstInhabitantInRegion = getCompact c
363+
firstPtr = ptrToWord $ aToRawPtr $ firstInhabitantInRegion
360364
putDebugLn $
361365
"withRegion: allocating new region around @"
362366
++ (show firstPtr)
363-
return $! reify (Region c) f
367+
return $! reify (Region {root = c}) (\(proxy :: Proxy s) -> f (RegionToken @s (reflect proxy)))
364368

365369
newtype Dest r a = Dest {parentWriteLoc :: Ptr Word}
366370

@@ -369,16 +373,16 @@ data CtorSelector (symCtor :: Symbol) = C
369373
(<|) :: forall (symCtor :: Symbol) r a. (Fill symCtor r a) => Dest r a %1 -> CtorSelector symCtor %1 -> DestsOf symCtor r a
370374
d <| C = fill @symCtor d
371375

372-
(<|.) :: forall r a b. (IsRegion r) => Dest r a %1 -> Incomplete r a b %1 -> b
376+
(<|.) :: forall r a b. (RegionContext r) => Dest r a %1 -> Incomplete r a b %1 -> b
373377
(<|.) = fillComp
374378

375-
(<|..) :: forall r a. (IsRegion r) => Dest r a %1 -> a -> ()
379+
(<|..) :: forall r a. (RegionContext r) => Dest r a %1 -> a -> ()
376380
(<|..) = fillLeaf
377381

378-
fillComp :: forall r a b. (IsRegion r) => Dest r a %1 -> Incomplete r a b %1 -> b
382+
fillComp :: forall r a b. (RegionContext r) => Dest r a %1 -> Incomplete r a b %1 -> b
379383
fillComp = toLinear2 _fillComp
380384

381-
fillLeaf :: forall r a. (IsRegion r) => Dest r a %1 -> a -> ()
385+
fillLeaf :: forall r a. (RegionContext r) => Dest r a %1 -> a -> ()
382386
fillLeaf = toLinear2 _fillLeaf
383387

384388
isNullPtr :: Ptr a -> Bool
@@ -388,7 +392,7 @@ nullPtr :: Ptr a
388392
nullPtr = Ptr (int2Addr# 0#)
389393

390394
{-# NOINLINE _fillComp #-}
391-
_fillComp :: forall r a b. (IsRegion r) => Dest r a -> Incomplete r a b -> b
395+
_fillComp :: forall r a b. (RegionContext r) => Dest r a -> Incomplete r a b -> b
392396
_fillComp Dest {parentWriteLoc = bParentWriteLoc} Incomplete {rootReceiver = sRootReceiver, dests = sDests, pInitialParentWriteLoc} =
393397
unsafePerformIO $ do
394398
let pSRootReceiver = aToRawPtr sRootReceiver
@@ -416,7 +420,7 @@ _fillComp Dest {parentWriteLoc = bParentWriteLoc} Incomplete {rootReceiver = sRo
416420
return $ sDests
417421

418422
{-# NOINLINE _fillLeaf #-}
419-
_fillLeaf :: forall r a. (IsRegion r) => Dest r a -> a -> ()
423+
_fillLeaf :: forall r a. (RegionContext r) => Dest r a -> a -> ()
420424
_fillLeaf Dest {parentWriteLoc} x =
421425
unsafePerformIO $ do
422426
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) x)
@@ -464,31 +468,31 @@ type family DestsOf (symCtor :: Symbol) r (a :: Type) where
464468
class Fill (symCtor :: Symbol) r (a :: Type) where
465469
fill :: Dest r a %1 -> DestsOf symCtor r a
466470

467-
instance ('Just ctor ~ GCtorInfoOf symCtor (Rep a ()), GDestsOf ctor r a ~ DestsOf symCtor r a, GFill ctor a, IsRegion r) => Fill symCtor r a where
471+
instance ('Just ctor ~ GCtorInfoOf symCtor (Rep a ()), GDestsOf ctor r a ~ DestsOf symCtor r a, GFill ctor a, RegionContext r) => Fill symCtor r a where
468472
fill = toLinear (\d -> unsafePerformIO (gFill @ctor @a d))
469473

470474
class GFill (ctor :: (Meta, [(Meta, Type)])) (a :: Type) where
471-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (GDestsOf ctor r a)
475+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (GDestsOf ctor r a)
472476

473477
showFill :: Ptr Word -> Word -> String -> [Ptr Word] -> String
474478
showFill parentWriteLoc pXAsWord ctorName slots =
475479
"fill"
476-
++ (show n)
477-
++ ": @"
478-
++ show (ptrToWord parentWriteLoc)
479-
++ " <- #"
480-
++ show pXAsWord
481-
++ ": "
482-
++ ctorName
483-
++ " "
484-
++ showSlots slots
480+
++ (show n)
481+
++ ": @"
482+
++ show (ptrToWord parentWriteLoc)
483+
++ " <- #"
484+
++ show pXAsWord
485+
++ ": "
486+
++ ctorName
487+
++ " "
488+
++ showSlots slots
485489
where
486490
n = length slots
487491
showSlots = intercalate " " . fmap showSlot
488492
showSlot ptr = "_@" ++ (show $ ptrToWord ptr)
489493

490494
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[]) a where
491-
gFill :: forall r. (IsRegion r) => Dest r a -> IO ()
495+
gFill :: forall r. (RegionContext r) => Dest r a -> IO ()
492496
gFill Dest {parentWriteLoc} = do
493497
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
494498
let CtorData {..} = getCtorData @metaCtor
@@ -498,7 +502,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
498502

499503
-- TODO: add constraints on ds_i variables to ensure no unpacking
500504
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0)]) a where
501-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0)
505+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0)
502506
gFill Dest {parentWriteLoc} = do
503507
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
504508
let pXRaw = aToRawPtr xInRegion
@@ -512,7 +516,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
512516

513517
-- TODO: add constraints on ds_i variables to ensure no unpacking
514518
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1)]) a where
515-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1)
519+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1)
516520
gFill Dest {parentWriteLoc} = do
517521
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
518522
let pXRaw = aToRawPtr xInRegion
@@ -525,7 +529,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
525529
return (Dest pF0, Dest pF1)
526530

527531
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1), '( 'MetaSel f2 u2 ss2 ds2, t2)]) a where
528-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2)
532+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2)
529533
gFill Dest {parentWriteLoc} = do
530534
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
531535
let pXRaw = aToRawPtr xInRegion
@@ -539,7 +543,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
539543
return (Dest pF0, Dest pF1, Dest pF2)
540544

541545
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1), '( 'MetaSel f2 u2 ss2 ds2, t2), '( 'MetaSel f3 u3 ss3 ds3, t3)]) a where
542-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3)
546+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3)
543547
gFill Dest {parentWriteLoc} = do
544548
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
545549
let pXRaw = aToRawPtr xInRegion
@@ -554,7 +558,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
554558
return (Dest pF0, Dest pF1, Dest pF2, Dest pF3)
555559

556560
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1), '( 'MetaSel f2 u2 ss2 ds2, t2), '( 'MetaSel f3 u3 ss3 ds3, t3), '( 'MetaSel f4 u4 ss4 ds4, t4)]) a where
557-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4)
561+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4)
558562
gFill Dest {parentWriteLoc} = do
559563
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
560564
let pXRaw = aToRawPtr xInRegion
@@ -570,7 +574,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
570574
return (Dest pF0, Dest pF1, Dest pF2, Dest pF3, Dest pF4)
571575

572576
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1), '( 'MetaSel f2 u2 ss2 ds2, t2), '( 'MetaSel f3 u3 ss3 ds3, t3), '( 'MetaSel f4 u4 ss4 ds4, t4), '( 'MetaSel f5 u5 ss5 ds5, t5)]) a where
573-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5)
577+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5)
574578
gFill Dest {parentWriteLoc} = do
575579
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
576580
let pXRaw = aToRawPtr xInRegion
@@ -587,7 +591,7 @@ instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype met
587591
return (Dest pF0, Dest pF1, Dest pF2, Dest pF3, Dest pF4, Dest pF5)
588592

589593
instance (Generic a, repA ~ Rep a (), metaA ~ GDatatypeMetaOf repA, Datatype metaA, 'MetaCons symCtor fix hasSel ~ metaCtor, Constructor metaCtor, GShallow symCtor repA) => GFill '(metaCtor, '[ '( 'MetaSel f0 u0 ss0 ds0, t0), '( 'MetaSel f1 u1 ss1 ds1, t1), '( 'MetaSel f2 u2 ss2 ds2, t2), '( 'MetaSel f3 u3 ss3 ds3, t3), '( 'MetaSel f4 u4 ss4 ds4, t4), '( 'MetaSel f5 u5 ss5 ds5, t5), '( 'MetaSel f6 u6 ss6 ds6, t6)]) a where
590-
gFill :: forall r. (IsRegion r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5, Dest r t6)
594+
gFill :: forall r. (RegionContext r) => Dest r a -> IO (Dest r t0, Dest r t1, Dest r t2, Dest r t3, Dest r t4, Dest r t5, Dest r t6)
591595
gFill Dest {parentWriteLoc} = do
592596
!xInRegion <- getCompact <$> (compactAdd (getRegionRoot @r) (shallowTerm @symCtor @a))
593597
let pXRaw = aToRawPtr xInRegion
@@ -681,11 +685,15 @@ data Incomplete r a b = Incomplete {rootReceiver :: Ur a, dests :: b, pInitialPa
681685
instance Control.Functor (Incomplete r a) where
682686
fmap f (Incomplete u d pp) = Incomplete u (f d) pp
683687

684-
{-# NOINLINE intoR #-}
685-
intoR :: forall r a. (IsRegion r) => a -> Incomplete r a ()
686-
intoR x =
688+
-- TODO: should we add the redundant '(RegionContext r) =>' here?
689+
intoR :: forall r a. RegionToken r %1 -> a -> Incomplete r a ()
690+
intoR = toLinear2 _intoR
691+
692+
{-# NOINLINE _intoR #-}
693+
_intoR :: forall r a. RegionToken r -> a -> Incomplete r a ()
694+
_intoR (RegionToken (Region c)) x =
687695
unsafePerformIO $ do
688-
!rootReceiver <- getCompact <$> (compactAdd (getRegionRoot @r) $ Ur x)
696+
!rootReceiver <- getCompact <$> (compactAdd c $ Ur x)
689697
putDebugLn $
690698
"intoR: [region] <- #"
691699
++ (show $ aToWord rootReceiver)
@@ -696,14 +704,18 @@ intoR x =
696704
_hide :: a -> a
697705
_hide x = x
698706

699-
{-# NOINLINE alloc #-}
700-
alloc :: forall r a. (IsRegion r) => Incomplete r a (Dest r a)
701-
alloc =
707+
-- TODO: should we add the redundant '(RegionContext r) =>' here?
708+
alloc :: forall r a. RegionToken r %1 -> Incomplete r a (Dest r a)
709+
alloc = toLinear _alloc
710+
711+
{-# NOINLINE _alloc #-}
712+
_alloc :: forall r a. RegionToken r -> Incomplete r a (Dest r a)
713+
_alloc (RegionToken (Region c)) =
702714
unsafePerformIO $ do
703-
!rootReceiver <- getCompact <$> (compactAdd (getRegionRoot @r) $ (unsafeCoerce (Ur placeholder) :: Ur a))
715+
!rootReceiver <- getCompact <$> (compactAdd c $ (unsafeCoerce (Ur placeholder) :: Ur a))
704716
let p = aToRawPtr rootReceiver
705717
parentWriteLoc = p `plusPtr` headerSize
706-
!pwlHolder <- getCompact <$> (compactAdd (getRegionRoot @r) $ parentWriteLoc)
718+
!pwlHolder <- getCompact <$> (compactAdd c $ parentWriteLoc)
707719
let !initialDest = Dest {parentWriteLoc = pwlHolder}
708720
pHolder = aToRawPtr pwlHolder
709721
!pParentWriteLoc = pHolder `plusPtr` headerSize

0 commit comments

Comments
 (0)