napkin-0.5.13
Safe HaskellNone
LanguageHaskell2010

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 :: k0). 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 #

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 #

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 #

newtype AssertionGroup #

Constructors

AssertionGroup [Text] 

Instances

Instances details
Eq AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Show 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 #

Semigroup AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Monoid AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Default AssertionGroup # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Methods

def :: AssertionGroup #

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.13-8705pBGlgyp7AIaYGNE2fM" 'True) (C1 ('MetaCons "AssertionGroup" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))

newtype AssertionLog #

Instances

Instances details
Eq AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Show 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 #

Semigroup AssertionLog # 
Instance details

Defined in Napkin.Run.Effects.Languages.Assertion

Monoid 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.13-8705pBGlgyp7AIaYGNE2fM" 'True) (C1 ('MetaCons "AssertionLog" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AssertionEntry])))

data AssertionStatus #

Constructors

Success 
Failure (Maybe Text) 

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 #