Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
See Source
.
Synopsis
- data Source x
- sourceSize :: Source x -> Int
- sourceNew :: Coercible x Int => x -> Source x
- sourceAddInc :: Coercible x Int => Source x -> (x, Source x)
- sourceAdd :: Coercible x Int => State (Source x) x
- sourceSkipInc :: Coercible x Int => x -> Source x -> Source x
- sourceSkip :: Coercible x Int => x -> State (Source x) ()
- sourcePeek :: Coercible x Int => Source x -> x
Documentation
A source of unique ids
Instances
Generic (Source x) Source # | |
Show (Source x) Source # | |
NFData (Source x) Source # | |
Defined in Overeasy.Source | |
Eq (Source x) Source # | |
type Rep (Source x) Source # | |
Defined in Overeasy.Source type Rep (Source x) = D1 ('MetaData "Source" "Overeasy.Source" "overeasy-0.2.0-7Shit7pE5Ru2Ny0HoLxUG4" 'False) (C1 ('MetaCons "Source" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "sourceNextId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) |
sourceSize :: Source x -> Int Source #
How many ids have ever been created?
sourceAddInc :: Coercible x Int => Source x -> (x, Source x) Source #
Generates the next id from the source (purely)
sourceAdd :: Coercible x Int => State (Source x) x Source #
Generates the next id from the source (statefully)
sourceSkipInc :: Coercible x Int => x -> Source x -> Source x Source #
Skips past the given id (purely)