Found 1 hit - Term: algebraic data type, Database: *, Strategy: prefix
- [1] : The Free On-line Dictionary of Computing (27 SEP 03)
algebraic data type
or "sum of products type" in functional
programming, new types can be defined, each of which has one
or more constructors. such a type is known as an algebraic
data type. e.g. in haskell we can define a new type,
"tree":
data tree = empty | leaf int | node tree tree
with constructors "empty", "leaf" and "node". the
constructors can be used much like functions in that they can
be partially applied to arguments of the appropriate type.
for example, the leaf constructor has the functional type int
-> tree.
a constructor application cannot be reduced evaluated like a
function application though since it is already in normal
form. functions which operate on algebraic data types can be
defined using pattern matching:
depth :: tree -> int
depth empty = 0
depth leaf n = 1
depth node l r = 1 + max depth l depth r
the most common algebraic data type is the list which has
constructors nil and cons, written in haskell using the
special syntax "" for nil and infix ":" for cons.
special cases of algebraic types are product types only one
constructor and enumeration types many constructors with
no arguments. algebraic types are one kind of constructed
type i.e. a type formed by combining other types.
an algebraic data type may also be an abstract data type
adt if it is exported from a module without its
constructors. objects of such a type can only be manipulated
using functions defined in the same module as the type
itself.
in set theory the equivalent of an algebraic data type is a
discriminated union - a set whose elements consist of a tag
equivalent to a constructor and an object of a type
corresponding to the tag equivalent to the constructor
arguments.
1994-11-23
see also:
functional programming constructor haskell normal form pattern matching product type
enumeration type constructed type abstract data type module set theory
discriminated union
Results 1 - 10 of 18 found about algebraic data type: Algebraic
>> A Words
Algebraic, definition of term: Algebraic
algebraic_pag1.html Data
>> D Words
Data, definition of term: Data
data_pag1.html Data Glove
>> D Words
Data Glove, definition of term: Data Glove
data+glove_pag1.html Data Flow
>> D Words
Data Flow, definition of term: Data Flow
data+flow_pag1.html Data Mining
>> D Words
Data Mining, definition of term: Data Mining
data+mining_pag1.html Data Model
>> D Words
Data Model, definition of term: Data Model
data+model_pag1.html Data Path
>> D Words
Data Path, definition of term: Data Path
data+path_pag1.html Data Encryption
>> D Words
Data Encryption, definition of term: Data Encryption
data+encryption_pag1.html Data Point
>> D Words
Data Point, definition of term: Data Point
data+point_pag1.html Data Dictionary
>> D Words
Data Dictionary, definition of term: Data Dictionary
data+dictionary_pag1.html
Page 1 2 Next Last accessed:2009/01/08 02:12:33 [Total processing time: 1 seconds] |