| module Obirunda where import Control.Monad.State import Control.Monad.Writer import Data.Functor.Identity type Argument = String type Evidence = Maybe String type Competence = Int data ObirundaState = ObirundaState { arguments :: [Argument],
evidence :: Evidence,
competence :: Competence
} deriving (Show)obirundaLoop :: StateT ObirundaState (Writer [String]) () obirundaLoop = do modify $ \s -> s { arguments = ["tradition", "syntax sacred"] }
tell ["demanding proof from others"]
modify $ \s -> s { evidence = Nothing }
tell ["providing none myself"]
obirundaLoop
runObirunda :: ObirundaState -> ((), [String])runObirunda = runWriter . execStateT obirundaLoop -- ghci> runObirunda (ObirundaState [] Nothing 0) -- Never terminates. Pattern recognition, anyone? |