basement-0.0.16: Foundation scrap box of array & string

Safe Haskell | None
Language | Haskell2010

Basement.MutableBuilder

Synopsis

- newtype Builder collection (mutCollection :: Type -> Type) step (state :: Type -> Type) err a = Builder {
  - runBuilder :: State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a
  }
- data BuildingState collection (mutCollection :: Type -> Type) step state = BuildingState {
  - prevChunks :: [collection]
  - prevChunksSize :: !(CountOf step)
  - curChunk :: mutCollection state
  - chunkSize :: !(CountOf step)
  }

# Documentation

newtype Builder collection (mutCollection :: Type -> Type) step (state :: Type -> Type) err a #

Constructors

Builder |

Fields

- runBuilder :: State (Offset step, BuildingState collection mutCollection step (PrimState state), Maybe err) state a

#### Instances

Instances details

Monad state => MonadFailure (Builder collection mutCollection step state err) # |

Instance details

Defined in Basement.MutableBuilder

Associated Types

type Failure (Builder collection mutCollection step state err) |
Instance details Defined in Basement.MutableBuilder type Failure (Builder collection mutCollection step state err) = err

Methods

mFail :: Failure (Builder collection mutCollection step state err) -> Builder collection mutCollection step state err () #

Monad state => Applicative (Builder collection mutCollection step state err) # |

Instance details

Defined in Basement.MutableBuilder

Methods

pure :: a -> Builder collection mutCollection step state err a #

(<*>) :: Builder collection mutCollection step state err (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b #

liftA2 :: (a -> b -> c) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err c #

(*>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b #

(<*) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a #

Monad state => Functor (Builder collection mutCollection step state err) # |
Instance details Defined in Basement.MutableBuilder Methods fmap :: (a -> b) -> Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b # (<$) :: a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err a #
Monad state => Monad (Builder collection mutCollection step state err) # |

Instance details

Defined in Basement.MutableBuilder

Methods

(>>=) :: Builder collection mutCollection step state err a -> (a -> Builder collection mutCollection step state err b) -> Builder collection mutCollection step state err b #

(>>) :: Builder collection mutCollection step state err a -> Builder collection mutCollection step state err b -> Builder collection mutCollection step state err b #

return :: a -> Builder collection mutCollection step state err a #

type Failure (Builder collection mutCollection step state err) # |
Instance details Defined in Basement.MutableBuilder type Failure (Builder collection mutCollection step state err) = err

data BuildingState collection (mutCollection :: Type -> Type) step state #

The in-progress state of a building operation.

The previous buffers are in reverse order, and this contains the current buffer and the state of progress packing the elements inside.

Constructors

BuildingState |

Fields

- prevChunks :: [collection]
- prevChunksSize :: !(CountOf step)
- curChunk :: mutCollection state
- chunkSize :: !(CountOf step)