Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/jiada_liang_MMath/intro.tex

    rc1c0efdb r29c8675  
    6161The alias names are constants, which follow transitively from their binding to other constants.
    6262\item
    63 Defines a type for generating instants (variables).
     63Defines a type for generating instances (variables).
    6464\item
    6565For safety, an enumeration instance should be restricted to hold only its constant names.
     
    232232% https://hackage.haskell.org/package/base-4.19.1.0/docs/GHC-Enum.html
    233233
    234 The association between ADT and enumeration occurs if all the constructors have a unit (empty) type, \eg @struct unit {}@.
    235 Note, the unit type is not the same as \lstinline{void}.
    236 \begin{cfa}
    237 void foo( void );
    238 struct unit {} u;       $\C[1.5in]{// empty type}$
    239 unit bar( unit );
    240 foo( @foo()@ );         $\C{// void argument does not match with void parameter}$
    241 bar( bar( u ) );        $\C{// unit argument does match with unit parameter}\CRT$
    242 \end{cfa}
     234% The association between ADT and enumeration occurs if all the constructors have a unit (empty) type, \eg @struct unit {}@.
     235% Note, the unit type is not the same as \lstinline{void}.
     236In terms of functional programming linguistics, enumerations often refers to a @unit type@ ADT, where @unit type@ is a type
     237that carry no information.
     238% \begin{cfa}
     239% void foo( void );
     240% struct unit {} u;     $\C[1.5in]{// empty type}$
     241% unit bar( unit );
     242% foo( @foo()@ );               $\C{// void argument does not match with void parameter}$
     243% bar( bar( u ) );      $\C{// unit argument does match with unit parameter}\CRT$
     244% \end{cfa}
    243245
    244246For example, in the Haskell ADT:
Note: See TracChangeset for help on using the changeset viewer.