Catamorphisme

Dans la théorie des catégories, le concept de catamorphisme (du Grec: κατα- = vers le bas; morphisme = forme) dénote l'unique homomorphisme pour une algèbre initiale. Le concept a été appliqué dans la programmation fonctionnelle.

Le concept dual est celui d'anamorphisme.

Le catamorphisme dans la programmation fonctionnelle

En programmation fonctionnelle, un catamorphisme est une généralisation de la fonction fold sur les listes au cadre de types algébriques de données quelconques pouvant être décrit comme des algèbres initiales.

Une des premières publications visant à introduire la notion d'anamorphisme dans le contexte de la programmation fut l'œuvre Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire[1], par Erik Meijer (en), et qui fut dans le contexte du langage de programmation Squiggol (en).

Les catamorphismes sont une forme duales des anamorphismes, eux-mêmes généralisation des opérations de type unfold.

Exemple

L'exemple suivant en Haskell définit un catamorphisme sur une structure d'arbre (de type Tree a) :

data Tree a = Leaf a
            | Branch (Tree a) (Tree a)

type TreeAlgebra a r = (a -> r, r -> r -> r)

foldTree :: TreeAlgebra a r -> Tree a -> r
foldTree (f, g) (Leaf x) = f x
foldTree (f, g) (Branch l r) = g (foldTree (f, g) l) (foldTree (f, g) r)

treeDepth :: TreeAlgebra a Integer
treeDepth = (const 1, \l r -> 1 + max l r)

sumTree :: (Num a) => TreeAlgebra a a
sumTree = (id, (+))

Ici, foldTree (f, g) est un catamorphisme sur le type Tree a. treeDepth et sumTree sont appelés algèbres.

Catamorphisme dans la théorie des catégories

Notes et références

  1. (en) Erik Meijer, Maarten Fokkinga et Ross Paterson, « Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire », CiteSeerX,‎ (lire en ligne)

Voir aussi

Articles connexes

Read other articles:

Jalan Raya Trans-PapuaPersimpangan besarUjung Barat:Sorong JayapuraUjung Timur:MeraukeSistem jalan bebas hambatanJalan Nasional Indonesia Sistem Jalan di Indonesia Jalan Tol Jalan raya Jalan Trans Papua adalah jaringan jalan nasional yang menghubungkan setiap provinsi di Papua, membentang dari Kota Sorong di Papua Barat Daya hingga Merauke di Papua Selatan, dengan total panjang mencapai 4.330,07 kilometer (km). Total panjang tersebut terbagi atas 3.259,45 km di Provinsi Papua -...

 

 

2000 song by Elton John Someday Out of the Blue (Theme from El Dorado)Single by Elton Johnfrom the album The Road to El Dorado (soundtrack) B-sideCheldorado (Hans Zimmer/Heitor Pereira)Released2000Recorded1998–1999GenreSoft rock, Pop rockLength4:16 (single edit)4:47 (album version)LabelDreamWorks RecordsComposer(s)Elton John Patrick LeonardLyricist(s)Tim RiceProducer(s)Patrick Leonard (on the main track) Gavin Greenaway, Hans Zimmer on CheldoradoElton John singles chronology A Step Too Far ...

 

 

.mx

.mx البلد المكسيك  الموقع الموقع الرسمي  تعديل مصدري - تعديل   mx. هو نطاق إنترنت من صِنف مستوى النطاقات العُليا في ترميز الدول والمناطق، للمواقع التي تنتمي إلى المكسيك.[1][2] مراجع ^ النطاق الأعلى في ترميز الدولة (بالإنجليزية). ORSN [الإنجليزية]. Archived from the original on 2019-0...

Agustín Martegani Nazionalità  Argentina Altezza 183 cm Peso 74 kg Calcio Ruolo Centrocampista Squadra  Salernitana Carriera Giovanili 2019-2021 San Lorenzo Squadre di club1 2021-2023 San Lorenzo40 (1)2023-→  Salernitana17 (1) 1 I due numeri indicano le presenze e le reti segnate, per le sole partite di campionato.Il simbolo → indica un trasferimento in prestito. Statistiche aggiornate al 12 aprile 2024 Modifica dati su Wikidata · Manuale Agustín Alb...

 

 

مسجد السيد عزيز الله   إحداثيات 35°40′31″N 51°25′20″E / 35.675138888889°N 51.422111111111°E / 35.675138888889; 51.422111111111   معلومات عامة القرية أو المدينة طهران، محافظة طهران الدولة  إيران تاريخ الافتتاح الرسمي القرن 19[1]  أبعاد المبنى التفاصيل التقنية المواد المستخدمة طابوق&#...

 

 

Music genre created by generations of Black Americans For other uses, see Spirituals (disambiguation). SpiritualStylistic originsWork songsField hollerAfrican musicChristian hymnsCultural originsAfrican AmericansDerivative formsBluesBlack gospel musicFusion genresCCM Spirituals (also known as Negro spirituals, African American spirituals,[1] Black spirituals, or spiritual music) is a genre of Christian music that is associated with African Americans,[2][3][4] w...

Hong Kong actress Patra Au區嘉雯Au in May 2020BornAu Ga Man1953 (1953)Hong KongEducationUniversity of Missouri (BA)University of Hong Kong (PGDE)OccupationsActressTeacherYears active2020–present Patra Au Ga Man (Chinese: 區嘉雯; born 1953) is a Hong Kong actress and retired secondary school teacher best known for her role in the drama film Suk Suk (2020), which she won Best Supporting Actress and was nominated for Best New Performer in the 39th Hong Kong Film Awards...

 

 

Style of art 10th century mosaic of Virgin and Child on a gold ground in the former cathedral Hagia Sophia in Istanbul, Turkey Byzantine mosaics are mosaics produced from the 4th to 15th[1] centuries in and under the influence of the Byzantine Empire. Mosaics were some of the most popular[2] and historically significant art forms produced in the empire, and they are still studied extensively by art historians.[3] Although Byzantine mosaics evolved out of earlier Hellen...

 

 

Polish organization Conservative-Monarchist ClubFormation1988TypeMonarchism Integral conservatism Traditionalist conservatism Catholic nationalism Counter-revolutionary Anti-democracy Euroscepticism Anti-socialist Anti-communistHeadquartersPolandChairmanAdam WielomskiWebsitekonserwatyzm.pl The Conservative-Monarchist Club (Polish: Klub Zachowawczo-Monarchistyczny, abbr. KZ-M) is a Polish organization of traditionalist, counter-revolutionary, and Catholic character. It was founded on 7 March 1...

American college basketball season 2020–21 Virginia Cavaliers men's basketballACC regular season championsNCAA tournament, first roundConferenceAtlantic Coast ConferenceRankingCoachesNo. 24APNo. 15Record18–7 (13–4 ACC)Head coachTony Bennett (12th season)Associate head coachJason Williford (12th season)Assistant coaches Brad Soderberg (6th season) Orlando Vandross (3rd season) Offensive schemeBlocker-MoverBase defensePack-LineHome arenaJohn Paul Jones A...

 

 

HyukohAsalSeoul, Korea SelatanGenre Indie pop indie rock Tahun aktif2014 – kiniLabelArtist Management Company DRDR(2014–kini)HIGHGRND(2015–kini) (sub-label YG Entertainment)Anggota Oh Hyuk Im Dong-gun Lim Hyun-jae Lee In-woo Templat:Korean membutuhkan parameter |hangul=. Hyukoh (bahasa Korea: 혁오) adalah grup musik indie asal Korea Selatan di bawah naungan label HIGHGRND. Dibentuk pada Mei 2014, grup ini terdiri dari Oh Hyuk, Im Dong-gun, Lim Hyun-jae, dan Lee In-woo. ...

 

 

Ukrainian anarchist movement Part of a series on theMakhnovshchina History 1917 Revolution Ukrainian–Soviet War Oleksandrivsk Uprising Austro-German invasion Battle of Dibrivka Battle of Donbas Battle of Perehonivka Eichenfeld massacre Polonsky conspiracy Starobilsk agreement Northern Taurida Operation Siege of Perekop Bolshevik–Makhnovist conflict PeopleMilitary commanders Belochub Bilash Bondarets Brova Budanov Cherednyak Chubenko Havrylenko Karetnyk Kotsur Kozhyn Kurylenko Lyuty H. Mak...

American jazz musician Archie SheppArchie Shepp in Warsaw, 2008Background informationBirth nameArchie SheppBorn (1937-05-24) May 24, 1937 (age 87)Fort Lauderdale, Florida, United StatesGenresJazz, free jazz, avant-garde jazzOccupation(s)Musician, composer, educatorInstrument(s)Tenor saxophone, soprano saxophone, alto saxophone, piano, vocalsYears active1960–presentLabelsImpulse!, SteepleChase, Denon, BYG Actuel, MargeWebsitewww.archieshepp.orgMusical artist Archie Shepp (born May 24, 1...

 

 

Indian Navy Officer Vice AdmiralKASZ RajuPVSM, AVSM, NMAllegiance IndiaService/branch Indian NavyYears of service1958-1994Rank Vice AdmiralCommands heldWestern Naval CommandSouthern Naval CommandWestern Fleet INS HansaINS Vikrant INS DeepakINS Tir (K256)Battles/warsWorld War IIIndo-Pakistani War of 1971Awards Param Vishisht Seva Medal Ati Vishisht Seva Medal Nao Sena Medal Vice Admiral Kankipati Appala Satyanarayana Zagapathi 'KASZ' Raju, PVSM, AVSM, NM is a former Fl...

 

 

Intellectual property rights of a creative work not connected with the work's actual author Intellectual property Authors' rights Copyleft Copyright Database right Farmers' rights Geographical indication Indigenous intellectual property Industrial design right Integrated circuit layout design protection Moral rights Patent Peasants' rights Plant breeders' rights Plant genetic resources Related rights Supplementary protection certificate Trade dress Trade secret Trademark Utility model Related...

French Turkologist (1821–1889) Abel Pavet de CourteilleGrave at Père Lachaise Cemetery.BornAbel Jean Baptiste Michel Pavet de Courteille23 June 1821ParisDied12 December 1889(1889-12-12) (aged 68)ParisOccupationOrientalist Abel Jean Baptiste Michel Pavet de Courteille (23 June 1821 – 12 December 1889) was a 19th-century French orientalist, who specialized in the study of Turkic languages. Career Through his mother, Sophie Silvestre (1793-1877), he was Antoine-Isaac Silvestre de Sacy'...

 

 

Record label World SerpentFounded1990FounderDavid GibsonAlan TrenchAlison WebsterStatusinactiveDistributor(s)World TradeGenreExperimentalCountry of originUnited KingdomLocationLondon World Serpent Distribution was a British record label and music distribution house formed in the 1990s by David Gibson, Alan Trench and Alison Webster.[1] Douglas Pearce of Death In June coined the company name in 1991,[2] World Serpent being another name for Jörmungandr.[3] Founding Wor...

 

 

Michael ValgrenMichael Valgren lors de la présentation des équipes du Tour de France 2015 à Utrecht.InformationsNom de naissance Michael Valgren AndersenNaissance 7 février 1992 (32 ans)Østerild (d)Nationalité danoiseÉquipe actuelle EF Education-EasyPostDistinctions Cycliste danois de l'année (2014 et 2018)Danish Bike Award (d) (2018)Équipes UCI 2011-2012Glud & Marstrand-LRØ2013Cult Energy2014-2015Tinkoff-Saxo2016Tinkoff2017-2018Astana2019Dimension Data2020NTT Pro Cycling20...

Chronologies Chronologie du sport 1921 1922 1923  1924  1925 1926 1927Mois :Jan - Fév - Mar - Avr - Mai - Juin Juil - Aoû - Sep - Oct - Nov - Déc 1923 ◄◄ 1924 en sport ►► 1925 Chronologie dans le monde 1921 1922 1923  1924  1925 1926 1927Décennies :1890 1900 1910  1920  1930 1940 1950Siècles :XVIIIe XIXe  XXe  XXIe XXIIeMillénaires :-Ier Ier  IIe  IIIe Chronologies géographiques Afrique Afrique du Sud, Algé...

 

 

Ali SoweNazionalità Gambia Altezza191 cm Peso84 kg Calcio RuoloAttaccante Squadra Çaykur Rizespor CarrieraGiovanili 2010-2013 Gamtel2013 Chievo Squadre di club1 2013 Chievo2 (0)2013-2014→  Juve Stabia35 (5)2014-2015→  Pescara8 (0)2015→  Latina13 (0)2015-2016→  Modena8 (0)2016→  Lecce7 (1)[1]2016-2017→  Prato15 (0)2017→  Vibonese16 (6)[2]2017-2018→  Skënderbeu33 (21)2018-2021 CSKA Sofia74 (...