モナド (プログラミング)
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2023/07/23 23:27 UTC 版)
関数型プログラミングにおいて、モナドはプログラムを構造化するための汎用的な抽象概念である。対応したプログラム言語では、ボイラープレート的なコードでもモナドを使って除去することが可能となる。これはモナドが、特定の形をした計算を表すデータ型と、それに関する生成と合成の2つの手続きを提供することによって実現されている。生成は任意の基本型の値をモナドに包んでモナド値を生成する手続きであり、合成はモナド値を返す関数(モナド関数)たちを合成する手続きである。[1]
注釈
出典
- ^ a b c d O'Sullivan, Bryan; Goerzen, John; Stewart, Don (2009). “Monads”. Real World Haskell. Sebastopol, California: O'Reilly Media. chapter 14. ISBN 978-0596514983
- ^ Wadler, Philip (June 1990). Comprehending Monads. ACM Conference on LISP and Functional Programming. Nice, France. CiteSeerX 10.1.1.33.5381。
- ^ a b Moggi, Eugenio (1991). “Notions of computation and monads”. Information and Computation 93 (1): 55–92. doi:10.1016/0890-5401(91)90052-4 .
- ^ Wadler, Philip (January 1992). The essence of functional programming. 19th Annual ACM Symposium on Principles of Programming Languages. Albuquerque, New Mexico. CiteSeerX 10.1.1.38.9516。
- ^ Hudak, Paul; Peterson, John; Fasel, Joseph (1999). “About Monads”. A Gentle Introduction to Haskell 98. chapter 9
- ^ Moggi, Eugenio (1991). “Notions of computation and monads”. Information and Computation 93 (1). doi:10.1016/0890-5401(91)90052-4 .
- ^ “Some Details on F# Computation Expressions”. 2007年12月14日閲覧。
- ^ Peyton Jones, Simon L.; Wadler, Philip. Imperative Functional Programming. Conference record of the Twentieth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Charleston, South Carolina. 1993
- ^ A monad is a triple (M, unit,>>=) consisting of a type constructor M and two operations of the following types Tomas Petricek (2018) What we talk about when we talk about monads. The Art, Science, and Engineering of Programming, 2018, Vol. 2, Issue 3, Article 12. [1]
- ^ The monad type constructor
m
is added to function results (modulo currying) and nowhere else. Hackage. Control.Monad [2] - ^ The >>= operator is known as bind Tomas Petricek (2018) What we talk about when we talk about monads. The Art, Science, and Engineering of Programming, 2018, Vol. 2, Issue 3, Article 12. [3]
- ^ “Monad laws”. HaskellWiki. haskell.org. 2011年12月11日閲覧。
- ^ “Functors, Applicative Functors and Monoids”. learnyouahaskell.com. 2015年2月21日閲覧。
- ^ How to make Data.Set a monad shows an implementation of the Set restricted monad in Haskell
「モナド (プログラミング)」の例文・使い方・用例・文例
- モナド (プログラミング)のページへのリンク