iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Monad.Interactive

Documentation

class Monad m => MonadInteractive m where Source #

Minimal complete definition

sendStr, recvLine

Methods

sendStr :: String -> m () Source #

recvLine :: m String Source #

send :: Show a => a -> m () Source #

sendStrLn :: String -> m () Source #

recvLn :: Read a => m a Source #

type Result m r = m r Source #

type Accepted m r = Result m r Source #

type Failed m r = Result m r Source #

type Running a m r = a -> Result m r Source #

type JudgeInternal m a r = Accepted m r -> Failed m r -> Running a m r -> Result m r Source #

newtype Judge m a Source #

Constructors

Judge 

Fields

Instances

Instances details
MonadTrans (Judge :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

lift :: Monad m => m a -> Judge m a #

MonadFail (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

fail :: String -> Judge m a #

Alternative (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

empty :: Judge m a #

(<|>) :: Judge m a -> Judge m a -> Judge m a #

some :: Judge m a -> Judge m [a] #

many :: Judge m a -> Judge m [a] #

Applicative (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

pure :: a -> Judge m a #

(<*>) :: Judge m (a -> b) -> Judge m a -> Judge m b #

liftA2 :: (a -> b -> c) -> Judge m a -> Judge m b -> Judge m c #

(*>) :: Judge m a -> Judge m b -> Judge m b #

(<*) :: Judge m a -> Judge m b -> Judge m a #

Functor (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

fmap :: (a -> b) -> Judge m a -> Judge m b #

(<$) :: a -> Judge m b -> Judge m a #

Monad (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

(>>=) :: Judge m a -> (a -> Judge m b) -> Judge m b #

(>>) :: Judge m a -> Judge m b -> Judge m b #

return :: a -> Judge m a #

PrimMonad m => PrimMonad (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Associated Types

type PrimState (Judge m)

Methods

primitive :: (State# (PrimState (Judge m)) -> (# State# (PrimState (Judge m)), a #)) -> Judge m a

type PrimState (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

type PrimState (Judge m) = PrimState m