Functional Meta-types

Overview

A small number of meta-types are defined that correspond to functional programming primitives, otherwise known as 'closures', 'lambda expressions' and so on. These concepts are supported in most modern programming languages now, and the types defined here are intended to provide a minimal formal basis to enable other openEHR specification to defined function-related elements. Since UML does not contain native functional elements, the semantics here are approximated using normal class facilities.

The following illustrates the functional package.

BASE foundation types.functional
Figure 1. base.foundation_types.functional Package

Two key abstractions are required, namely 'function as a type', and 'tuple', which enables arguments to be formalised. To provide a 'function' type, a 'routine' type is also required. For completeness, a 'procedure' type is also defined. The 'tuple' type is defined as a generic meta-type whose descendants may additionally define any number of generic parameter types, corresponding to a type list.

Class Definitions

ROUTINE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

ROUTINE<ARGS>

Description

Type representing a function with a return type and 0 or more arguments represented as a TUPLE.

ROUTINE<ARGS>

Type representing a function with a return type and 0 or more arguments represented as a TUPLE.

{
    "name": "ROUTINE",
    "documentation": "Type representing a function with a return type and 0 or more arguments represented as a TUPLE.",
    "generic_parameter_defs": {
        "ARGS": {
            "name": "ARGS",
            "conforms_to_type": "TUPLE"
        }
    }
}
ROUTINE

FUNCTION Class

  • Definition

  • Effective

  • BMM

  • UML

Class

FUNCTION<ARGS,RESULT>

Description

Type representing a function with a return type and 0 or more arguments represented as a TUPLE.

Inherit

ROUTINE

FUNCTION<ARGS,RESULT>

Type representing a function with a return type and 0 or more arguments represented as a TUPLE.

Inherits: ROUTINE

{
    "name": "FUNCTION",
    "documentation": "Type representing a function with a return type and 0 or more arguments represented as a TUPLE.",
    "ancestors": [
        "ROUTINE"
    ],
    "generic_parameter_defs": {
        "ARGS": {
            "name": "ARGS",
            "conforms_to_type": "TUPLE"
        },
        "RESULT": {
            "name": "RESULT",
            "conforms_to_type": "Any"
        }
    }
}
FUNCTION

PROCEDURE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

PROCEDURE<ARGS>

Description

Type representing a procedure with 0 or more arguments represented as a TUPLE.

Inherit

ROUTINE

PROCEDURE<ARGS>

Type representing a procedure with 0 or more arguments represented as a TUPLE.

Inherits: ROUTINE

{
    "name": "PROCEDURE",
    "documentation": "Type representing a procedure with 0 or more arguments represented as a TUPLE.",
    "ancestors": [
        "ROUTINE"
    ],
    "generic_parameter_defs": {
        "ARGS": {
            "name": "ARGS",
            "conforms_to_type": "TUPLE"
        }
    }
}
PROCEDURE

TUPLE Class

  • Definition

  • Effective

  • BMM

  • UML

Class

TUPLE

Description

Parent type of all TUPLE types.

TUPLE

Parent type of all TUPLE types.

{
    "name": "TUPLE",
    "documentation": "Parent type of all TUPLE types."
}
TUPLE

TUPLE1 Class

  • Definition

  • Effective

  • BMM

  • UML

Class

TUPLE1<A>

Description

A Tuple type used, among other things, for representing a single typed argument within a Routine signature.

Inherit

TUPLE

TUPLE1<A>

A Tuple type used, among other things, for representing a single typed argument within a Routine signature.

Inherits: TUPLE

{
    "name": "TUPLE1",
    "documentation": "A Tuple type used, among other things, for representing a single typed argument within a Routine signature.",
    "ancestors": [
        "TUPLE"
    ],
    "generic_parameter_defs": {
        "A": {
            "name": "A",
            "conforms_to_type": "Any"
        }
    }
}
TUPLE1

TUPLE2 Class

  • Definition

  • Effective

  • BMM

  • UML

Class

TUPLE2<A,B>

Description

A Tuple type used, among other things, for representing two typed arguments within a Routine signature.

Inherit

TUPLE

TUPLE2<A,B>

A Tuple type used, among other things, for representing two typed arguments within a Routine signature.

Inherits: TUPLE

{
    "name": "TUPLE2",
    "documentation": "A Tuple type used, among other things, for representing two typed arguments within a Routine signature.",
    "ancestors": [
        "TUPLE"
    ],
    "generic_parameter_defs": {
        "A": {
            "name": "A",
            "conforms_to_type": "Any"
        },
        "B": {
            "name": "B",
            "conforms_to_type": "Any"
        }
    }
}
TUPLE2