Skip to content

Commit

Permalink
clarify a few sentences in the type system section
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhroth committed Feb 24, 2017
1 parent b92357f commit 30bfb12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions body.tex
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ \subsection{Type System}
Manifold allows the assignment of subtype values to a variable whose type is a
supertype of the value's, but not vice-versa, i.e., a supertype value cannot be
assigned to a subtype variable.
% TODO: make the next few sentences easier to understand
Tuple types are the exception to this, being
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.
match, meaning that if the value tuple's subfields are assignable to each of the
variable tuple's subfields, then the value tuple can be assigned to the variable
tuple. As Manifold is a descriptive language, it would be an error to allow
the user to hide components and never connect them, so the language will not slice
the fields of a tuple A if you try to assign A to a tuple B with a subset of A's
fields.

\begin{lstlisting}[label=lst:types,caption=Example of types in a Manifold file]
// Type definitions
Expand Down

0 comments on commit 30bfb12

Please sign in to comment.