import RIO.Effect
import RIO.Effect.TH

data Teletype cfg a where
  GetL :: Teletype cfg String
  PutL :: String -> Teletype cfg ()

genSend ''Teletype

teletypeIO :: EFF Teletype cfg :~> MonadIO
teletypeIO =
  handleEffect $ \case
    GetL -> liftIO getLine
    PutL l -> liftIO ( putStrLn l )
