top-0.2.2: 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 an ADT definition

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

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

Retrieve all known data types