OnlineWoerterBuecher.de
Internes

Lexikon


algebraic data type


(Or "sum of products type") In {functional programming}, new types can be defined, each of which has one or more ref="module.php?name=Lexikon&file=search&eid=1&query=constructor">constructors. Such a type is known as an algebraic data type. E.g. in ref="module.php?name=Lexikon&file=search&eid=1&query=Haskell">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 ref="module.php?name=Lexikon&file=search&eid=1&query=pattern matching">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 ref="module.php?name=Lexikon&file=search&eid=1&query=product types">product types (only one constructor) and ref="module.php?name=Lexikon&file=search&eid=1&query=enumeration types">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 ref="module.php?name=Lexikon&file=search&eid=1&query=abstract data type">abstract data type (ADT) if it is exported from a ref="module.php?name=Lexikon&file=search&eid=1&query=module">module without its constructors. Objects of such a type can only be manipulated using functions defined in the same ref="module.php?name=Lexikon&file=search&eid=1&query=module">module as the type itself. In ref="module.php?name=Lexikon&file=search&eid=1&query=set theory">set theory the equivalent of an algebraic data type is a ref="module.php?name=Lexikon&file=search&eid=1&query=discriminated union">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)

In addition suitable contents:
[ ref="module.php?name=Lexikon&op=content&tid=31">2 ] [ ref="module.php?name=Lexikon&op=content&tid=134">= ] [ ref="module.php?name=Lexikon&op=content&tid=176">abstract data type ] [ ref="module.php?name=Lexikon&op=content&tid=261">AD ] [ ref="module.php?name=Lexikon&op=content&tid=262">ad ] [ ref="module.php?name=Lexikon&op=content&tid=339">ADT ] [ ref="module.php?name=Lexikon&op=content&tid=383">af ] [ ref="module.php?name=Lexikon&op=content&tid=396">ag ] [ ref="module.php?name=Lexikon&op=content&tid=411">ai ] [ ref="module.php?name=Lexikon&op=content&tid=433">al ] [ ref="module.php?name=Lexikon&op=content&tid=464">algebra ] [ ref="module.php?name=Lexikon&op=content&tid=466">algebraic ] [ ref="module.php?name=Lexikon&op=content&tid=544">am ] [ ref="module.php?name=Lexikon&op=content&tid=592">an ] [ ref="module.php?name=Lexikon&op=content&tid=683">app ] [ ref="module.php?name=Lexikon&op=content&tid=700">application ] [ ref="module.php?name=Lexikon&op=content&tid=740">ar ] [ ref="module.php?name=Lexikon&op=content&tid=743">arc ] [ ref="module.php?name=Lexikon&op=content&tid=759">arg ] [ ref="module.php?name=Lexikon&op=content&tid=760">argument ] [ ref="module.php?name=Lexikon&op=content&tid=800">as ] [ ref="module.php?name=Lexikon&op=content&tid=894">at ] [ ref="module.php?name=Lexikon&op=content&tid=1026">b ] [ ref="module.php?name=Lexikon&op=content&tid=1181">be ] [ ref="module.php?name=Lexikon&op=content&tid=1269">bi ] [ ref="module.php?name=Lexikon&op=content&tid=1368">bj ] [ ref="module.php?name=Lexikon&op=content&tid=1535">br ] [ ref="module.php?name=Lexikon&op=content&tid=1606">bs ] [ ref="module.php?name=Lexikon&op=content&tid=1695">by ] [ ref="module.php?name=Lexikon&op=content&tid=1708">C ] [ ref="module.php?name=Lexikon&op=content&tid=1724">ca ] [ ref="module.php?name=Lexikon&op=content&tid=1844">case ] [ ref="module.php?name=Lexikon&op=content&tid=1863">cat ] [ ref="module.php?name=Lexikon&op=content&tid=2001">ch ] [ ref="module.php?name=Lexikon&op=content&tid=2099">ci ] [ ref="module.php?name=Lexikon&op=content&tid=2247">co ] [ ref="module.php?name=Lexikon&op=content&tid=2330">com ] [ ref="module.php?name=Lexikon&op=content&tid=2545">con ] [ ref="module.php?name=Lexikon&op=content&tid=2606">cons ] [ ref="module.php?name=Lexikon&op=content&tid=2626">constructed type ] [ ref="module.php?name=Lexikon&op=content&tid=2630">constructor ] [ ref="module.php?name=Lexikon&op=content&tid=2791">cr ] [ ref="module.php?name=Lexikon&op=content&tid=2976">D ] [ ref="module.php?name=Lexikon&op=content&tid=3006">data ] [ ref="module.php?name=Lexikon&op=content&tid=3091">data type ] [ ref="module.php?name=Lexikon&op=content&tid=3151">de ] [ ref="module.php?name=Lexikon&op=content&tid=3436">ding ] [ ref="module.php?name=Lexikon&op=content&tid=3470">disc ] [ ref="module.php?name=Lexikon&op=content&tid=3478">discriminated union ] [ ref="module.php?name=Lexikon&op=content&tid=3752">du ] [ ref="module.php?name=Lexikon&op=content&tid=3834">E ] [ ref="module.php?name=Lexikon&op=content&tid=3865">ec ] [ ref="module.php?name=Lexikon&op=content&tid=3896">ed ] [ ref="module.php?name=Lexikon&op=content&tid=3923">edu ] [ ref="module.php?name=Lexikon&op=content&tid=3929">ee ] [ ref="module.php?name=Lexikon&op=content&tid=4008">element ] [ ref="module.php?name=Lexikon&op=content&tid=4110">enumeration ] [ ref="module.php?name=Lexikon&op=content&tid=4148">er ] [ ref="module.php?name=Lexikon&op=content&tid=4150">era ] [ ref="module.php?name=Lexikon&op=content&tid=4171">es ] [ ref="module.php?name=Lexikon&op=content&tid=4199">et ] [ ref="module.php?name=Lexikon&op=content&tid=4497">fi ] [ ref="module.php?name=Lexikon&op=content&tid=4520">file ] [ ref="module.php?name=Lexikon&op=content&tid=4595">fix ] [ ref="module.php?name=Lexikon&op=content&tid=4700">fo ] [ ref="module.php?name=Lexikon&op=content&tid=4727">for ] [ ref="module.php?name=Lexikon&op=content&tid=4828">fr ] [ ref="module.php?name=Lexikon&op=content&tid=4939">Fun ] [ ref="module.php?name=Lexikon&op=content&tid=4940">function ] [ ref="module.php?name=Lexikon&op=content&tid=4941">functional ] [ ref="module.php?name=Lexikon&op=content&tid=4946">functional program ] [ ref="module.php?name=Lexikon&op=content&tid=4947">functional programming ] [ ref="module.php?name=Lexikon&op=content&tid=4953">function application ] [ ref="module.php?name=Lexikon&op=content&tid=5057">ge ] [ ref="module.php?name=Lexikon&op=content&tid=5134">gh ] [ ref="module.php?name=Lexikon&op=content&tid=5291">gr ] [ ref="module.php?name=Lexikon&op=content&tid=5403">gu ] [ ref="module.php?name=Lexikon&op=content&tid=5434">h ] [ ref="module.php?name=Lexikon&op=content&tid=5540">hat ] [ ref="module.php?name=Lexikon&op=content&tid=5656">hing ] [ ref="module.php?name=Lexikon&op=content&tid=5722">hose ] [ ref="module.php?name=Lexikon&op=content&tid=5768">hr ] [ ref="module.php?name=Lexikon&op=content&tid=5931">id ] [ ref="module.php?name=Lexikon&op=content&tid=5956">ie ] [ ref="module.php?name=Lexikon&op=content&tid=6013">il ] [ ref="module.php?name=Lexikon&op=content&tid=6064">in ] [ ref="module.php?name=Lexikon&op=content&tid=6068">inc ] [ ref="module.php?name=Lexikon&op=content&tid=6413">io ] [ ref="module.php?name=Lexikon&op=content&tid=6482">is ] [ ref="module.php?name=Lexikon&op=content&tid=6558">it ] [ ref="module.php?name=Lexikon&op=content&tid=6789">ke ] [ ref="module.php?name=Lexikon&op=content&tid=6822">ki ] [ ref="module.php?name=Lexikon&op=content&tid=6861">kn ] [ ref="module.php?name=Lexikon&op=content&tid=6918">la ] [ ref="module.php?name=Lexikon&op=content&tid=7091">Lex ] [ ref="module.php?name=Lexikon&op=content&tid=7107">li ] [ ref="module.php?name=Lexikon&op=content&tid=7220">list ] [ ref="module.php?name=Lexikon&op=content&tid=7395">lr ] [ ref="module.php?name=Lexikon&op=content&tid=7399">ls ] [ ref="module.php?name=Lexikon&op=content&tid=7415">lu ] [ ref="module.php?name=Lexikon&op=content&tid=7441">ly ] [ ref="module.php?name=Lexikon&op=content&tid=7463">ma ] [ ref="module.php?name=Lexikon&op=content&tid=7582">man ] [ ref="module.php?name=Lexikon&op=content&tid=8019">mm ] [ ref="module.php?name=Lexikon&op=content&tid=8032">mo ] [ ref="module.php?name=Lexikon&op=content&tid=8040">mod ] [ ref="module.php?name=Lexikon&op=content&tid=8079">module ] [ ref="module.php?name=Lexikon&op=content&tid=8167">mp ] [ ref="module.php?name=Lexikon&op=content&tid=8258">mu ] [ ref="module.php?name=Lexikon&op=content&tid=8384">N ] [ ref="module.php?name=Lexikon&op=content&tid=8386">na ] [ ref="module.php?name=Lexikon&op=content&tid=8460">nc ] [ ref="module.php?name=Lexikon&op=content&tid=8472">ne ] [ ref="module.php?name=Lexikon&op=content&tid=8622">nf ] [ ref="module.php?name=Lexikon&op=content&tid=8627">ng ] [ ref="module.php?name=Lexikon&op=content&tid=8630">ni ] [ ref="module.php?name=Lexikon&op=content&tid=8660">nl ] [ ref="module.php?name=Lexikon&op=content&tid=8672">nn ] [ ref="module.php?name=Lexikon&op=content&tid=8675">no ] [ ref="module.php?name=Lexikon&op=content&tid=8718">norm ] [ ref="module.php?name=Lexikon&op=content&tid=8720">normal form ] [ ref="module.php?name=Lexikon&op=content&tid=8760">ns ] [ ref="module.php?name=Lexikon&op=content&tid=8787">nu ] [ ref="module.php?name=Lexikon&op=content&tid=8820">O ] [ ref="module.php?name=Lexikon&op=content&tid=8838">object ] [ ref="module.php?name=Lexikon&op=content&tid=8964">om ] [ ref="module.php?name=Lexikon&op=content&tid=9014">op ] [ ref="module.php?name=Lexikon&op=content&tid=9204">pa ] [ ref="module.php?name=Lexikon&op=content&tid=9380">pattern matching ] [ ref="module.php?name=Lexikon&op=content&tid=9457">pe ] [ ref="module.php?name=Lexikon&op=content&tid=9550">ph ] [ ref="module.php?name=Lexikon&op=content&tid=9651">pl ] [ ref="module.php?name=Lexikon&op=content&tid=9821">port ] [ ref="module.php?name=Lexikon&op=content&tid=9908">pr ] [ ref="module.php?name=Lexikon&op=content&tid=10012">product ] [ ref="module.php?name=Lexikon&op=content&tid=10023">program ] [ ref="module.php?name=Lexikon&op=content&tid=10042">programming ] [ ref="module.php?name=Lexikon&op=content&tid=10144">pt ] [ ref="module.php?name=Lexikon&op=content&tid=10253">query ] [ ref="module.php?name=Lexikon&op=content&tid=10364">rc ] [ ref="module.php?name=Lexikon&op=content&tid=10385">re ] [ ref="module.php?name=Lexikon&op=content&tid=10767">ro ] [ ref="module.php?name=Lexikon&op=content&tid=10887">ru ] [ ref="module.php?name=Lexikon&op=content&tid=10918">S ] [ ref="module.php?name=Lexikon&op=content&tid=10922">sa ] [ ref="module.php?name=Lexikon&op=content&tid=10959">sam ] [ ref="module.php?name=Lexikon&op=content&tid=11010">sc ] [ ref="module.php?name=Lexikon&op=content&tid=11150">se ] [ ref="module.php?name=Lexikon&op=content&tid=11281">set ] [ ref="module.php?name=Lexikon&op=content&tid=11292">set theory ] [ ref="module.php?name=Lexikon&op=content&tid=11376">si ] [ ref="module.php?name=Lexikon&op=content&tid=11510">sk ] [ ref="module.php?name=Lexikon&op=content&tid=11651">so ] [ ref="module.php?name=Lexikon&op=content&tid=11789">Spec ] [ ref="module.php?name=Lexikon&op=content&tid=11790">spec ] [ ref="module.php?name=Lexikon&op=content&tid=11934">st ] [ ref="module.php?name=Lexikon&op=content&tid=12109">struct ] [ ref="module.php?name=Lexikon&op=content&tid=12133">su ] [ ref="module.php?name=Lexikon&op=content&tid=12165">sum ] [ ref="module.php?name=Lexikon&op=content&tid=12169">sum of products type ] [ ref="module.php?name=Lexikon&op=content&tid=12246">sy ] [ ref="module.php?name=Lexikon&op=content&tid=12295">syntax ] [ ref="module.php?name=Lexikon&op=content&tid=12359">T ] [ ref="module.php?name=Lexikon&op=content&tid=12360"> ] [ ref="module.php?name=Lexikon&op=content&tid=12380">tag ] [ ref="module.php?name=Lexikon&op=content&tid=12440">tc ] [ ref="module.php?name=Lexikon&op=content&tid=12588">th ] [ ref="module.php?name=Lexikon&op=content&tid=12602">theory ] [ ref="module.php?name=Lexikon&op=content&tid=12721">to ] [ ref="module.php?name=Lexikon&op=content&tid=12787">tr ] [ ref="module.php?name=Lexikon&op=content&tid=12896">tt ] [ ref="module.php?name=Lexikon&op=content&tid=12970">type ] [ ref="module.php?name=Lexikon&op=content&tid=12986">ua ] [ ref="module.php?name=Lexikon&op=content&tid=13008">ug ] [ ref="module.php?name=Lexikon&op=content&tid=13030">um ] [ ref="module.php?name=Lexikon&op=content&tid=13076">union ] [ ref="module.php?name=Lexikon&op=content&tid=13175">us ] [ ref="module.php?name=Lexikon&op=content&tid=13252">va ]






Go Back ]

Free On-line Dictionary of Computing

Copyright © by OnlineWoerterBuecher.de - (10670 Reads)

All logos and trademarks in this site are property of their respective owner.

Page Generation in 0.097 Seconds, with 16 Database-Queries
Zurück zur Startseite