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

Overeasy.Util

Description

A grab bag of fun stuff.

Synopsis

Documentation

type Whole t f = f ~ Base t Source #

Often f is primary, not t. Relate them with this constraint.

type RecursiveWhole t f = (Recursive t, Whole t f) Source #

Constraint for recursive structures

foldWholeM :: (RecursiveWhole t f, Traversable f, Monad m) => (f a -> m a) -> t -> m a Source #

Traverses a recursive structure

data Changed Source #

A nicely-named Bool for tracking state changes

Constructors

ChangedNo 
ChangedYes 

Instances

Instances details
Monoid Changed Source # 
Instance details

Defined in Overeasy.Util

Semigroup Changed Source # 
Instance details

Defined in Overeasy.Util

Generic Changed Source # 
Instance details

Defined in Overeasy.Util

Associated Types

type Rep Changed :: Type -> Type #

Methods

from :: Changed -> Rep Changed x #

to :: Rep Changed x -> Changed #

Show Changed Source # 
Instance details

Defined in Overeasy.Util

NFData Changed Source # 
Instance details

Defined in Overeasy.Util

Methods

rnf :: Changed -> () #

Eq Changed Source # 
Instance details

Defined in Overeasy.Util

Methods

(==) :: Changed -> Changed -> Bool #

(/=) :: Changed -> Changed -> Bool #

Ord Changed Source # 
Instance details

Defined in Overeasy.Util

Hashable Changed Source # 
Instance details

Defined in Overeasy.Util

Methods

hashWithSalt :: Int -> Changed -> Int #

hash :: Changed -> Int #

type Rep Changed Source # 
Instance details

Defined in Overeasy.Util

type Rep Changed = D1 ('MetaData "Changed" "Overeasy.Util" "overeasy-0.2.0-7Shit7pE5Ru2Ny0HoLxUG4" 'False) (C1 ('MetaCons "ChangedNo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ChangedYes" 'PrefixI 'False) (U1 :: Type -> Type))

stateFail :: (s -> Maybe (b, s)) -> State s (Maybe b) Source #

Embeds a function that may fail in a stateful context

stateOption :: (s -> (b, Maybe s)) -> State s b Source #

Embeds a function that may fail in a stateful context

stateFailChanged :: (s -> Maybe s) -> State s Changed Source #

Embeds a function that may fail in a stateful context with change tracking

stateFold :: Foldable t => b -> t a -> (b -> a -> State s b) -> State s b Source #

foldM specialized and flipped.