overeasy-0.2.0: A purely functional E-Graph library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Overeasy.Source

Description

See Source.

Synopsis

Documentation

data Source x Source #

A source of unique ids

Instances

Instances details
Generic (Source x) Source # 
Instance details

Defined in Overeasy.Source

Associated Types

type Rep (Source x) :: Type -> Type #

Methods

from :: Source x -> Rep (Source x) x0 #

to :: Rep (Source x) x0 -> Source x #

Show (Source x) Source # 
Instance details

Defined in Overeasy.Source

Methods

showsPrec :: Int -> Source x -> ShowS #

show :: Source x -> String #

showList :: [Source x] -> ShowS #

NFData (Source x) Source # 
Instance details

Defined in Overeasy.Source

Methods

rnf :: Source x -> () #

Eq (Source x) Source # 
Instance details

Defined in Overeasy.Source

Methods

(==) :: Source x -> Source x -> Bool #

(/=) :: Source x -> Source x -> Bool #

type Rep (Source x) Source # 
Instance details

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?

sourceNew :: Coercible x Int => x -> Source x Source #

Creates a new Source from a starting id

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)

sourceSkip :: Coercible x Int => x -> State (Source x) () Source #

Skips past the given id (statefully)

sourcePeek :: Coercible x Int => Source x -> x Source #

Peek at the next id