Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Control.Computation
- data a ~> b
- type Resourceful = (~>)
- data Blank
- data a ** b
- data a -: b
- class ResourceFunction a => Resource a where
- data Anchor a = forall h . Anchor (a ~> AtomicResource h) (AtomicResource h ~> a)
- type Attr a v = Property a a v
- unsafeToAttr :: (h -> IO v) -> Attr (AtomicResource h) v
- newtype Property a b v = Property (forall h. (v -> b ~> AtomicResource h) -> a ~> AtomicResource h)
- (^>) :: (a -> b) -> Property b c v -> Property a c v
- (>^) :: Property a b v -> (b -> c) -> Property a c v
- (^^>) :: (a ~> b) -> Property b c v -> Property a c v
- (>^^) :: Property a b v -> (b ~> c) -> Property a c v
- unsafeToProperty :: (h -> IO (v, k)) -> Property (AtomicResource h) (AtomicResource k) v
- class ResourceFunction r where
- class ResourceValue a where
- data Annotator a
- data AtomicResource h
- unsafeToResourceConv :: (h -> IO k) -> AtomicResource h ~> AtomicResource k
- fromResourceConv :: (AtomicResource h ~> AtomicResource k) -> h -> IO k
- toUnitResource :: Blank ~> AtomicResource ()
- fromUnitResource :: AtomicResource () ~> Blank
- toPairResource :: (AtomicResource h ** AtomicResource k) ~> AtomicResource (h, k)
- fromPairResource :: AtomicResource (h, k) ~> (AtomicResource h ** AtomicResource k)
Computations
module Control.Computation
Resourceful computations
Arrow (~>) | |
ArrowChoice (~>) | |
Computation Resourceful | |
Category * (~>) | |
Connected Pure Resourceful | |
Link ((==>) Pure Resourceful) | |
Link ((<==) Pure Resourceful) | |
ResourceValue ((==>) Pure Resourceful a) | |
type Unit Resourceful = Blank | |
type Pair Resourceful = (**) | |
type Function Resourceful = (-:) | |
data Pure ==> Resourceful = Up {} | |
data Pure <== Resourceful = Down {
| |
type DropResult Resourceful a = ResourceValue a | |
type Source ((==>) Pure Resourceful) = Pure | |
type Source ((<==) Pure Resourceful) = Resourceful | |
type Target ((==>) Pure Resourceful) = Resourceful | |
type Target ((<==) Pure Resourceful) = Pure |
type Resourceful = (~>) Source
ResourceValue a => ResourceValue ((**) a b) | |
(Resource a, Resource b) => ResourceFunction ((**) a b) | |
(Resource a, Resource b) => Resource ((**) a b) | |
Typeable (* -> * -> *) (**) |
ResourceValue b => ResourceValue ((-:) a b) | |
ResourceFunction b => ResourceFunction ((-:) a b) | |
Typeable (* -> * -> *) (-:) |
Resources
class ResourceFunction a => Resource a where Source
forall h . Anchor (a ~> AtomicResource h) (AtomicResource h ~> a) |
Attributes
unsafeToAttr :: (h -> IO v) -> Attr (AtomicResource h) v Source
Property (forall h. (v -> b ~> AtomicResource h) -> a ~> AtomicResource h) |
unsafeToProperty :: (h -> IO (v, k)) -> Property (AtomicResource h) (AtomicResource k) v Source
class ResourceFunction r where Source
ResourceFunction Blank | |
ResourceFunction (AtomicResource h) | |
ResourceFunction b => ResourceFunction ((-:) a b) | |
(Resource a, Resource b) => ResourceFunction ((**) a b) | |
Typeable (* -> Constraint) ResourceFunction |
Resource values
class ResourceValue a where Source
Nothing
Atomic resources
data AtomicResource h Source
ResourceValue (AtomicResource h) | |
ResourceFunction (AtomicResource h) | |
Resource (AtomicResource h) | |
Typeable (* -> *) AtomicResource |
unsafeToResourceConv :: (h -> IO k) -> AtomicResource h ~> AtomicResource k Source
fromResourceConv :: (AtomicResource h ~> AtomicResource k) -> h -> IO k Source
toPairResource :: (AtomicResource h ** AtomicResource k) ~> AtomicResource (h, k) Source
fromPairResource :: AtomicResource (h, k) ~> (AtomicResource h ** AtomicResource k) Source