things still typecheck

This commit is contained in:
Yehowshua Immanuel 2025-04-09 01:08:42 -04:00
parent 989c4e9616
commit b4c7537a85
3 changed files with 31 additions and 43 deletions

View file

@ -1,5 +1,5 @@
package BusTypes(
ClientTagType,
MkClientTagType,
BusClient(..), BusServer(..),
BusRequest(..), BusResponse(..),
ReadRequest(..), ReadResponse(..), WriteRequest(..), WriteResponse(..),
@ -10,7 +10,7 @@ import Types
import Vector
import TagEngine
type ClientTagType a = (UInt (TLog a))
type MkClientTagType a = (UInt (TLog a))
data BusError
= UnMapped
@ -72,33 +72,27 @@ data BusResponse
-- by the arbiter until the client is ready to accept the response.
-- In other words, the response method should be guarded by the client.
interface (BusClient :: # -> *) inFlightTransactions =
dequeueRequest :: TagType inFlightTransactions
dequeueRequest :: MkTagType inFlightTransactions
-> ActionValue BusRequest
enqueueResponse :: (BusResponse, TagType inFlightTransactions)
enqueueResponse :: (BusResponse, MkTagType inFlightTransactions)
-> Action
-- # BusServer.dequeueResponse
-- * If the arbiter is able to successfully call `dequeueResponse`, then
-- the BusServer's internal logici must update such that it understand
-- the BusServer's internal logic must update such that it understands
-- the response has been handed off.
-- # BusServer.peekClientTagDestination
-- * The arbiter looks at (peekClientTagDestination :: clientTagType) to
-- * The arbiter looks at (peekClientTagDestination :: MkClientTagType) to
-- determine whether or not it is currently safe whether to dequeue the
-- response as well as where to route the response should it dequeue the
-- response.
-- * `peekClientTagDestination` should be guarded on whether or not there is
-- a valid response available.
interface (BusServer :: # -> # -> *) inFlightTransactions numClients =
enqueueRequest :: (TagType inFlightTransactions, BusRequest)
enqueueRequest :: (MkTagType inFlightTransactions, BusRequest)
-> Action
dequeueResponse :: ActionValue (
ClientTagType numClients,
MkClientTagType numClients,
BusResponse, transactionTagType
)
peekClientTagDestination :: clientTagType
type Token = UInt 5
type Numeric = 5
a :: UInt 5
a = 3
peekClientTagDestination :: MkClientTagType numClients