iota-0.1.0.0
Safe HaskellNone
LanguageGHC2021

Control.Monad.Interactive

Documentation

class Monad m => MonadInteractive (m :: Type -> Type) 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 :: k1 -> k) (r :: k1) = m r Source #

type Accepted (m :: k1 -> k) (r :: k1) = Result m r Source #

type Failed (m :: k1 -> k) (r :: k1) = Result m r Source #

type Running a (m :: k -> Type) (r :: k) = a -> Result m r Source #

type JudgeInternal (m :: k -> Type) a (r :: k) = Accepted m r -> Failed m r -> Running a m r -> Result m r Source #

newtype Judge (m :: k -> Type) 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 #

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 #

MonadFail (Judge m) Source # 
Instance details

Defined in Control.Monad.Interactive

Methods

fail :: String -> Judge m a #

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

Defined in Control.Monad.Interactive

Associated Types

type PrimState (Judge m) 
Instance details

Defined in Control.Monad.Interactive

type PrimState (Judge m) = PrimState 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