sessions-2008.2.28: Session Types for HaskellContentsIndex
Control.Concurrent.Session.SessionType
Description

This module is concerned with allowing you to describe a session type. A session type is treated as a table or 2D array, where each row represents a particular session type function which can refer, by index, to the other rows.

Basically, what you have here is the ability to describe a program at the type level.

Just look at Control.Concurrent.Session.Tests for examples

Documentation
data End
Constructors
End
show/hide Instances
end :: Cons End Nil
data Send where
Constructors
Send :: t -> Send t
SendInt :: Send Int
SendBool :: Send Bool
SendChar :: Send Char
SendStr :: Send String
SendDouble :: Send Double
show/hide Instances
data Recv where
Constructors
Recv :: t -> Recv t
RecvInt :: Recv Int
RecvBool :: Recv Bool
RecvChar :: Recv Char
RecvStr :: Recv String
RecvDouble :: Recv Double
show/hide Instances
data Jump l
Constructors
Jump l
show/hide Instances
Show l => Show (Jump l)
TyNum l => STerminal (Jump l)
SmallerThan l idx => SNoJumpsBeyond (Jump l) idx
Dual (Jump l) (Jump l)
jump :: TyNum n => n -> Cons (Jump n) Nil
data Select where
Constructors
Select :: lstOfLabels -> Select lstOfLabels
show/hide Instances
SListOfJumps (Cons val nxt) => STerminal (Select (Cons val nxt))
SNoJumpsBeyond lol idx => SNoJumpsBeyond (Select lol) idx
Dual (Offer lst) (Select lst)
Dual (Select lst) (Offer lst)
select :: SListOfJumps (Cons val nxt) => (Cons val nxt) -> Cons (Select (Cons val nxt)) Nil
data Offer where
Constructors
Offer :: lstOfLabels -> Offer lstOfLabels
show/hide Instances
SListOfJumps (Cons val nxt) => STerminal (Offer (Cons val nxt))
SNoJumpsBeyond lol idx => SNoJumpsBeyond (Offer lol) idx
Dual (Offer lst) (Select lst)
Dual (Select lst) (Offer lst)
offer :: SListOfJumps (Cons val nxt) => (Cons val nxt) -> Cons (Offer (Cons val nxt)) Nil
class Dual a b | a -> b, b -> a where
Methods
dual :: a -> b
show/hide Instances
Dual Nil Nil
Dual End End
Dual (Recv t) (Send t)
Dual (Recv t) (Send t)
Dual (Send t) (Recv t)
Dual (Send t) (Recv t)
Dual (Offer lst) (Select lst)
Dual (Offer lst) (Select lst)
Dual (Select lst) (Offer lst)
Dual (Select lst) (Offer lst)
Dual (Jump l) (Jump l)
(TyList nxt, TyList nxt', Dual val val', Dual nxt nxt') => Dual (Cons val nxt) (Cons val' nxt')
class SListOfJumps lst
show/hide Instances
class SListOfSessionTypes lstOfLists
show/hide Instances
class SNonTerminal a
show/hide Instances
class STerminal a
show/hide Instances
STerminal End
SListOfJumps (Cons val nxt) => STerminal (Offer (Cons val nxt))
SListOfJumps (Cons val nxt) => STerminal (Select (Cons val nxt))
TyNum l => STerminal (Jump l)
class SValidSessionType lst
show/hide Instances
(~>) :: (TyList nxt, SNonTerminal a, SValidSessionType nxt) => a -> nxt -> (Cons a nxt)
(~|~) :: (TyNum target, TyList nxt) => target -> nxt -> Cons (Cons (Jump target) Nil) nxt
class SNoJumpsBeyond s idx
show/hide Instances
class SWellFormedConfig idxA idxB ss
testWellformed :: SWellFormedConfig idxA idxB ss => ss -> idxA -> idxB -> Bool
data Choice where
Constructors
Choice :: lstOfLabels -> Choice lstOfLabels
class OnlyOutgoing a b | a -> b where
Methods
onlyOutgoing :: a -> b
show/hide Instances
(OnlyOutgoing nxt nxt', TyList nxt, TyList nxt') => OnlyOutgoing (Cons (Recv t) nxt) nxt'
(OnlyOutgoing nxt nxt', TyList nxt, TyList nxt') => OnlyOutgoing (Cons (Send t) nxt) (Cons t nxt')
OnlyOutgoing (Cons (Offer jl) Nil) (Cons (Choice jl) Nil)
OnlyOutgoing (Cons (Select jl) Nil) (Cons (Choice jl) Nil)
OnlyOutgoing (Cons (Jump l) Nil) (Cons (Jump l) Nil)
OnlyOutgoing (Cons End Nil) (Cons End Nil)
Produced by Haddock version 2.1.0