|
In category theory, the concept of catamorphism (from Greek: κατά = ''downwards'' or ''according to''; μορφή = ''form'' or ''shape'') denotes the unique homomorphism from an initial algebra into some other algebra. In functional programming, catamorphisms provide generalizations of ''folds'' of lists to arbitrary algebraic data types, which can be described as initial algebras. The dual concept is that of anamorphism that generalize ''unfolds''. See also Hylomorphism. == Definition == Consider an initial ''F''-algebra (''A'', ''in'') for some endofunctor ''F'' of some category into itself. Here ''in'' is a morphism from ''FA'' to ''A''. Since it is initial, we know that whenever (''X'', ''f'') is another ''F''-algebra, i.e. a morphism ''f'' from ''FX'' to ''X'', there is a unique homomorphism ''h'' from (''A'', ''in'') to (''X'', ''f''). By the definition of the category of ''F''-algebras, this ''h'' corresponds to a morphism from ''A'' to ''X'', conventionally also denoted ''h'', such that ''h . in = f . Fh''. In the context of ''F''-algebras, the uniquely specified morphism from the initial object is denoted by cata ''f'' and hence characterized by the following relationship: * * 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Catamorphism」の詳細全文を読む スポンサード リンク
|