top-0.2.4: Top (typed oriented protocol) API

Safe HaskellNone
LanguageHaskell2010

Network.Top.Repo

Description

Permanently register and retrieve absolute type definitions

Synopsis

Documentation

data RepoProtocol Source #

A (simplistic) protocol to permanently store and retrieve ADT definitions.

Constructors

Record AbsADT

Permanently record an absolute type

Solve AbsRef

Retrieve the absolute type

Solved AbsRef AbsADT

Return the absolute type identified by an absolute reference

AskDataTypes

Request the list of all known data types

KnownDataTypes [(AbsRef, AbsADT)]

Return the list of all known data types

Instances

Eq RepoProtocol Source # 
Ord RepoProtocol Source # 
Show RepoProtocol Source # 
Generic RepoProtocol Source # 

Associated Types

type Rep RepoProtocol :: * -> * #

Flat RepoProtocol Source # 
Model RepoProtocol Source # 
type Rep RepoProtocol Source # 

recordType :: Model a => Config -> Proxy a -> IO () Source #

Permanently record all the ADT definitions referred by a type, with all their dependencies

recordADTs :: Foldable t => Config -> t AbsADT -> IO () Source #

Permanently record a set of ADT definitions with all their dependencies

solveType :: Repo -> Config -> AbsType -> IO (Either RepoError AbsTypeModel) Source #

Retrieve the full type model for the given absolute type from Top's RepoProtocol channel, using the given Repo as a cache

solveRefs :: Repo -> Config -> [AbsRef] -> IO (Either RepoError (Map AbsRef AbsADT)) Source #

Solve ADT references recursively, returning all dependencies.

knownTypes :: Config -> IO (Either String [(AbsRef, AbsADT)]) Source #

Retrieve all known data types