Can somebody please explain the syntax of cell data type :
datatype 'a request = READ | WRITE of 'a
datatype 'a cell = CELL of {
reqCh : 'a request chan,
replyCh : 'a chan
}
Can somebody please explain the syntax of cell data type :
datatype 'a request = READ | WRITE of 'a
datatype 'a cell = CELL of {
reqCh : 'a request chan,
replyCh : 'a chan
}
Copyright © 2021 Jogjafile Inc.
I'm not really sure what you're confused by, but this should somewhat explain the types.
The datatype
'a cellhas one constructor,CELL, whose argument is a record with two fields:reqCh, which is an'a request chan, andreplyCh, which is an'a chan.You don't provide the definition of
chan, so I can't really clarify that. However, an'a requesthas two constructors,READandWRITE. The former has no argument, while the second takes an argument of type'a.For example, given some type
t, at request chanx, and ant chany, you could have something like: