Special Interfaces MlDoC dot commands

The special interfaces are used to show ML or C functions, types, submodules and values. Only the content must be given by the user, not the alignment. Commonly, they are collected in an interface subunit.

Available special interfaces
Name begin end Subarguments (*=optional, #=multiple)
ML-Function .IF .FI Name, RetVal (#), Arg (#), Val (*#)
ML-Value .IV .VI Name, Arg (#)
ML-Type (type list) .IT .TI Name, Arg (#)
ML-Structure (type) .IS .SI Name, Arg (*#)
ML-Module .IM .MI Name, other specials
ML-Class .CS .SC Name, Arg [*#], Obj
ML-Class method .MT .TM Name, Arg
C-Header .CH .HC
C-Function .CF .FC Name, Arg (#) , RetVal
C-Variable .CV .VC Name, Arg

The followinf subarguments used only in special interfaces, except the Name command and the Comment command:

Available subarguments
Name Description begin end
Name Name of function,... .NA .AN
Comment Placed before the special interface .(* .*)
RetVal Return value of a function (uncurried subvalue) .RV .VR
Arg Argument of a function (curried value) .AR .RA
Val Value argument of a function (uncurried subvalue) .AV .VA
Obj Class object .OB .BO

Either the curried value form or the uncurried value form must be used for the function interface.
Here is an example for an interface with functions:

Programming Interface: Function interfaces
ret1 : int *    The first return argument
ret2 : bool  ]  =  myfun1    The second one.
~arg1 : float ->   The first fun arg
~arg2 : string list    The second one.
ret1 : bool  ]  =  myfun2
arg1 : float *
arg2 : string list
#include   < sys/io.h
int   cfun  ( float arg1 ,
char arg2  );
   The first value interface
val  myval   arg1 : string ->   The arg string
arg2 : int ->
retarg : float

The first and the second interfaces show a ML-Function, and the third one is a C-Function interface. This way to display ML-functions is different from the one commonly used in ML interfaces, but more readable. There is also a generic ML-value interface, shown in the fourth part of the example. In the second ML-function an uncurried value tuple is used for the function argument. Either the curried or the uncurried form must be used. The required programming code to get this beauty ML-interfaces is easy to create:

.IN 
    .NA Function interfaces .AN 
    .IF 
        .NA myfun1 .AN 
        .RV ret1:int .(* The first return argument .*) .VR 
        .RV ret2:bool .(* The second one .*) .VR 
        .AR ~arg1:float .(* The first fun arg .*) .RA 
        .AR ~arg2:string list .(* The second one .*) .RA 
    .FI 
    .IF 
        .NA myfun2 .AN 
        .RV ret1:bool .VR 
        .AV arg1:float .VA 
        .AV arg2:string list .VA 
    .FI 
    .CH 
        sys/io.h 
    .HC 
    .CF 
        .NA cfun .AN 
        .RV int .VR 
        .AR float arg1 .RA 
        .AR char arg2 .RA 
    .FC 
    .IV 
        .(* The first value interface .*) 
        .NA myval .AN 
        .AR ~arg1:string .(* The arg string .*) .RA 
        .AR ~arg2:int .RA 
        .AR retarg:float .RA 
    .VI 
.NI 

Always, labels must be marked with a leading tilde character. All other names appearing in value or function names are symbolic names and are displayed in a slatented font.
And an example for such an interface paragraph with ML-types and a ML-class:

Programming Interface
type  mytype     =     Type_1 |
Type_2 |
Type_3
type  mytype     =   {   mutable a:int ;
b:float ;
c:int list }
exception  Failure of string  
class myclass :
a : int ->
b : int
object
val  mutable  speed   dir : int list ->
vl : int list ->
?really : bool
val  align   up : string list ->
down : int list ->
?really : bool
method  private up   v : int ->
name : string ->
arg3 : int int list list ->
()
end
module mymod :
sig
type  mytype     =     Type_1 |
Type_2 |
Type_3
val  align   up : string list ->
down : int list ->
?really : bool
val  mutable  speed   dir : int list ->
vl : int list ->
?really : bool
end

which was produced with this source code:

.IN 
    .IT 
        .NA mytype .AN 
        .AR Type_1 .RA 
        .AR Type_2 .RA 
        .AR Type_3 .RA 
    .TI 
    .IS 
        .NA mytype .AN 
        .AR .MU a:int .RA 
        .AR b:float .RA 
        .AR c:int list .RA 
    .SI 
    .CS 
        .NA myclass .AN 
        .AR a:int .RA 
        .AR b:int .RA 
        .OB 
            .IV 
                .NA .MU speed .AN 
                .AR dir:int list .RA 
                .AR vl: int list .RA 
                .AR ?really: bool .RA 
            .VI 
            .IV 
                .NA align .AN 
                .AR up:string list .RA 
                .AR down: int list .RA 
                .AR ?really: bool .RA 
            .VI 
            .MT 
                .NA .PV up .AN 
                .AR v:int .RA 
                .AR name:string .RA 
                .AR ~arg3:int int list list .RA 
                .AR () .RA 
            .TM 
        .BO 
    .SC 
    .IM 
        .NA mymod .AN 
        .IT 
            .NA mytype .AN 
            .AR Type_1 .RA 
            .AR Type_2 .RA 
            .AR Type_3 .RA 
        .TI 
        .IV 
            .NA align .AN 
            .AR up:string list .RA 
            .AR down: int list .RA 
            .AR ?really: bool .RA 
        .VI 
        .IV 
            .NA .MU speed .AN 
            .AR dir:int list .RA 
            .AR vl: int list .RA 
            .AR ?really: bool .RA 
        .VI 
    .MI 
.NI 

The class interface needs the class name, optional arguments, and the object block with values and methods. Of course, all possible special interfaces can be mixed, and the interface subunit is not required, but strongly recommended. Currently, only simple module signatures without functors are supported.

UP MlDoC dot commands