If I understand the situation correctly, the specification of the unfinished type in the signature FLAGimplies that it tremains opaque and, therefore, inaccessible to anything outside the structures that implement it FLAG.
, SML, , , , , . , , , , , ; , , . type t: , , .
, , , , . .
signature FLAG =
sig
datatype t = FLAG_1 | FLAG_2
end
signature MEMBER =
sig
structure Flag : FLAG
end
functor Member(F : FLAG) : MEMBER =
struct
structure Flag = F
end
structure M =
Member(struct
datatype t =
FLAG_1
| FLAG_2
end)
- val a = M.Flag.FLAG_1;
val a = FLAG_1 : ?.t
, , : , FLAG, , , functor Member. , , :
signature FLAG =
sig
type t
end
structure F : FLAG =
struct
datatype t =
FLAG_1
| FLAG_2
end
[opening ~/Programming/sml/scratch/scratch.sml]
signature FLAG = sig type t end
structure F : FLAG
val it = () : unit
- F.FLAG_1;
stdIn:63.1-63.9 Error: unbound variable or constructor: FLAG_1 in path F.FLAG_1