LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.RingBuffer

Description

Ring buffers.

Synopsis

- data RingBuffer a
- empty :: Int -> a -> RingBuffer a
- cons :: a -> RingBuffer a -> RingBuffer a
- toList :: RingBuffer a -> [a]
- length :: RingBuffer a -> Int

# Documentation

data RingBuffer a Source #

Ring buffers of a size determined at initialization.

#### Instances

Instances details

Binary a => Binary (RingBuffer a) Source # |
Instance details Defined in Game.LambdaHack.Common.RingBuffer Methods put :: RingBuffer a -> Put Source # get :: Get (RingBuffer a) Source # putList :: [RingBuffer a] -> Put Source #
Generic (RingBuffer a) Source # |

Instance details

Defined in Game.LambdaHack.Common.RingBuffer

Associated Types

type Rep (RingBuffer a) |

Instance details

Defined in Game.LambdaHack.Common.RingBuffer

type Rep (RingBuffer a) = D1 ('MetaData "RingBuffer" "Game.LambdaHack.Common.RingBuffer" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "RingBuffer" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rbCarrier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq a)) :*: S1 ('MetaSel ('Just "rbMaxSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "rbNext") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "rbLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

Methods

from :: RingBuffer a -> Rep (RingBuffer a) x Source #

to :: Rep (RingBuffer a) x -> RingBuffer a Source #

Show a => Show (RingBuffer a) Source # |
Instance details Defined in Game.LambdaHack.Common.RingBuffer Methods showsPrec :: Int -> RingBuffer a -> ShowS Source # show :: RingBuffer a -> String Source # showList :: [RingBuffer a] -> ShowS Source #
type Rep (RingBuffer a) Source # |

Instance details

Defined in Game.LambdaHack.Common.RingBuffer

type Rep (RingBuffer a) = D1 ('MetaData "RingBuffer" "Game.LambdaHack.Common.RingBuffer" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "RingBuffer" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rbCarrier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq a)) :*: S1 ('MetaSel ('Just "rbMaxSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "rbNext") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "rbLength") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

empty :: Int -> a -> RingBuffer a Source #

cons :: a -> RingBuffer a -> RingBuffer a Source #

toList :: RingBuffer a -> [a] Source #

length :: RingBuffer a -> Int Source #