Similarities between Wiener and LMS: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
 
Undid revision 590792242 by ISHMAEL N MWANGANGI (talk)
Line 1: Line 1:
My name's Edgar Zelaya but everybody calls me Edgar. I'm from United States. I'm studying at the high school (1st year) and I play the Banjo for 6 years. Usually I choose songs from my famous films ;). <br>I have two brothers. I love Fencing, watching movies and Photography.<br><br>Feel free to visit my web page: [http://youtu.be/YyhyIRzCs-o ac repair nashville]
{{Wikibooks|Haskell|Monad transformers}}
In [[functional programming]], a '''monad transformer''' is a type constructor which takes a [[monads in functional programming|monad]] as an argument and returns a monad as a result.
 
Monad transformers can be used to compose features encapsulated by monads - such as state, [[exception handling]], and I/O - in a modular way. Typically, a monad transformer is created by generalising an existing monad; applying the resulting monad transformer to the identity monad yields a monad which is equivalent to the original monad (ignoring any necessary boxing and unboxing).
 
== Definition ==
A monad transformer consists of:
 
# A type constructor <code>t</code> of [[kind (type theory)|kind]] <code>(* -> *) -> * -> *</code>
# Monad operations <code>return</code> and <code>bind</code> (or an equivalent formulation) for all <code>t m</code> where <code>m</code> is a monad, satisfying the monad laws
# An additional operation, <code>lift :: m a -> t m a</code>, satisfying the following laws:<ref name="modular-interpreters">
{{cite conference
| first = Sheng
| last = Liang
| coauthors = Hudak, Paul; Jones, Mark
| title = Monad transformers and modular interpreters
| booktitle = Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
| pages = 333&ndash;343
| publisher = ACM
| year = 1995
| location = New York, NY
| url = http://portal.acm.org/citation.cfm?id=199528
| format = PDF
| doi = 10.1145/199448.199528
}}
</ref> (the notation <code>`bind`</code> below indicates infix application):
## <code>lift . return = return</code>
## <code>lift (m `bind` k) = (lift m) `bind` (lift . k)</code>
 
== Examples ==
=== The option monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the option monad transformer <math>\mathrm{M} \left( A^{?} \right)</math> (where <math>A^{?}</math> denotes the [[option type]]) is defined by:
*<math>\mathrm{return}: A \rarr \mathrm{M} \left( A^{?} \right) = a \mapsto \mathrm{return} (\mathrm{Just}\,a)</math>
*<math>\mathrm{bind}: \mathrm{M} \left( A^{?} \right) \rarr \left( A \rarr \mathrm{M} \left( B^{?} \right) \right) \rarr \mathrm{M} \left( B^{?} \right) = m \mapsto f \mapsto \mathrm{bind} \, m \, \left(a \mapsto \begin{cases} \mbox{return Nothing} & \mbox{if } a = \mathrm{Nothing}\\ f \, a' & \mbox{if } a = \mathrm{Just} \, a' \end{cases} \right)</math>
*<math>\mathrm{lift}: \mathrm{M} (A) \rarr \mathrm{M} \left( A^{?} \right) = m \mapsto \mathrm{bind} \, m \, (a \mapsto \mathrm{return} (\mathrm{Just} \, a))</math>
 
=== The exception monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the exception monad transformer <math>\mathrm{M} (A + E)</math> (where <math>E</math> is the type of exceptions) is defined by:
*<math>\mathrm{return}: A \rarr \mathrm{M} (A + E) = a \mapsto \mathrm{return} (\mathrm{value}\,a)</math>
*<math>\mathrm{bind}: \mathrm{M} (A + E) \rarr (A \rarr \mathrm{M} (B + E)) \rarr \mathrm{M} (B + E) = m \mapsto f \mapsto \mathrm{bind} \, m \,\left( a \mapsto \begin{cases} \mbox{return err } e & \mbox{if } a = \mathrm{err} \, e\\ f \, a' & \mbox{if } a = \mathrm{value} \, a' \end{cases} \right)</math>
*<math>\mathrm{lift}: \mathrm{M} \, A \rarr \mathrm{M} (A + E) = m \mapsto \mathrm{bind} \, m \, (a \mapsto \mathrm{return} (\mathrm{value} \, a))</math>
 
=== The reader monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the reader monad transformer <math>E \rarr \mathrm{M}\,A</math> (where <math>E</math> is the environment type) is defined by:
*<math>\mathrm{return}: A \rarr E \rarr \mathrm{M} \, A = a \mapsto e \mapsto \mathrm{return} \, a</math>
*<math>\mathrm{bind}: (E \rarr \mathrm{M} \, A) \rarr (A \rarr E \rarr \mathrm{M}\,B) \rarr E \rarr \mathrm{M}\,B = m \mapsto k \mapsto e \mapsto \mathrm{bind} \, (m \, e) \,( a \mapsto k \, a \, e)</math>
*<math>\mathrm{lift}: \mathrm{M} \, A \rarr E \rarr \mathrm{M} \, A = a \mapsto e \mapsto a</math>
 
=== The state monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the state monad transformer <math>S \rarr \mathrm{M}(A \times S)</math> (where <math>S</math> is the state type) is defined by:
*<math>\mathrm{return}: A \rarr S \rarr \mathrm{M} (A \times S) = a \mapsto s \mapsto \mathrm{return} \, (a, s)</math>
*<math>\mathrm{bind}: (S \rarr \mathrm{M}(A \times S)) \rarr (A \rarr S \rarr \mathrm{M}(B \times S)) \rarr S \rarr \mathrm{M}(B \times S) = m \mapsto k \mapsto s \mapsto \mathrm{bind} \, (m \, s) \,((a, s') \mapsto k \, a \, s')</math>
*<math>\mathrm{lift}: \mathrm{M} \, A \rarr S \rarr \mathrm{M}(A \times S) = m \mapsto s \mapsto \mathrm{bind} \, m \, (a \mapsto \mathrm{return} \, (a, s))</math>
 
=== The writer monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the writer monad transformer <math>\mathrm{M}(W \times A)</math> (where <math>W</math> is endowed with a [[monoid]] operation <math>*</math> with identity element <math>\varepsilon</math>) is defined by:
*<math>\mathrm{return}: A \rarr \mathrm{M} (W \times A) = a \mapsto \mathrm{return} \, (\varepsilon, a)</math>
*<math>\mathrm{bind}: \mathrm{M}(W \times A) \rarr (A \rarr \mathrm{M}(W \times B)) \rarr \mathrm{M}(W \times B) = m \mapsto f \mapsto \mathrm{bind} \, m \,((w, a) \mapsto \mathrm{bind} \, (f \, a) \, ((w', b) \mapsto \mathrm{return} \, (w * w', b)))</math>
*<math>\mathrm{lift}: \mathrm{M} \, A \rarr \mathrm{M}(W \times A) = m \mapsto \mathrm{bind} \, m \, (a \mapsto \mathrm{return} \, (\varepsilon, a))</math>
 
=== The continuation monad transformer ===
Given any monad <math>\mathrm{M} \, A</math>, the continuation monad transformer maps an arbitrary type <math>R</math> into functions of type <math>(A \rarr \mathrm{M} \, R) \rarr \mathrm{M} \, R</math>, where <math>R</math> is the result type of the continuation. It is defined by:
*<math>\mathrm{return} \colon A \rarr \left( A \rarr \mathrm{M} \, R \right) \rarr \mathrm{M} \, R = a \mapsto k \mapsto k \, a</math>
*<math>\mathrm{bind} \colon \left( \left( A \rarr \mathrm{M} \, R \right) \rarr \mathrm{M} \, R \right) \rarr \left( A \rarr \left( B \rarr \mathrm{M} \, R \right) \rarr \mathrm{M} \, R \right) \rarr \left( B \rarr \mathrm{M} \, R \right) \rarr \mathrm{M} \, R</math><math>= c \mapsto f \mapsto k \mapsto c \, \left( a \mapsto f \, a \, k \right)</math>
*<math>\mathrm{lift}: \mathrm{M} \, A \rarr (A \rarr \mathrm{M} \, R) \rarr \mathrm{M} \, R = \mathrm{bind}</math>
 
Note that monad transformations are usually not [[commutative]]: for instance, applying the state transformer to the option monad yields a type <math>S \rarr \left(A \times S \right)^{?}</math> (a computation which may fail and yield no final state), whereas the converse transformation has type <math>S \rarr \left(A^{?} \times S \right)</math> (a computation which yields a final state and an optional return value).
 
== See also ==
* [[Monads in functional programming]]
* [[Natural transformation]] - a related concept in [[category theory]]
 
== References ==
{{Reflist}}
 
== External links ==
* [http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Monad_transformers/] - a highly technical blog post briefly reviewing some of the literature on monad transformers and related concepts, with a focus on categorical-theoretic treatment
{{Expand section|date=May 2008}}
 
[[Category:Functional programming]]

Revision as of 15:56, 15 January 2014

DTZ's auction group in Singapore auctions all types of residential, workplace and retail properties, retailers, homes, accommodations, boarding houses, industrial buildings and development websites. Auctions are at the moment held as soon as a month.

Whitehaven @ Pasir Panjang – A boutique improvement nicely nestled peacefully in serene Pasir Panjang personal estate presenting a hundred and twenty rare freehold private apartments tastefully designed by the famend Ong & Ong Architect. Only a short drive away from Science Park and NUS Campus, Jade Residences, a recent Freehold condominium which offers high quality lifestyle with wonderful facilities and conveniences proper at its door steps. Its fashionable linear architectural fashion promotes peace and tranquility living nestled within the D19 personal housing enclave. Rising workplace sector leads real estate market efficiency, while prime retail and enterprise park segments moderate and residential sector continues in decline International Market Perspectives - 1st Quarter 2014

There are a lot of websites out there stating to be one of the best seek for propertycondominiumhouse, and likewise some ways to discover a low cost propertycondominiumhouse. Owning a propertycondominiumhouse in Singapore is the dream of virtually all individuals in Singapore, It is likely one of the large choice we make in a lifetime. Even if you happen to're new to Property listing singapore funding, we are right here that will help you in making the best resolution to purchase a propertycondominiumhouse at the least expensive value.

Jun 18 ROCHESTER in MIXED USE IMPROVEMENT $1338000 / 1br - 861ft² - (THE ROCHESTER CLOSE TO NORTH BUONA VISTA RD) pic real property - by broker Jun 18 MIXED USE IMPROVEMENT @ ROCHESTER @ ROCHESTER PK $1880000 / 1br - 1281ft² - (ROCHESTER CLOSE TO NORTH BUONA VISTA) pic real estate - by broker Tue 17 Jun Jun 17 Sunny Artwork Deco Gem Near Seashore-Super Deal!!! $103600 / 2br - 980ft² - (Ventnor) pic actual estate - by owner Jun 17 Freehold semi-d for rent (Jalan Rebana ) $7000000 / 5909ft² - (Jalan Rebana ) actual property - by dealer Jun sixteen Ascent @ 456 in D12 (456 Balestier Highway,Singapore) pic real property - by proprietor Jun 16 RETAIL SHOP AT SIM LIM SQUARE FOR SALE, IT MALL, ROCHOR, BUGIS MRT $2000000 / 506ft² - (ROCHOR, BUGIS MRT) pic real estate - by dealer HDB Scheme Any DBSS BTO

In case you are eligible to purchase landed houses (open solely to Singapore residents) it is without doubt one of the best property investment choices. Landed housing varieties solely a small fraction of available residential property in Singapore, due to shortage of land right here. In the long term it should hold its worth and appreciate as the supply is small. In truth, landed housing costs have risen the most, having doubled within the last eight years or so. However he got here back the following day with two suitcases full of money. Typically we've got to clarify to such folks that there are rules and paperwork in Singapore and you can't just buy a home like that,' she said. For conveyancing matters there shall be a recommendedLondon Regulation agency familiar with Singapore London propertyinvestors to symbolize you

Sales transaction volumes have been expected to hit four,000 units for 2012, close to the mixed EC gross sales volume in 2010 and 2011, in accordance with Savills Singapore. Nevertheless the last quarter was weak. In Q4 2012, sales transactions were 22.8% down q-q to 7,931 units, in line with the URA. The quarterly sales discount was felt throughout the board. When the sale just starts, I am not in a hurry to buy. It's completely different from a private sale open for privileged clients for one day solely. Orchard / Holland (D09-10) House For Sale The Tembusu is a singular large freehold land outdoors the central area. Designed by multiple award-profitable architects Arc Studio Architecture + Urbanism, the event is targeted for launch in mid 2013. Post your Property Condos Close to MRT In functional programming, a monad transformer is a type constructor which takes a monad as an argument and returns a monad as a result.

Monad transformers can be used to compose features encapsulated by monads - such as state, exception handling, and I/O - in a modular way. Typically, a monad transformer is created by generalising an existing monad; applying the resulting monad transformer to the identity monad yields a monad which is equivalent to the original monad (ignoring any necessary boxing and unboxing).

Definition

A monad transformer consists of:

  1. A type constructor t of kind (* -> *) -> * -> *
  2. Monad operations return and bind (or an equivalent formulation) for all t m where m is a monad, satisfying the monad laws
  3. An additional operation, lift :: m a -> t m a, satisfying the following laws:[1] (the notation `bind` below indicates infix application):
    1. lift . return = return
    2. lift (m `bind` k) = (lift m) `bind` (lift . k)

Examples

The option monad transformer

Given any monad MA, the option monad transformer M(A?) (where A? denotes the option type) is defined by:

The exception monad transformer

Given any monad MA, the exception monad transformer M(A+E) (where E is the type of exceptions) is defined by:

The reader monad transformer

Given any monad MA, the reader monad transformer EMA (where E is the environment type) is defined by:

The state monad transformer

Given any monad MA, the state monad transformer SM(A×S) (where S is the state type) is defined by:

The writer monad transformer

Given any monad MA, the writer monad transformer M(W×A) (where W is endowed with a monoid operation * with identity element ε) is defined by:

The continuation monad transformer

Given any monad MA, the continuation monad transformer maps an arbitrary type R into functions of type (AMR)MR, where R is the result type of the continuation. It is defined by:

Note that monad transformations are usually not commutative: for instance, applying the state transformer to the option monad yields a type S(A×S)? (a computation which may fail and yield no final state), whereas the converse transformation has type S(A?×S) (a computation which yields a final state and an optional return value).

See also

References

43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.

External links

  • [1] - a highly technical blog post briefly reviewing some of the literature on monad transformers and related concepts, with a focus on categorical-theoretic treatment

Template:Expand section

  1. 55 years old Systems Administrator Antony from Clarence Creek, really loves learning, PC Software and aerobics. Likes to travel and was inspired after making a journey to Historic Ensemble of the Potala Palace.

    You can view that web-site... ccleaner free download