0 | module TyTTP.Core.Context
2 | import public Control.Monad.Trans
3 | import TyTTP.Core.Request
4 | import TyTTP.Core.Response
7 | record Context me u v h1 s h2 a b where
8 | constructor MkContext
9 | request : Request me u v h1 a
10 | response : Response s h2 b
13 | Functor (Context me u v h1 s h2 a) where
14 | map f step = { response $= map f } step
17 | Bifunctor (Context me u v h1 s h2) where
18 | bimap f g step = { request $= map f, response $= map g } step
29 | => (f : (a -> (t m) b) -> c)
30 | -> (handler : a -> m b)
32 | (:>) f handler = f $
\a => lift $
handler a
35 | (:>>) : MonadTrans t1
39 | => (f : (a -> (t2 (t1 m)) b) -> c)
40 | -> (handler : a -> m b)
42 | (:>>) f handler = f $
\a => lift $
lift $
handler a