on master help sign in
26 lines 464 B history raw
1module Control.Task
2 ( Task (..),
3 Result (..),
4 )
5where
7import Colog
8import Data.Aeson hiding (Result)
9import Data.Kind
10import GHC.Generics
11import GHC.TypeLits
13data Result
14 = Success
15 | Failure
16 deriving (Eq, Ord, Show, Generic)
18class
19 (ToJSON t, FromJSON t, KnownSymbol s, Show t) =>
20 Task t s
21 | s -> t,
22 t -> s where
24 type TaskMonad t (m :: * -> *) :: Constraint
26 performTask :: (TaskMonad t m, WithLog env Message m) => t -> m Result