From 57a2fb0fda56a09ebb863806221e705cabeb2db5 Mon Sep 17 00:00:00 2001 From: Michael Lyons Date: Fri, 24 Feb 2017 12:14:46 -0500 Subject: [PATCH] Differentiating the Manifold type system --- body.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/body.tex b/body.tex index 00c5a57..d954788 100644 --- a/body.tex +++ b/body.tex @@ -68,6 +68,9 @@ \subsection{Type System} The Manifold language uses a structual type system. In a structual type system a type is compatible with another type if for every feature in the type there is a compatible feature in the other type. A structual type system is different from the traditional type systems because it allows for supertypes and subtypes to be defined without modifying the original types. This allows for complex derived types in manifold that can be used with the different libraries of components. +When a type is extended in Manifold the subtype is considered more specific and although the subtype is equivalent to its supertype, the supertype is not compatible with the subtype and assignment cannot happen both ways. Tuple types are unique because they are considered compatible if the signature of the tuples match and all the subfields are subtypes of the subfields of the other tuple. Unlike other structural typing systems Manifold will not slice the fields of a tuple if you +try to assign it to a tuple with a subset of the fields. In a descriptive language it would be an error to allow the user to hide components and never connect them. + \begin{lstlisting}[label=lst:types,caption=Example of types in a Manifold file] // Type definitions Type NewInt = Int;