-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Actors with multi-headed receive clauses -- -- A Haskell library implementing Actors with Multi-Headed Message -- Receive Patterns COORDINATION'08 @package actor @version 0.1 module Actor.ActorSyntax data MatchTask a Prop :: a -> MatchTask a Simp :: a -> MatchTask a Guard :: (IO Bool) -> MatchTask a data WITHGUARD a WITHGUARD :: a -> (IO Bool) -> WITHGUARD a class ConvertHead a b | a -> b convertHead :: (ConvertHead a b) => a -> [MatchTask b] instance (ConvertHead b a) => ConvertHead (WITHGUARD b) a instance ConvertHead [a] a instance ConvertHead ([a], [a]) a module Actor.ActorBase type Tag = IORef () newTag :: IO (IORef ()) lookupTag :: [Tag] -> Tag -> Bool data VAR a VAR :: (IORef a) -> Tag -> VAR a variable :: VAR a -> (IORef a) var_tag :: VAR a -> Tag DontCare :: VAR a data L a Val :: a -> L a Var :: (VAR a) -> L a dontCareVar :: IO (VAR a) newVar :: IO (VAR a) readVar :: VAR a -> IO a writeVar :: VAR a -> a -> IO () class EMatch a match :: (EMatch a) => [Tag] -> a -> a -> IO (Bool, [Tag]) class Match a internal_match :: (Match a) => [Tag] -> (InternalMsg a) -> a -> IO (Bool, [Tag]) data InternalMsg a InternalMsg :: a -> Tag -> InternalMsg a message :: InternalMsg a -> a msg_tag :: InternalMsg a -> Tag instance (Eq a) => Eq (InternalMsg a) instance (Eq a) => Eq (L a) instance Eq (VAR a) instance (EMatch a) => Match a instance (Show a) => Show (InternalMsg a) instance (Eq a, EMatch a, Show a) => EMatch (L a) module Actor.ActorCompiler class (EMatch m) => Actor a m rm idx st | a -> m rm idx st, rm -> a getMessage :: (Actor a m rm idx st) => a -> Maybe Int -> IO (Maybe rm) deleteMsg :: (Actor a m rm idx st) => a -> rm -> IO () getIndex :: (Actor a m rm idx st) => a -> m -> IO idx initSearch :: (Actor a m rm idx st) => a -> idx -> IO st nextMsg :: (Actor a m rm idx st) => a -> st -> IO (Maybe rm) resetMB :: (Actor a m rm idx st) => a -> IO () extractMsg :: (Actor a m rm idx st) => rm -> IO (InternalMsg m) codeLookup :: (Actor a m rm idx st) => a -> Int -> IO (Maybe [CompClause a rm ()]) memoCode :: (Actor a m rm idx st) => a -> (Int, [CompClause a rm ()]) -> IO () data MemoFlag NoMemo :: MemoFlag Memo :: Int -> MemoFlag data ReceiveParameters RecParm :: MemoFlag -> IO () -> Maybe (Int, IO ()) -> ReceiveParameters memo :: ReceiveParameters -> MemoFlag resetAction :: ReceiveParameters -> IO () timeOut :: ReceiveParameters -> Maybe (Int, IO ()) type Code_RHS a = IO a type CompClause act rmsg code = rmsg -> act -> IO (Maybe (Code_RHS code)) receive :: (Actor act msg rmsg idx st, Show msg) => act -> [([MatchTask msg], Code_RHS a)] -> IO a receiveParm :: (Actor act msg rmsg idx st, Show msg) => act -> ReceiveParameters -> [([MatchTask msg], Code_RHS ())] -> IO () receiveInternal :: (Actor a m rm idx st, Show m) => a -> [CompClause a rm c] -> IO c receiveInternal2 :: (Actor a m rm idx st, Show m) => a -> ReceiveParameters -> [CompClause a rm ()] -> IO () select :: (Actor a m rm idx st) => rm -> a -> [CompClause a rm c] -> IO (Maybe (Code_RHS c)) compile :: (Actor act msg rmsg idx st, Show msg) => Code_RHS a -> [MatchTask msg] -> [CompClause act rmsg a] optimize :: [[MatchTask msg]] -> [[MatchTask msg]] permuteTasks :: [MatchTask msg] -> [[MatchTask msg]] compileSingle :: (Actor act msg rmsg idx st, Show msg) => act -> Code_RHS a -> [Tag] -> [MatchTask msg] -> IO (Maybe (Code_RHS a)) module Actor.ActorLinearSearch type HashIdx = Int data HashOp msg HashOp :: HashIdx -> (msg -> HashIdx) -> HashOp msg numberOfTables :: HashOp msg -> HashIdx hashMsg :: HashOp msg -> msg -> HashIdx data Act msg Act :: Chan msg -> SList (InternalMsg msg) -> Iterator (InternalMsg msg) -> IORef [(Int, [CompClause (Act msg) (Location msg) ()])] -> [QList (InternalMsg msg)] -> HashOp msg -> MVar ThreadId -> Act msg external_mailbox :: Act msg -> Chan msg internal_mailbox :: Act msg -> SList (InternalMsg msg) internal_mailbox_barrier :: Act msg -> Iterator (InternalMsg msg) memoTable :: Act msg -> IORef [(Int, [CompClause (Act msg) (Location msg) ()])] hashTable :: Act msg -> [QList (InternalMsg msg)] hashOp :: Act msg -> HashOp msg thread_id :: Act msg -> MVar ThreadId type PID msg = (Chan msg, MVar ThreadId) type Location msg = IORef (Item (InternalMsg msg)) actorToPID :: Act msg -> PID msg kill :: PID msg -> IO () send :: PID msg -> msg -> IO () createActor :: HashOp msg -> IO (Act msg) runActor :: Act msg -> (Act msg -> IO ()) -> IO () instance (EMatch msg, Eq msg, Show msg) => Actor (Act msg) msg (Location msg) HashIdx (QIterator (InternalMsg msg))