module Foundation.Boot.Builder
( Builder(..)
, BuildingState(..)
) where
import Foundation.Internal.Base
import Foundation.Internal.MonadTrans
import Foundation.Primitive.Types.OffsetSize
import Foundation.Primitive.Monad
newtype Builder collection mutCollection step state a = Builder
{ runBuilder :: State (Offset step, BuildingState collection mutCollection step (PrimState state)) state a }
deriving (Functor, Applicative, Monad)
data BuildingState collection mutCollection step state = BuildingState
{ prevChunks :: [collection]
, prevChunksSize :: !(CountOf step)
, curChunk :: mutCollection state
, chunkSize :: !(CountOf step)
}