3 ms·
module Obirunda where import Control.Monad.State import Control.Monad.Writer import Data.Functor.Identity type Argument = String type Evidence = Maybe Stri
by handfuloflight 1y ago
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?
- obirunda 1y agoHaha wow, you're so so funny. You may have shown too much already. Also, be careful, you might be too smart. You're cute though