Next: Using pragma foreign_enum for C#, Up: Interfacing with C# [Contents]
A C# ‘pragma foreign_type’ declaration has the form:
:- pragma foreign_type("C#", MercuryTypeName, "C#-Type").
The C#-Type can be any accessible C# type.
The effect of this declaration is that Mercury values of type MercuryTypeName will be passed to and from C# foreign_procs as having type C#-Type.
Furthermore, any Mercury procedure exported with ‘pragma foreign_export’ will use C#-Type as the type for any parameters whose Mercury type is MercuryTypeName.