A type is also a simple Pliant data that can be built, transformed, and even deleted (with care)
The interface for dealing with types is a bit rough (low level), but is not intended for the programmers mainstream ...
To create a new data type with high level mainstream functions, please read documentation here

method t name -> n
  arg Type t ; arg Str n

The name of the type

method t size -> s
  arg Type t ; arg Int s

Returns the size (in bytes) of the root part of objects with type 't'

method t bitsize -> s
  arg Type t ; arg Int s

Returns the size (in bits) of the root part of objects with type 't'

method t flags -> i
  arg Type t ; arg Int i

Returns an integer which is in fact an array of bits describing various properties of the type.

These are a few constants that can be used to check the type properties:
type_atomic Data with that type can be stored in the processor registers: their size is the same as Int, and no computation is required to initialize or destroy an object with that type.
type_scalar No computation is required to initialize or destroy objects with that type
type_packed The fields of that type are packed: there is no space inserted between fields in order to improve alignment, and the fields are stored in the right order.
type_do_not_copy The objects of such a type cannot be copied (for example streams or types)
other flags All the constants are defined in struct.c and have names such as type_flag_...
So if you want to check if a type 't' is scalar, you'll write something like:

if (t:flags .and. type_scalar)<>0
  ...

method t nb_fields i -> n
  arg Type t ; arg Int n

Returns the number of fields of the type (0 for low level types).

method t field -> f
  arg Type t ; arg_C TypeField f

Returns a pointer to the selected field.

method t define_field -> type name
  arg_rw Type t ; arg Type type ; arg Str name

Add a new field to the type.

method t terminate_fields
  arg_rw Type t

If you build the type calling 'define_field', then you must call 'terminate_fields' once at the end in order to let Pliant compute the various fields' offsets.

generate_string_functions type1 type2 ...
  arg_rw Type type1 type2

When you define new data types that are simple structures (set of fields), you can use this function in order to automaticaly generate the 'from string' and 'to string' functions for these new types. added in release 32

method t position -> p
  arg Type t ; arg Str p

A string specifying where the type has been defined (module name, line and column number)

A data with type 'TypeField' is a simple structure:

 type TypeField
   field Link:Type type
   field Int offset
   field Str name

method t generic_level -> l
  arg Type t ; arg_C Int l

The generic level of the type.

method t maybe -> l
  arg Type t ; arg List l

List of all the types that a generic type may be.

method t build_instance a
  arg Type t ; arg address a

Builds a new instance of the type at the provided address.

method t destroy_instance a
  arg Type t ; arg address a

Destroys the instance of the type at the provided address.
'build_instance' and 'destroy_instance' are low level functions that should not be called by mainstream programs.

method t copy_instance src dest
  arg Type t ; arg address src dest

Copies an instance of the type.

method t real_data_type t2
  arg Type t ; arg_C Type t2

If 't' is a kind of pointer, this function will return the type of the real object reached by dereferencing it. On the other hand, if 't' is a the type of a real object, on return 't2' will point 't'

method t maybe atype
  arg_rw Type t ; arg Type atype

Specifies that 't' is a generic data type and that one of the possible real types is 'atype'