bsc-leon-vatthauer/agda/bsc-thesis/Effect.Monad.html
2024-02-09 17:53:52 +01:00

136 lines
No EOL
34 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html><head><meta charset="utf-8"><title>Effect.Monad</title><link rel="stylesheet" href="Agda.css"></head><body><pre class="Agda"><a id="1" class="Comment">------------------------------------------------------------------------</a>
<a id="74" class="Comment">-- The Agda standard library</a>
<a id="103" class="Comment">--</a>
<a id="106" class="Comment">-- Monads</a>
<a id="116" class="Comment">------------------------------------------------------------------------</a>
<a id="190" class="Comment">-- Note that currently the monad laws are not included here.</a>
<a id="252" class="Symbol">{-#</a> <a id="256" class="Keyword">OPTIONS</a> <a id="264" class="Pragma">--cubical-compatible</a> <a id="285" class="Pragma">--safe</a> <a id="292" class="Symbol">#-}</a>
<a id="297" class="Keyword">module</a> <a id="304" href="Effect.Monad.html" class="Module">Effect.Monad</a> <a id="317" class="Keyword">where</a>
<a id="324" class="Keyword">open</a> <a id="329" class="Keyword">import</a> <a id="336" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a> <a id="351" class="Keyword">using</a> <a id="357" class="Symbol">(</a><a id="358" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a><a id="362" class="Symbol">;</a> <a id="364" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a><a id="368" class="Symbol">;</a> <a id="370" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a><a id="375" class="Symbol">;</a> <a id="377" href="Data.Bool.Base.html#941" class="Function">not</a><a id="380" class="Symbol">)</a>
<a id="382" class="Keyword">open</a> <a id="387" class="Keyword">import</a> <a id="394" href="Data.Unit.Polymorphic.Base.html" class="Module">Data.Unit.Polymorphic.Base</a> <a id="421" class="Keyword">using</a> <a id="427" class="Symbol">(</a><a id="428" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a><a id="429" class="Symbol">)</a>
<a id="432" class="Keyword">open</a> <a id="437" class="Keyword">import</a> <a id="444" href="Effect.Choice.html" class="Module">Effect.Choice</a>
<a id="458" class="Keyword">open</a> <a id="463" class="Keyword">import</a> <a id="470" href="Effect.Empty.html" class="Module">Effect.Empty</a>
<a id="483" class="Keyword">open</a> <a id="488" class="Keyword">import</a> <a id="495" href="Effect.Applicative.html" class="Module">Effect.Applicative</a>
<a id="514" class="Keyword">open</a> <a id="519" class="Keyword">import</a> <a id="526" href="Function.Base.html" class="Module">Function.Base</a> <a id="540" class="Keyword">using</a> <a id="546" class="Symbol">(</a><a id="547" href="Function.Base.html#704" class="Function">id</a><a id="549" class="Symbol">;</a> <a id="551" href="Function.Base.html#1638" class="Function">flip</a><a id="555" class="Symbol">;</a> <a id="557" href="Function.Base.html#3839" class="Function Operator">_$_</a><a id="561" class="Symbol">;</a> <a id="563" href="Function.Base.html#3626" class="Function Operator">_∘_</a><a id="567" class="Symbol">)</a>
<a id="569" class="Keyword">open</a> <a id="574" class="Keyword">import</a> <a id="581" href="Level.html" class="Module">Level</a> <a id="587" class="Keyword">using</a> <a id="593" class="Symbol">(</a><a id="594" href="Agda.Primitive.html#742" class="Postulate">Level</a><a id="599" class="Symbol">;</a> <a id="601" href="Agda.Primitive.html#931" class="Primitive">suc</a><a id="604" class="Symbol">;</a> <a id="606" href="Agda.Primitive.html#961" class="Primitive Operator">_⊔_</a><a id="609" class="Symbol">)</a>
<a id="612" class="Keyword">private</a>
<a id="622" class="Keyword">variable</a>
<a id="635" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="637" href="Effect.Monad.html#637" class="Generalizable">g</a> <a id="639" href="Effect.Monad.html#639" class="Generalizable">g₁</a> <a id="642" href="Effect.Monad.html#642" class="Generalizable">g₂</a> <a id="645" class="Symbol">:</a> <a id="647" href="Agda.Primitive.html#742" class="Postulate">Level</a>
<a id="657" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="659" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="661" href="Effect.Monad.html#661" class="Generalizable">C</a> <a id="663" class="Symbol">:</a> <a id="665" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="669" href="Effect.Monad.html#635" class="Generalizable">f</a>
<a id="672" class="Comment">------------------------------------------------------------------------</a>
<a id="745" class="Comment">-- The type of raw monads</a>
<a id="772" class="Keyword">record</a> <a id="RawMonad"></a><a id="779" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="788" class="Symbol">(</a><a id="789" href="Effect.Monad.html#789" class="Bound">F</a> <a id="791" class="Symbol">:</a> <a id="793" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="797" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="799" class="Symbol"></a> <a id="801" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="805" href="Effect.Monad.html#637" class="Generalizable">g</a><a id="806" class="Symbol">)</a> <a id="808" class="Symbol">:</a> <a id="810" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="814" class="Symbol">(</a><a id="815" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="819" href="Effect.Monad.html#797" class="Bound">f</a> <a id="821" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="823" href="Effect.Monad.html#805" class="Bound">g</a><a id="824" class="Symbol">)</a> <a id="826" class="Keyword">where</a>
<a id="834" class="Keyword">infixl</a> <a id="841" class="Number">1</a> <a id="843" href="Effect.Monad.html#933" class="Field Operator">_&gt;&gt;=_</a> <a id="849" href="Effect.Monad.html#1011" class="Function Operator">_&gt;&gt;_</a> <a id="854" href="Effect.Monad.html#1170" class="Function Operator">_&gt;=&gt;_</a>
<a id="862" class="Keyword">infixr</a> <a id="869" class="Number">1</a> <a id="871" href="Effect.Monad.html#1051" class="Function Operator">_=&lt;&lt;_</a> <a id="877" href="Effect.Monad.html#1247" class="Function Operator">_&lt;=&lt;_</a>
<a id="885" class="Keyword">field</a>
<a id="RawMonad.rawApplicative"></a><a id="895" href="Effect.Monad.html#895" class="Field">rawApplicative</a> <a id="910" class="Symbol">:</a> <a id="912" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="927" href="Effect.Monad.html#789" class="Bound">F</a>
<a id="RawMonad._&gt;&gt;=_"></a><a id="933" href="Effect.Monad.html#933" class="Field Operator">_&gt;&gt;=_</a> <a id="939" class="Symbol">:</a> <a id="941" href="Effect.Monad.html#789" class="Bound">F</a> <a id="943" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="945" class="Symbol"></a> <a id="947" class="Symbol">(</a><a id="948" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="950" class="Symbol"></a> <a id="952" href="Effect.Monad.html#789" class="Bound">F</a> <a id="954" href="Effect.Monad.html#659" class="Generalizable">B</a><a id="955" class="Symbol">)</a> <a id="957" class="Symbol"></a> <a id="959" href="Effect.Monad.html#789" class="Bound">F</a> <a id="961" href="Effect.Monad.html#659" class="Generalizable">B</a>
<a id="966" class="Keyword">open</a> <a id="971" href="Effect.Applicative.html#984" class="Module">RawApplicative</a> <a id="986" href="Effect.Monad.html#895" class="Field">rawApplicative</a> <a id="1001" class="Keyword">public</a>
<a id="RawMonad._&gt;&gt;_"></a><a id="1011" href="Effect.Monad.html#1011" class="Function Operator">_&gt;&gt;_</a> <a id="1016" class="Symbol">:</a> <a id="1018" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1020" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1022" class="Symbol"></a> <a id="1024" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1026" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="1028" class="Symbol"></a> <a id="1030" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1032" href="Effect.Monad.html#659" class="Generalizable">B</a>
<a id="1036" href="Effect.Monad.html#1011" class="Function Operator">_&gt;&gt;_</a> <a id="1041" class="Symbol">=</a> <a id="1043" href="Effect.Applicative.html#1296" class="Function Operator">_*&gt;_</a>
<a id="RawMonad._=&lt;&lt;_"></a><a id="1051" href="Effect.Monad.html#1051" class="Function Operator">_=&lt;&lt;_</a> <a id="1057" class="Symbol">:</a> <a id="1059" class="Symbol">(</a><a id="1060" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1062" class="Symbol"></a> <a id="1064" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1066" href="Effect.Monad.html#659" class="Generalizable">B</a><a id="1067" class="Symbol">)</a> <a id="1069" class="Symbol"></a> <a id="1071" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1073" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1075" class="Symbol"></a> <a id="1077" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1079" href="Effect.Monad.html#659" class="Generalizable">B</a>
<a id="1083" href="Effect.Monad.html#1051" class="Function Operator">_=&lt;&lt;_</a> <a id="1089" class="Symbol">=</a> <a id="1091" href="Function.Base.html#1638" class="Function">flip</a> <a id="1096" href="Effect.Monad.html#933" class="Field Operator">_&gt;&gt;=_</a>
<a id="RawMonad.Kleisli"></a><a id="1105" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1113" class="Symbol">:</a> <a id="1115" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1119" href="Effect.Monad.html#797" class="Bound">f</a> <a id="1121" class="Symbol"></a> <a id="1123" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1127" href="Effect.Monad.html#797" class="Bound">f</a> <a id="1129" class="Symbol"></a> <a id="1131" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1135" class="Symbol">(</a><a id="1136" href="Effect.Monad.html#797" class="Bound">f</a> <a id="1138" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="1140" href="Effect.Monad.html#805" class="Bound">g</a><a id="1141" class="Symbol">)</a>
<a id="1145" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1153" href="Effect.Monad.html#1153" class="Bound">A</a> <a id="1155" href="Effect.Monad.html#1155" class="Bound">B</a> <a id="1157" class="Symbol">=</a> <a id="1159" href="Effect.Monad.html#1153" class="Bound">A</a> <a id="1161" class="Symbol"></a> <a id="1163" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1165" href="Effect.Monad.html#1155" class="Bound">B</a>
<a id="RawMonad._&gt;=&gt;_"></a><a id="1170" href="Effect.Monad.html#1170" class="Function Operator">_&gt;=&gt;_</a> <a id="1176" class="Symbol">:</a> <a id="1178" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1186" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1188" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="1190" class="Symbol"></a> <a id="1192" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1200" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="1202" href="Effect.Monad.html#661" class="Generalizable">C</a> <a id="1204" class="Symbol"></a> <a id="1206" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1214" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1216" href="Effect.Monad.html#661" class="Generalizable">C</a>
<a id="1220" class="Symbol">(</a><a id="1221" href="Effect.Monad.html#1221" class="Bound">f</a> <a id="1223" href="Effect.Monad.html#1170" class="Function Operator">&gt;=&gt;</a> <a id="1227" href="Effect.Monad.html#1227" class="Bound">g</a><a id="1228" class="Symbol">)</a> <a id="1230" href="Effect.Monad.html#1230" class="Bound">a</a> <a id="1232" class="Symbol">=</a> <a id="1234" href="Effect.Monad.html#1221" class="Bound">f</a> <a id="1236" href="Effect.Monad.html#1230" class="Bound">a</a> <a id="1238" href="Effect.Monad.html#933" class="Field Operator">&gt;&gt;=</a> <a id="1242" href="Effect.Monad.html#1227" class="Bound">g</a>
<a id="RawMonad._&lt;=&lt;_"></a><a id="1247" href="Effect.Monad.html#1247" class="Function Operator">_&lt;=&lt;_</a> <a id="1253" class="Symbol">:</a> <a id="1255" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1263" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="1265" href="Effect.Monad.html#661" class="Generalizable">C</a> <a id="1267" class="Symbol"></a> <a id="1269" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1277" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1279" href="Effect.Monad.html#659" class="Generalizable">B</a> <a id="1281" class="Symbol"></a> <a id="1283" href="Effect.Monad.html#1105" class="Function">Kleisli</a> <a id="1291" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="1293" href="Effect.Monad.html#661" class="Generalizable">C</a>
<a id="1297" href="Effect.Monad.html#1247" class="Function Operator">_&lt;=&lt;_</a> <a id="1303" class="Symbol">=</a> <a id="1305" href="Function.Base.html#1638" class="Function">flip</a> <a id="1310" href="Effect.Monad.html#1170" class="Function Operator">_&gt;=&gt;_</a>
<a id="RawMonad.when"></a><a id="1319" href="Effect.Monad.html#1319" class="Function">when</a> <a id="1324" class="Symbol">:</a> <a id="1326" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a> <a id="1331" class="Symbol"></a> <a id="1333" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1335" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a> <a id="1337" class="Symbol"></a> <a id="1339" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1341" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a>
<a id="1345" href="Effect.Monad.html#1319" class="Function">when</a> <a id="1350" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a> <a id="1355" href="Effect.Monad.html#1355" class="Bound">m</a> <a id="1357" class="Symbol">=</a> <a id="1359" href="Effect.Monad.html#1355" class="Bound">m</a>
<a id="1363" href="Effect.Monad.html#1319" class="Function">when</a> <a id="1368" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a> <a id="1374" href="Effect.Monad.html#1374" class="Bound">m</a> <a id="1376" class="Symbol">=</a> <a id="1378" href="Effect.Applicative.html#1152" class="Function">pure</a> <a id="1383" class="Symbol">_</a>
<a id="RawMonad.unless"></a><a id="1388" href="Effect.Monad.html#1388" class="Function">unless</a> <a id="1395" class="Symbol">:</a> <a id="1397" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a> <a id="1402" class="Symbol"></a> <a id="1404" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1406" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a> <a id="1408" class="Symbol"></a> <a id="1410" href="Effect.Monad.html#789" class="Bound">F</a> <a id="1412" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a>
<a id="1416" href="Effect.Monad.html#1388" class="Function">unless</a> <a id="1423" class="Symbol">=</a> <a id="1425" href="Effect.Monad.html#1319" class="Function">when</a> <a id="1430" href="Function.Base.html#3626" class="Function Operator">∘′</a> <a id="1433" href="Data.Bool.Base.html#941" class="Function">not</a>
<a id="1438" class="Comment">-- When level g=f, a join/μ operator is definable</a>
<a id="1489" class="Keyword">module</a> <a id="Join"></a><a id="1496" href="Effect.Monad.html#1496" class="Module">Join</a> <a id="1501" class="Symbol">{</a><a id="1502" href="Effect.Monad.html#1502" class="Bound">F</a> <a id="1504" class="Symbol">:</a> <a id="1506" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1510" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="1512" class="Symbol"></a> <a id="1514" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1518" href="Effect.Monad.html#635" class="Generalizable">f</a><a id="1519" class="Symbol">}</a> <a id="1521" class="Symbol">(</a><a id="1522" href="Effect.Monad.html#1522" class="Bound">M</a> <a id="1524" class="Symbol">:</a> <a id="1526" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="1535" href="Effect.Monad.html#1502" class="Bound">F</a><a id="1536" class="Symbol">)</a> <a id="1538" class="Keyword">where</a>
<a id="1546" class="Keyword">open</a> <a id="1551" href="Effect.Monad.html#779" class="Module">RawMonad</a> <a id="1560" href="Effect.Monad.html#1522" class="Bound">M</a>
<a id="Join.join"></a><a id="1565" href="Effect.Monad.html#1565" class="Function">join</a> <a id="1570" class="Symbol">:</a> <a id="1572" href="Effect.Monad.html#1502" class="Bound">F</a> <a id="1574" class="Symbol">(</a><a id="1575" href="Effect.Monad.html#1502" class="Bound">F</a> <a id="1577" href="Effect.Monad.html#657" class="Generalizable">A</a><a id="1578" class="Symbol">)</a> <a id="1580" class="Symbol"></a> <a id="1582" href="Effect.Monad.html#1502" class="Bound">F</a> <a id="1584" href="Effect.Monad.html#657" class="Generalizable">A</a>
<a id="1588" href="Effect.Monad.html#1565" class="Function">join</a> <a id="1593" class="Symbol">=</a> <a id="1595" href="Effect.Monad.html#933" class="Field Operator">_&gt;&gt;=</a> <a id="1600" href="Function.Base.html#704" class="Function">id</a>
<a id="1604" class="Comment">-- Smart constructor</a>
<a id="1626" class="Keyword">module</a> <a id="1633" href="Effect.Monad.html#1633" class="Module">_</a> <a id="1635" class="Keyword">where</a>
<a id="1644" class="Keyword">open</a> <a id="1649" href="Effect.Monad.html#779" class="Module">RawMonad</a>
<a id="1660" class="Keyword">open</a> <a id="1665" href="Effect.Applicative.html#984" class="Module">RawApplicative</a>
<a id="1683" href="Effect.Monad.html#1683" class="Function">mkRawMonad</a> <a id="1694" class="Symbol">:</a>
<a id="1700" class="Symbol">(</a><a id="1701" href="Effect.Monad.html#1701" class="Bound">F</a> <a id="1703" class="Symbol">:</a> <a id="1705" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1709" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="1711" class="Symbol"></a> <a id="1713" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1717" href="Effect.Monad.html#635" class="Generalizable">f</a><a id="1718" class="Symbol">)</a> <a id="1720" class="Symbol"></a>
<a id="1726" class="Symbol">(</a><a id="1727" href="Effect.Monad.html#1727" class="Bound">pure</a> <a id="1732" class="Symbol">:</a> <a id="1734" class="Symbol"></a> <a id="1736" class="Symbol">{</a><a id="1737" href="Effect.Monad.html#1737" class="Bound">A</a><a id="1738" class="Symbol">}</a> <a id="1740" class="Symbol"></a> <a id="1742" href="Effect.Monad.html#1737" class="Bound">A</a> <a id="1744" class="Symbol"></a> <a id="1746" href="Effect.Monad.html#1701" class="Bound">F</a> <a id="1748" href="Effect.Monad.html#1737" class="Bound">A</a><a id="1749" class="Symbol">)</a> <a id="1751" class="Symbol"></a>
<a id="1757" class="Symbol">(</a><a id="1758" href="Effect.Monad.html#1758" class="Bound">bind</a> <a id="1763" class="Symbol">:</a> <a id="1765" class="Symbol"></a> <a id="1767" class="Symbol">{</a><a id="1768" href="Effect.Monad.html#1768" class="Bound">A</a> <a id="1770" href="Effect.Monad.html#1770" class="Bound">B</a><a id="1771" class="Symbol">}</a> <a id="1773" class="Symbol"></a> <a id="1775" href="Effect.Monad.html#1701" class="Bound">F</a> <a id="1777" href="Effect.Monad.html#1768" class="Bound">A</a> <a id="1779" class="Symbol"></a> <a id="1781" class="Symbol">(</a><a id="1782" href="Effect.Monad.html#1768" class="Bound">A</a> <a id="1784" class="Symbol"></a> <a id="1786" href="Effect.Monad.html#1701" class="Bound">F</a> <a id="1788" href="Effect.Monad.html#1770" class="Bound">B</a><a id="1789" class="Symbol">)</a> <a id="1791" class="Symbol"></a> <a id="1793" href="Effect.Monad.html#1701" class="Bound">F</a> <a id="1795" href="Effect.Monad.html#1770" class="Bound">B</a><a id="1796" class="Symbol">)</a> <a id="1798" class="Symbol"></a>
<a id="1804" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="1813" href="Effect.Monad.html#1701" class="Bound">F</a>
<a id="1817" href="Effect.Monad.html#1683" class="Function">mkRawMonad</a> <a id="1828" href="Effect.Monad.html#1828" class="Bound">F</a> <a id="1830" href="Effect.Monad.html#1830" class="Bound">pure</a> <a id="1835" href="Effect.Monad.html#1835" class="Bound Operator">_&gt;&gt;=_</a> <a id="1841" class="Symbol">.</a><a id="1842" href="Effect.Monad.html#895" class="Field">rawApplicative</a> <a id="1857" class="Symbol">=</a>
<a id="1863" href="Effect.Applicative.html#1858" class="Function">mkRawApplicative</a> <a id="1880" class="Symbol">_</a> <a id="1882" href="Effect.Monad.html#1830" class="Bound">pure</a> <a id="1887" href="Function.Base.html#3839" class="Function Operator">$</a> <a id="1890" class="Symbol">λ</a> <a id="1892" href="Effect.Monad.html#1892" class="Bound">mf</a> <a id="1895" href="Effect.Monad.html#1895" class="Bound">mx</a> <a id="1898" class="Symbol"></a> <a id="1900" class="Keyword">do</a>
<a id="1909" href="Effect.Monad.html#1909" class="Bound">f</a> <a id="1911" href="Effect.Monad.html#1835" class="Bound Operator"></a> <a id="1913" href="Effect.Monad.html#1892" class="Bound">mf</a>
<a id="1922" href="Effect.Monad.html#1922" class="Bound">x</a> <a id="1924" href="Effect.Monad.html#1835" class="Bound Operator"></a> <a id="1926" href="Effect.Monad.html#1895" class="Bound">mx</a>
<a id="1935" href="Effect.Monad.html#1830" class="Bound">pure</a> <a id="1940" class="Symbol">(</a><a id="1941" href="Effect.Monad.html#1909" class="Bound">f</a> <a id="1943" href="Effect.Monad.html#1922" class="Bound">x</a><a id="1944" class="Symbol">)</a>
<a id="1948" href="Effect.Monad.html#1683" class="Function">mkRawMonad</a> <a id="1959" href="Effect.Monad.html#1959" class="Bound">F</a> <a id="1961" href="Effect.Monad.html#1961" class="Bound">pure</a> <a id="1966" href="Effect.Monad.html#1966" class="Bound Operator">_&gt;&gt;=_</a> <a id="1972" class="Symbol">.</a><a id="1973" href="Effect.Monad.html#933" class="Field Operator">_&gt;&gt;=_</a> <a id="1979" class="Symbol">=</a> <a id="1981" href="Effect.Monad.html#1966" class="Bound Operator">_&gt;&gt;=_</a>
<a id="1988" class="Comment">------------------------------------------------------------------------</a>
<a id="2061" class="Comment">-- The type of raw monads with a zero</a>
<a id="2100" class="Keyword">record</a> <a id="RawMonadZero"></a><a id="2107" href="Effect.Monad.html#2107" class="Record">RawMonadZero</a> <a id="2120" class="Symbol">(</a><a id="2121" href="Effect.Monad.html#2121" class="Bound">F</a> <a id="2123" class="Symbol">:</a> <a id="2125" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2129" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="2131" class="Symbol"></a> <a id="2133" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2137" href="Effect.Monad.html#637" class="Generalizable">g</a><a id="2138" class="Symbol">)</a> <a id="2140" class="Symbol">:</a> <a id="2142" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2146" class="Symbol">(</a><a id="2147" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="2151" href="Effect.Monad.html#2129" class="Bound">f</a> <a id="2153" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="2155" href="Effect.Monad.html#2137" class="Bound">g</a><a id="2156" class="Symbol">)</a> <a id="2158" class="Keyword">where</a>
<a id="2166" class="Keyword">field</a>
<a id="RawMonadZero.rawMonad"></a><a id="2176" href="Effect.Monad.html#2176" class="Field">rawMonad</a> <a id="2185" class="Symbol">:</a> <a id="2187" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="2196" href="Effect.Monad.html#2121" class="Bound">F</a>
<a id="RawMonadZero.rawEmpty"></a><a id="2202" href="Effect.Monad.html#2202" class="Field">rawEmpty</a> <a id="2211" class="Symbol">:</a> <a id="2213" href="Effect.Empty.html#384" class="Record">RawEmpty</a> <a id="2222" href="Effect.Monad.html#2121" class="Bound">F</a>
<a id="2227" class="Keyword">open</a> <a id="2232" href="Effect.Monad.html#779" class="Module">RawMonad</a> <a id="2241" href="Effect.Monad.html#2176" class="Field">rawMonad</a> <a id="2250" class="Keyword">public</a>
<a id="2259" class="Keyword">open</a> <a id="2264" href="Effect.Empty.html#384" class="Module">RawEmpty</a> <a id="2273" href="Effect.Monad.html#2202" class="Field">rawEmpty</a> <a id="2282" class="Keyword">public</a>
<a id="RawMonadZero.rawApplicativeZero"></a><a id="2292" href="Effect.Monad.html#2292" class="Function">rawApplicativeZero</a> <a id="2311" class="Symbol">:</a> <a id="2313" href="Effect.Applicative.html#2276" class="Record">RawApplicativeZero</a> <a id="2332" href="Effect.Monad.html#2121" class="Bound">F</a>
<a id="2336" href="Effect.Monad.html#2292" class="Function">rawApplicativeZero</a> <a id="2355" class="Symbol">=</a> <a id="2357" class="Keyword">record</a>
<a id="2368" class="Symbol">{</a> <a id="2370" href="Effect.Applicative.html#2351" class="Field">rawApplicative</a> <a id="2385" class="Symbol">=</a> <a id="2387" href="Effect.Monad.html#895" class="Function">rawApplicative</a>
<a id="2406" class="Symbol">;</a> <a id="2408" href="Effect.Applicative.html#2389" class="Field">rawEmpty</a> <a id="2417" class="Symbol">=</a> <a id="2419" href="Effect.Monad.html#2202" class="Field">rawEmpty</a>
<a id="2432" class="Symbol">}</a>
<a id="2435" class="Comment">------------------------------------------------------------------------</a>
<a id="2508" class="Comment">-- The type of raw monadplus</a>
<a id="2538" class="Keyword">record</a> <a id="RawMonadPlus"></a><a id="2545" href="Effect.Monad.html#2545" class="Record">RawMonadPlus</a> <a id="2558" class="Symbol">(</a><a id="2559" href="Effect.Monad.html#2559" class="Bound">F</a> <a id="2561" class="Symbol">:</a> <a id="2563" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2567" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="2569" class="Symbol"></a> <a id="2571" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2575" href="Effect.Monad.html#637" class="Generalizable">g</a><a id="2576" class="Symbol">)</a> <a id="2578" class="Symbol">:</a> <a id="2580" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2584" class="Symbol">(</a><a id="2585" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="2589" href="Effect.Monad.html#2567" class="Bound">f</a> <a id="2591" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="2593" href="Effect.Monad.html#2575" class="Bound">g</a><a id="2594" class="Symbol">)</a> <a id="2596" class="Keyword">where</a>
<a id="2604" class="Keyword">field</a>
<a id="RawMonadPlus.rawMonadZero"></a><a id="2614" href="Effect.Monad.html#2614" class="Field">rawMonadZero</a> <a id="2627" class="Symbol">:</a> <a id="2629" href="Effect.Monad.html#2107" class="Record">RawMonadZero</a> <a id="2642" href="Effect.Monad.html#2559" class="Bound">F</a>
<a id="RawMonadPlus.rawChoice"></a><a id="2648" href="Effect.Monad.html#2648" class="Field">rawChoice</a> <a id="2661" class="Symbol">:</a> <a id="2663" href="Effect.Choice.html#414" class="Record">RawChoice</a> <a id="2673" href="Effect.Monad.html#2559" class="Bound">F</a>
<a id="2678" class="Keyword">open</a> <a id="2683" href="Effect.Monad.html#2107" class="Module">RawMonadZero</a> <a id="2696" href="Effect.Monad.html#2614" class="Field">rawMonadZero</a> <a id="2709" class="Keyword">public</a>
<a id="2718" class="Keyword">open</a> <a id="2723" href="Effect.Choice.html#414" class="Module">RawChoice</a> <a id="2733" href="Effect.Monad.html#2648" class="Field">rawChoice</a> <a id="2743" class="Keyword">public</a>
<a id="RawMonadPlus.rawAlternative"></a><a id="2753" href="Effect.Monad.html#2753" class="Function">rawAlternative</a> <a id="2768" class="Symbol">:</a> <a id="2770" href="Effect.Applicative.html#2680" class="Record">RawAlternative</a> <a id="2785" href="Effect.Monad.html#2559" class="Bound">F</a>
<a id="2789" href="Effect.Monad.html#2753" class="Function">rawAlternative</a> <a id="2804" class="Symbol">=</a> <a id="2806" class="Keyword">record</a>
<a id="2817" class="Symbol">{</a> <a id="2819" href="Effect.Applicative.html#2751" class="Field">rawApplicativeZero</a> <a id="2838" class="Symbol">=</a> <a id="2840" href="Effect.Monad.html#2292" class="Function">rawApplicativeZero</a>
<a id="2863" class="Symbol">;</a> <a id="2865" href="Effect.Applicative.html#2797" class="Field">rawChoice</a> <a id="2875" class="Symbol">=</a> <a id="2877" href="Effect.Monad.html#2648" class="Field">rawChoice</a>
<a id="2891" class="Symbol">}</a>
<a id="2894" class="Comment">------------------------------------------------------------------------</a>
<a id="2967" class="Comment">-- The type of raw monad transformer</a>
<a id="3005" class="Comment">-- F has been RawMonadT&#39;d as TF</a>
<a id="3037" class="Keyword">record</a> <a id="RawMonadTd"></a><a id="3044" href="Effect.Monad.html#3044" class="Record">RawMonadTd</a> <a id="3055" class="Symbol">(</a><a id="3056" href="Effect.Monad.html#3056" class="Bound">F</a> <a id="3058" class="Symbol">:</a> <a id="3060" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3064" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="3066" class="Symbol"></a> <a id="3068" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3072" href="Effect.Monad.html#639" class="Generalizable">g₁</a><a id="3074" class="Symbol">)</a> <a id="3076" class="Symbol">(</a><a id="3077" href="Effect.Monad.html#3077" class="Bound">TF</a> <a id="3080" class="Symbol">:</a> <a id="3082" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3086" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="3088" class="Symbol"></a> <a id="3090" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3094" href="Effect.Monad.html#642" class="Generalizable">g₂</a><a id="3096" class="Symbol">)</a> <a id="3098" class="Symbol">:</a> <a id="3100" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3104" class="Symbol">(</a><a id="3105" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="3109" href="Effect.Monad.html#3064" class="Bound">f</a> <a id="3111" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="3113" href="Effect.Monad.html#3072" class="Bound">g₁</a> <a id="3116" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="3118" href="Effect.Monad.html#3094" class="Bound">g₂</a><a id="3120" class="Symbol">)</a> <a id="3122" class="Keyword">where</a>
<a id="3130" class="Keyword">field</a>
<a id="RawMonadTd.lift"></a><a id="3140" href="Effect.Monad.html#3140" class="Field">lift</a> <a id="3145" class="Symbol">:</a> <a id="3147" href="Effect.Monad.html#3056" class="Bound">F</a> <a id="3149" href="Effect.Monad.html#657" class="Generalizable">A</a> <a id="3151" class="Symbol"></a> <a id="3153" href="Effect.Monad.html#3077" class="Bound">TF</a> <a id="3156" href="Effect.Monad.html#657" class="Generalizable">A</a>
<a id="RawMonadTd.rawMonad"></a><a id="3162" href="Effect.Monad.html#3162" class="Field">rawMonad</a> <a id="3171" class="Symbol">:</a> <a id="3173" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="3182" href="Effect.Monad.html#3077" class="Bound">TF</a>
<a id="3188" class="Keyword">open</a> <a id="3193" href="Effect.Monad.html#779" class="Module">RawMonad</a> <a id="3202" href="Effect.Monad.html#3162" class="Field">rawMonad</a> <a id="3211" class="Keyword">public</a>
<a id="RawMonadT"></a><a id="3219" href="Effect.Monad.html#3219" class="Function">RawMonadT</a> <a id="3229" class="Symbol">:</a> <a id="3231" class="Symbol">(</a><a id="3232" href="Effect.Monad.html#3232" class="Bound">T</a> <a id="3234" class="Symbol">:</a> <a id="3236" class="Symbol">(</a><a id="3237" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3241" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="3243" class="Symbol"></a> <a id="3245" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3249" href="Effect.Monad.html#639" class="Generalizable">g₁</a><a id="3251" class="Symbol">)</a> <a id="3253" class="Symbol"></a> <a id="3255" class="Symbol">(</a><a id="3256" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3260" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="3262" class="Symbol"></a> <a id="3264" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3268" href="Effect.Monad.html#642" class="Generalizable">g₂</a><a id="3270" class="Symbol">))</a> <a id="3273" class="Symbol"></a> <a id="3275" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3279" class="Symbol">(</a><a id="3280" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="3284" href="Effect.Monad.html#635" class="Generalizable">f</a> <a id="3286" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="3288" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="3292" href="Effect.Monad.html#639" class="Generalizable">g₁</a> <a id="3295" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="3297" href="Effect.Monad.html#642" class="Generalizable">g₂</a><a id="3299" class="Symbol">)</a>
<a id="3301" href="Effect.Monad.html#3219" class="Function">RawMonadT</a> <a id="3311" href="Effect.Monad.html#3311" class="Bound">T</a> <a id="3313" class="Symbol">=</a> <a id="3315" class="Symbol"></a> <a id="3317" class="Symbol">{</a><a id="3318" href="Effect.Monad.html#3318" class="Bound">M</a><a id="3319" class="Symbol">}</a> <a id="3321" class="Symbol"></a> <a id="3323" href="Effect.Monad.html#779" class="Record">RawMonad</a> <a id="3332" href="Effect.Monad.html#3318" class="Bound">M</a> <a id="3334" class="Symbol"></a> <a id="3336" href="Effect.Monad.html#3044" class="Record">RawMonadTd</a> <a id="3347" href="Effect.Monad.html#3318" class="Bound">M</a> <a id="3349" class="Symbol">(</a><a id="3350" href="Effect.Monad.html#3311" class="Bound">T</a> <a id="3352" href="Effect.Monad.html#3318" class="Bound">M</a><a id="3353" class="Symbol">)</a>
</pre></body></html>