Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



Haha 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: