-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Remote Management Framework -- -- Please see the README on GitHub at -- https://github.com/martin-bednar/managed-functions#readme @package managed-functions @version 1.1.0.0 module Data.Managed.Encoding class Encoding a where { type family In a :: Type; type family Out a :: Type; } class Encode t rep encode :: Encode t rep => t -> Out rep class Decode t rep decode :: Decode t rep => In rep -> Maybe t withEncoding :: forall e i o. (Encode o e, Decode i e) => (i -> o) -> In e -> Maybe (Out e) module Data.Managed.Encodings.ShowRead data SR instance Data.Managed.Encoding.Encoding Data.Managed.Encodings.ShowRead.SR instance GHC.Show.Show a => Data.Managed.Encoding.Encode a Data.Managed.Encodings.ShowRead.SR instance GHC.Read.Read a => Data.Managed.Encoding.Decode a Data.Managed.Encodings.ShowRead.SR module Data.Managed.Probe data Probe e Probe :: ([In e] -> IO (Out e)) -> TypeRep -> Probe e [call] :: Probe e -> [In e] -> IO (Out e) [typeRep] :: Probe e -> TypeRep instance GHC.Show.Show (Data.Managed.Probe.Probe e) module Data.Managed.Agent type ProbeID = String type Agent e = Map ProbeID (Probe e) module Data.Managed.Connector newtype Connector e Connector :: (Agent e -> IO ()) -> Connector e [run] :: Connector e -> Agent e -> IO () module Data.Managed.ProbeDescription data ProbeDescription ProbeDescription :: ProbeID -> String -> [String] -> String -> ProbeDescription [probeID] :: ProbeDescription -> ProbeID [probeType] :: ProbeDescription -> String [probeParams] :: ProbeDescription -> [String] [probeReturns] :: ProbeDescription -> String instance GHC.Generics.Generic Data.Managed.ProbeDescription.ProbeDescription instance GHC.Classes.Eq Data.Managed.ProbeDescription.ProbeDescription instance GHC.Show.Show Data.Managed.ProbeDescription.ProbeDescription module Data.Managed module Managed.Exception data AgentException BadProbeID :: ProbeID -> AgentException BadNumberOfArguments :: Int -> Int -> AgentException NoParseArgument :: AgentException ProbeRuntimeException :: String -> AgentException -- | Throw an exception. Note that this throws when this action is run in -- the monad m, not when it is applied. It is a generalization -- of Control.Exception's throwIO. -- -- Should satisfy the law: -- --
-- throwM e >> f = throwM e --throwM :: (MonadThrow m, Exception e) => e -> m a explain :: AgentException -> String badNumberOfArgs :: Int -> [a] -> AgentException noParseArg :: AgentException probeRuntimeException :: SomeException -> AgentException badProbeID :: ProbeID -> AgentException instance GHC.Generics.Generic Managed.Exception.AgentException instance GHC.Classes.Eq Managed.Exception.AgentException instance GHC.Show.Show Managed.Exception.AgentException instance GHC.Exception.Type.Exception Managed.Exception.AgentException module Managed.Probe.Internal.Params params :: TypeRep -> [TypeRep] paramsCnt :: TypeRep -> Int returns :: TypeRep -> TypeRep module Managed.Probe params :: Probe e -> [TypeRep] returns :: Probe e -> TypeRep module Managed.Probe.ToProbe -- | Converts any suitable function to a Probe toProbe :: forall e fn. (Typeable fn, ToProbe fn e) => fn -> Probe e -- | Class of functions that can be converted to a Probe class ToProbe fn e -- | Read arguments from a list, apply them to a function, and encode the -- result apply :: ToProbe fn e => Proxy e -> fn -> [In e] -> IO (Out e) instance Data.Managed.Encoding.Encode a e => Managed.Probe.ToProbe.ToProbe a e instance Data.Managed.Encoding.Encode a e => Managed.Probe.ToProbe.ToProbe (GHC.Types.IO a) e instance (Data.Managed.Encoding.Decode a e, Managed.Probe.ToProbe.ToProbe b e) => Managed.Probe.ToProbe.ToProbe (a -> b) e module Managed.ProbeDescription mkDescription :: ProbeID -> Probe e -> ProbeDescription -- | Create a human-readable description from a ProbeDescription human :: ProbeDescription -> String module Managed.Agent -- | fromList specialized to Agent fromList :: [(ProbeID, Probe e)] -> Agent e -- | toList specialized to Agent toList :: Agent e -> [(ProbeID, Probe e)] -- | ! specialized to Agent (!) :: Agent e -> ProbeID -> Probe e infixl 9 ! -- | !? specialized to Agent (!?) :: Agent e -> ProbeID -> Maybe (Probe e) infixl 9 !? -- | Invokes (calls) a Probe. -- -- This function never throws an exception, instead, an Either is -- used. Any errors and exceptions caused by incorrect ProbeID, -- incorrect input parameters, or by the probe call itself are caught and -- passed as an AgentException. -- -- The result is fully evaluated using force before it's returned -- (to keep all exceptions inside the Either). invoke :: NFData (Out e) => Agent e -> ProbeID -> [In e] -> IO (Either AgentException (Out e)) -- | List all Probe IDs ids :: Agent e -> [ProbeID] -- | An unsafe variant of invoke. -- -- This function rethrows all exceptions and errors caused by probe -- lookup or input parameters. Exceptions caused by probe invocation are -- rethrown as ProbeRuntimeException. invokeUnsafe :: NFData (Out e) => Agent e -> ProbeID -> [In e] -> IO (Out e) -- | Create a full description of a Probe describe :: Agent e -> ProbeID -> Maybe ProbeDescription -- | A variant of describe that returns Either instead of -- Maybe describeEither :: Agent e -> ProbeID -> Either AgentException ProbeDescription -- | Create a human-readable description of a probe describeHuman :: Agent e -> ProbeID -> Maybe String module Managed