deontic-core-0.2.0.0: Type-level stratified deontic logic framework
Safe HaskellSafe-Inferred
LanguageGHC2021

Deontic.Render

Description

Rendering judgments as human-readable reasoning chains.

The Step type extracts the reasoning chain from a Judgment GADT. The Renderer typeclass allows jurisdiction-specific output formats.

Synopsis

Documentation

class Renderer r where Source #

Renderer typeclass — jurisdiction-specific output

Methods

renderJudgment :: r -> Judgment layers -> Text Source #

judgmentSteps :: Judgment layers -> [Step] Source #

Extract the reasoning steps from a Judgment GADT (bottom-up)

someJudgmentSteps :: SomeJudgment -> [Step] Source #

Extract steps from an existentially-wrapped judgment

data Step Source #

A single step in the reasoning chain

Instances

Instances details
Show Step Source # 
Instance details

Defined in Deontic.Render

Methods

showsPrec :: Int -> Step -> ShowS #

show :: Step -> String #

showList :: [Step] -> ShowS #

Eq Step Source # 
Instance details

Defined in Deontic.Render

Methods

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

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

data StepKind Source #

What happened at each layer of the reasoning chain.

Constructors

Applied

Base rule was applied directly

Overridden

This layer overrode a lower layer's verdict

Delegated

This layer delegated to a lower layer (no override)

Counterfactual

This layer applied a counterfactual (§150-style)

Instances

Instances details
Show StepKind Source # 
Instance details

Defined in Deontic.Render

Eq StepKind Source # 
Instance details

Defined in Deontic.Render