hydra-0.5.1: Type-aware transformations for data and programs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hydra.Compute

Description

Abstractions for single- and bidirectional transformations

Synopsis

Documentation

data Adapter s1 s2 t1 t2 v1 v2 Source #

A two-level bidirectional encoder which adapts types to types and terms to terms

Constructors

Adapter 

Fields

data Bicoder s1 s2 t1 t2 v1 v2 Source #

A two-level encoder and decoder, operating both at a type level and an instance (data) level

Constructors

Bicoder 

Fields

data Coder s1 s2 v1 v2 Source #

An encoder and decoder; a bidirectional flow between two types

Constructors

Coder 

Fields

newtype Flow s x Source #

A variant of the State monad with built-in logging and error handling

Constructors

Flow 

Fields

Instances

Instances details
MonadFail (Flow s) Source # 
Instance details

Defined in Hydra.Lib.Flows

Methods

fail :: String -> Flow s a #

Applicative (Flow s) Source # 
Instance details

Defined in Hydra.Lib.Flows

Methods

pure :: a -> Flow s a #

(<*>) :: Flow s (a -> b) -> Flow s a -> Flow s b #

liftA2 :: (a -> b -> c) -> Flow s a -> Flow s b -> Flow s c #

(*>) :: Flow s a -> Flow s b -> Flow s b #

(<*) :: Flow s a -> Flow s b -> Flow s a #

Functor (Flow s) Source # 
Instance details

Defined in Hydra.Lib.Flows

Methods

fmap :: (a -> b) -> Flow s a -> Flow s b #

(<$) :: a -> Flow s b -> Flow s a #

Monad (Flow s) Source # 
Instance details

Defined in Hydra.Lib.Flows

Methods

(>>=) :: Flow s a -> (a -> Flow s b) -> Flow s b #

(>>) :: Flow s a -> Flow s b -> Flow s b #

return :: a -> Flow s a #

data FlowState s x Source #

The result of evaluating a Flow

Constructors

FlowState 

Instances

Instances details
(Read x, Read s) => Read (FlowState s x) Source # 
Instance details

Defined in Hydra.Compute

(Show x, Show s) => Show (FlowState s x) Source # 
Instance details

Defined in Hydra.Compute

Methods

showsPrec :: Int -> FlowState s x -> ShowS #

show :: FlowState s x -> String #

showList :: [FlowState s x] -> ShowS #

(Eq x, Eq s) => Eq (FlowState s x) Source # 
Instance details

Defined in Hydra.Compute

Methods

(==) :: FlowState s x -> FlowState s x -> Bool #

(/=) :: FlowState s x -> FlowState s x -> Bool #

(Ord x, Ord s) => Ord (FlowState s x) Source # 
Instance details

Defined in Hydra.Compute

Methods

compare :: FlowState s x -> FlowState s x -> Ordering #

(<) :: FlowState s x -> FlowState s x -> Bool #

(<=) :: FlowState s x -> FlowState s x -> Bool #

(>) :: FlowState s x -> FlowState s x -> Bool #

(>=) :: FlowState s x -> FlowState s x -> Bool #

max :: FlowState s x -> FlowState s x -> FlowState s x #

min :: FlowState s x -> FlowState s x -> FlowState s x #

data Trace Source #

A container for logging and error information

Constructors

Trace 

Fields

Instances

Instances details
Read Trace Source # 
Instance details

Defined in Hydra.Compute

Show Trace Source # 
Instance details

Defined in Hydra.Compute

Methods

showsPrec :: Int -> Trace -> ShowS #

show :: Trace -> String #

showList :: [Trace] -> ShowS #

Eq Trace Source # 
Instance details

Defined in Hydra.Compute

Methods

(==) :: Trace -> Trace -> Bool #

(/=) :: Trace -> Trace -> Bool #

Ord Trace Source # 
Instance details

Defined in Hydra.Compute

Methods

compare :: Trace -> Trace -> Ordering #

(<) :: Trace -> Trace -> Bool #

(<=) :: Trace -> Trace -> Bool #

(>) :: Trace -> Trace -> Bool #

(>=) :: Trace -> Trace -> Bool #

max :: Trace -> Trace -> Trace #

min :: Trace -> Trace -> Trace #