napkin-0.5.14
Safe HaskellSafe-Inferred
LanguageGHC2021

Napkin.Run.Effects.Languages.Assertion

Synopsis

Documentation

data Assertion m a where #

Assertion effects so we can skip past them in dry runs, and optionally throw exceptions or just collect them along the way for final reporting, etc..

Constructors

Assert' :: AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Assertion m ()

Assertions are run-time checks based on actual results that may be returned by various operations. Dry runs may ignore these failures, but they're respected in real operations.

Instances

Instances details
ToDumpItem (b :: k) (Assertion :: (Type -> Type) -> Type -> Type) # 
Instance details

Defined in Napkin.Run.Effects.Interceptors.LogProgram

Methods

toDumpItem :: forall (r :: EffectRow) (x :: k1). Assertion (Sem r) x -> DumpItem b #

GShow (Assertion a :: Type -> Type) # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Methods

gshowsPrec :: forall (a0 :: k). Int -> Assertion a a0 -> ShowS #

Show (Assertion a b) # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Methods

showsPrec :: Int -> Assertion a b -> ShowS #

show :: Assertion a b -> String #

showList :: [Assertion a b] -> ShowS #

Eq (Assertion a b) # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Methods

(==) :: Assertion a b -> Assertion a b -> Bool #

(/=) :: Assertion a b -> Assertion a b -> Bool #

newtype AssertionGroup #

Constructors

AssertionGroup [Text] 

Instances

Instances details
Monoid AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Semigroup AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Generic AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Associated Types

type Rep AssertionGroup :: Type -> Type #

Show AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Default AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Methods

def :: AssertionGroup #

Eq AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

type Rep AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

type Rep AssertionGroup = D1 ('MetaData "AssertionGroup" "Napkin.Run.Effects.Languages.Assertion" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'True) (C1 ('MetaCons "AssertionGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))

newtype AssertionLog #

Instances

Instances details
Monoid AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Semigroup AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Generic AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Associated Types

type Rep AssertionLog :: Type -> Type #

Show AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Eq AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

type Rep AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

type Rep AssertionLog = D1 ('MetaData "AssertionLog" "Napkin.Run.Effects.Languages.Assertion" "napkin-0.5.14-JrXUGmKUOt9J0meJSj0Kh4" 'True) (C1 ('MetaCons "AssertionLog" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AssertionEntry])))

data AssertionStatus #

Constructors

Success 
Failure (Maybe Text) 

assert' :: forall r. Member Assertion r => AssertionGroup -> AssertionSeverity -> Text -> AssertionStatus -> Sem r () #

Assertions are run-time checks based on actual results that may be returned by various operations. Dry runs may ignore these failures, but they're respected in real operations.

assertTrue :: Member Assertion r => Text -> Bool -> Sem r () #

assertEquals :: (Eq a, Member Assertion r) => Text -> a -> a -> Sem r () #

assertError :: Member Assertion r => Text -> Sem (Error Text ': r) () -> Sem r () #

failLater :: Member Assertion r => Sem r a -> Sem r a #

warnOnly :: Member Assertion r => Sem r a -> Sem r a #

describe :: Members [Assertion, Log] r => Text -> Sem r a -> Sem r a #

describe' :: Members [Assertion, Log] r => [Text] -> Sem r a -> Sem r a #