mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
135 lines
36 KiB
HTML
135 lines
36 KiB
HTML
|
<!DOCTYPE HTML>
|
|||
|
<html><head><meta charset="utf-8"><title>Effect.Applicative</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">-- Applicative functors</a>
|
|||
|
<a id="130" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
|
|||
|
<a id="204" class="Comment">-- Note that currently the applicative functor laws are not included</a>
|
|||
|
<a id="273" class="Comment">-- here.</a>
|
|||
|
|
|||
|
<a id="283" class="Symbol">{-#</a> <a id="287" class="Keyword">OPTIONS</a> <a id="295" class="Pragma">--cubical-compatible</a> <a id="316" class="Pragma">--safe</a> <a id="323" class="Symbol">#-}</a>
|
|||
|
|
|||
|
<a id="328" class="Keyword">module</a> <a id="335" href="Effect.Applicative.html" class="Module">Effect.Applicative</a> <a id="354" class="Keyword">where</a>
|
|||
|
|
|||
|
<a id="361" class="Keyword">open</a> <a id="366" class="Keyword">import</a> <a id="373" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a> <a id="388" class="Keyword">using</a> <a id="394" class="Symbol">(</a><a id="395" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a><a id="399" class="Symbol">;</a> <a id="401" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a><a id="405" class="Symbol">;</a> <a id="407" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a><a id="412" class="Symbol">)</a>
|
|||
|
<a id="414" class="Keyword">open</a> <a id="419" class="Keyword">import</a> <a id="426" href="Data.Product.Base.html" class="Module">Data.Product.Base</a> <a id="444" class="Keyword">using</a> <a id="450" class="Symbol">(</a><a id="451" href="Data.Product.Base.html#1618" class="Function Operator">_×_</a><a id="454" class="Symbol">;</a> <a id="456" href="Agda.Builtin.Sigma.html#235" class="InductiveConstructor Operator">_,_</a><a id="459" class="Symbol">)</a>
|
|||
|
<a id="461" class="Keyword">open</a> <a id="466" class="Keyword">import</a> <a id="473" href="Data.Unit.Polymorphic.Base.html" class="Module">Data.Unit.Polymorphic.Base</a> <a id="500" class="Keyword">using</a> <a id="506" class="Symbol">(</a><a id="507" href="Data.Unit.Polymorphic.Base.html#489" class="Function">⊤</a><a id="508" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="511" class="Keyword">open</a> <a id="516" class="Keyword">import</a> <a id="523" href="Effect.Choice.html" class="Module">Effect.Choice</a> <a id="537" class="Keyword">using</a> <a id="543" class="Symbol">(</a><a id="544" href="Effect.Choice.html#414" class="Record">RawChoice</a><a id="553" class="Symbol">)</a>
|
|||
|
<a id="555" class="Keyword">open</a> <a id="560" class="Keyword">import</a> <a id="567" href="Effect.Empty.html" class="Module">Effect.Empty</a> <a id="580" class="Keyword">using</a> <a id="586" class="Symbol">(</a><a id="587" href="Effect.Empty.html#384" class="Record">RawEmpty</a><a id="595" class="Symbol">)</a>
|
|||
|
<a id="597" class="Keyword">open</a> <a id="602" class="Keyword">import</a> <a id="609" href="Effect.Functor.html" class="Module">Effect.Functor</a> <a id="624" class="Symbol">as</a> <a id="627" class="Module">Fun</a> <a id="631" class="Keyword">using</a> <a id="637" class="Symbol">(</a><a id="638" href="Effect.Functor.html#579" class="Record">RawFunctor</a><a id="648" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="651" class="Keyword">open</a> <a id="656" class="Keyword">import</a> <a id="663" href="Function.Base.html" class="Module">Function.Base</a> <a id="677" class="Keyword">using</a> <a id="683" class="Symbol">(</a><a id="684" href="Function.Base.html#725" class="Function">const</a><a id="689" class="Symbol">;</a> <a id="691" href="Function.Base.html#1638" class="Function">flip</a><a id="695" class="Symbol">;</a> <a id="697" href="Function.Base.html#3626" class="Function Operator">_∘′_</a><a id="701" class="Symbol">)</a>
|
|||
|
<a id="703" class="Keyword">open</a> <a id="708" class="Keyword">import</a> <a id="715" href="Level.html" class="Module">Level</a> <a id="721" class="Keyword">using</a> <a id="727" class="Symbol">(</a><a id="728" href="Agda.Primitive.html#742" class="Postulate">Level</a><a id="733" class="Symbol">;</a> <a id="735" href="Agda.Primitive.html#931" class="Primitive">suc</a><a id="738" class="Symbol">;</a> <a id="740" href="Agda.Primitive.html#961" class="Primitive Operator">_⊔_</a><a id="743" class="Symbol">)</a>
|
|||
|
<a id="745" class="Keyword">open</a> <a id="750" class="Keyword">import</a> <a id="757" href="Relation.Binary.PropositionalEquality.Core.html" class="Module">Relation.Binary.PropositionalEquality.Core</a> <a id="800" class="Symbol">as</a> <a id="803" class="Module">P</a> <a id="805" class="Keyword">using</a> <a id="811" class="Symbol">(</a><a id="812" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">_≡_</a><a id="815" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="818" class="Keyword">private</a>
|
|||
|
<a id="828" class="Keyword">variable</a>
|
|||
|
<a id="841" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="843" href="Effect.Applicative.html#843" class="Generalizable">g</a> <a id="845" class="Symbol">:</a> <a id="847" href="Agda.Primitive.html#742" class="Postulate">Level</a>
|
|||
|
<a id="857" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="859" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="861" href="Effect.Applicative.html#861" class="Generalizable">C</a> <a id="863" class="Symbol">:</a> <a id="865" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="869" href="Effect.Applicative.html#841" class="Generalizable">f</a>
|
|||
|
<a id="871" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="944" class="Comment">-- The type of raw applicatives</a>
|
|||
|
|
|||
|
<a id="977" class="Keyword">record</a> <a id="RawApplicative"></a><a id="984" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="999" class="Symbol">(</a><a id="1000" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1002" class="Symbol">:</a> <a id="1004" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1008" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="1010" class="Symbol">→</a> <a id="1012" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1016" href="Effect.Applicative.html#843" class="Generalizable">g</a><a id="1017" class="Symbol">)</a> <a id="1019" class="Symbol">:</a> <a id="1021" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1025" class="Symbol">(</a><a id="1026" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="1030" href="Effect.Applicative.html#1008" class="Bound">f</a> <a id="1032" href="Agda.Primitive.html#961" class="Primitive Operator">⊔</a> <a id="1034" href="Effect.Applicative.html#1016" class="Bound">g</a><a id="1035" class="Symbol">)</a> <a id="1037" class="Keyword">where</a>
|
|||
|
<a id="1045" class="Keyword">infixl</a> <a id="1052" class="Number">4</a> <a id="1054" href="Effect.Applicative.html#1171" class="Field Operator">_<*>_</a> <a id="1060" href="Effect.Applicative.html#1241" class="Function Operator">_<*_</a> <a id="1065" href="Effect.Applicative.html#1296" class="Function Operator">_*>_</a>
|
|||
|
<a id="1072" class="Keyword">infixl</a> <a id="1079" class="Number">4</a> <a id="1081" href="Effect.Applicative.html#1610" class="Function Operator">_⊛_</a> <a id="1085" href="Effect.Applicative.html#1655" class="Function Operator">_<⊛_</a> <a id="1090" href="Effect.Applicative.html#1695" class="Function Operator">_⊛>_</a>
|
|||
|
<a id="1097" class="Keyword">infix</a> <a id="1104" class="Number">4</a> <a id="1106" href="Effect.Applicative.html#1735" class="Function Operator">_⊗_</a>
|
|||
|
<a id="1112" class="Keyword">field</a>
|
|||
|
<a id="RawApplicative.rawFunctor"></a><a id="1122" href="Effect.Applicative.html#1122" class="Field">rawFunctor</a> <a id="1133" class="Symbol">:</a> <a id="1135" href="Effect.Functor.html#579" class="Record">RawFunctor</a> <a id="1146" href="Effect.Applicative.html#1000" class="Bound">F</a>
|
|||
|
<a id="RawApplicative.pure"></a><a id="1152" href="Effect.Applicative.html#1152" class="Field">pure</a> <a id="1157" class="Symbol">:</a> <a id="1159" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1161" class="Symbol">→</a> <a id="1163" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1165" href="Effect.Applicative.html#857" class="Generalizable">A</a>
|
|||
|
<a id="RawApplicative._<*>_"></a><a id="1171" href="Effect.Applicative.html#1171" class="Field Operator">_<*>_</a> <a id="1177" class="Symbol">:</a> <a id="1179" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1181" class="Symbol">(</a><a id="1182" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1184" class="Symbol">→</a> <a id="1186" href="Effect.Applicative.html#859" class="Generalizable">B</a><a id="1187" class="Symbol">)</a> <a id="1189" class="Symbol">→</a> <a id="1191" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1193" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1195" class="Symbol">→</a> <a id="1197" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1199" href="Effect.Applicative.html#859" class="Generalizable">B</a>
|
|||
|
|
|||
|
<a id="1204" class="Keyword">open</a> <a id="1209" href="Effect.Functor.html#579" class="Module">RawFunctor</a> <a id="1220" href="Effect.Applicative.html#1122" class="Field">rawFunctor</a> <a id="1231" class="Keyword">public</a>
|
|||
|
|
|||
|
<a id="RawApplicative._<*_"></a><a id="1241" href="Effect.Applicative.html#1241" class="Function Operator">_<*_</a> <a id="1246" class="Symbol">:</a> <a id="1248" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1250" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1252" class="Symbol">→</a> <a id="1254" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1256" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1258" class="Symbol">→</a> <a id="1260" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1262" href="Effect.Applicative.html#857" class="Generalizable">A</a>
|
|||
|
<a id="1266" href="Effect.Applicative.html#1266" class="Bound">a</a> <a id="1268" href="Effect.Applicative.html#1241" class="Function Operator"><*</a> <a id="1271" href="Effect.Applicative.html#1271" class="Bound">b</a> <a id="1273" class="Symbol">=</a> <a id="1275" href="Function.Base.html#725" class="Function">const</a> <a id="1281" href="Effect.Functor.html#687" class="Function Operator"><$></a> <a id="1285" href="Effect.Applicative.html#1266" class="Bound">a</a> <a id="1287" href="Effect.Applicative.html#1171" class="Field Operator"><*></a> <a id="1291" href="Effect.Applicative.html#1271" class="Bound">b</a>
|
|||
|
|
|||
|
<a id="RawApplicative._*>_"></a><a id="1296" href="Effect.Applicative.html#1296" class="Function Operator">_*>_</a> <a id="1301" class="Symbol">:</a> <a id="1303" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1305" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1307" class="Symbol">→</a> <a id="1309" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1311" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1313" class="Symbol">→</a> <a id="1315" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1317" href="Effect.Applicative.html#859" class="Generalizable">B</a>
|
|||
|
<a id="1321" href="Effect.Applicative.html#1321" class="Bound">a</a> <a id="1323" href="Effect.Applicative.html#1296" class="Function Operator">*></a> <a id="1326" href="Effect.Applicative.html#1326" class="Bound">b</a> <a id="1328" class="Symbol">=</a> <a id="1330" href="Function.Base.html#1638" class="Function">flip</a> <a id="1335" href="Function.Base.html#725" class="Function">const</a> <a id="1341" href="Effect.Functor.html#687" class="Function Operator"><$></a> <a id="1345" href="Effect.Applicative.html#1321" class="Bound">a</a> <a id="1347" href="Effect.Applicative.html#1171" class="Field Operator"><*></a> <a id="1351" href="Effect.Applicative.html#1326" class="Bound">b</a>
|
|||
|
|
|||
|
<a id="RawApplicative.zipWith"></a><a id="1356" href="Effect.Applicative.html#1356" class="Function">zipWith</a> <a id="1364" class="Symbol">:</a> <a id="1366" class="Symbol">(</a><a id="1367" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1369" class="Symbol">→</a> <a id="1371" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1373" class="Symbol">→</a> <a id="1375" href="Effect.Applicative.html#861" class="Generalizable">C</a><a id="1376" class="Symbol">)</a> <a id="1378" class="Symbol">→</a> <a id="1380" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1382" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1384" class="Symbol">→</a> <a id="1386" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1388" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1390" class="Symbol">→</a> <a id="1392" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1394" href="Effect.Applicative.html#861" class="Generalizable">C</a>
|
|||
|
<a id="1398" href="Effect.Applicative.html#1356" class="Function">zipWith</a> <a id="1406" href="Effect.Applicative.html#1406" class="Bound">f</a> <a id="1408" href="Effect.Applicative.html#1408" class="Bound">x</a> <a id="1410" href="Effect.Applicative.html#1410" class="Bound">y</a> <a id="1412" class="Symbol">=</a> <a id="1414" href="Effect.Applicative.html#1406" class="Bound">f</a> <a id="1416" href="Effect.Functor.html#687" class="Function Operator"><$></a> <a id="1420" href="Effect.Applicative.html#1408" class="Bound">x</a> <a id="1422" href="Effect.Applicative.html#1171" class="Field Operator"><*></a> <a id="1426" href="Effect.Applicative.html#1410" class="Bound">y</a>
|
|||
|
|
|||
|
<a id="RawApplicative.zip"></a><a id="1431" href="Effect.Applicative.html#1431" class="Function">zip</a> <a id="1435" class="Symbol">:</a> <a id="1437" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1439" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1441" class="Symbol">→</a> <a id="1443" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1445" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1447" class="Symbol">→</a> <a id="1449" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1451" class="Symbol">(</a><a id="1452" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1454" href="Data.Product.Base.html#1618" class="Function Operator">×</a> <a id="1456" href="Effect.Applicative.html#859" class="Generalizable">B</a><a id="1457" class="Symbol">)</a>
|
|||
|
<a id="1461" href="Effect.Applicative.html#1431" class="Function">zip</a> <a id="1465" class="Symbol">=</a> <a id="1467" href="Effect.Applicative.html#1356" class="Function">zipWith</a> <a id="1475" href="Agda.Builtin.Sigma.html#235" class="InductiveConstructor Operator">_,_</a>
|
|||
|
|
|||
|
<a id="1482" class="Comment">-- Haskell-style alternative name for pure</a>
|
|||
|
<a id="RawApplicative.return"></a><a id="1527" href="Effect.Applicative.html#1527" class="Function">return</a> <a id="1534" class="Symbol">:</a> <a id="1536" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1538" class="Symbol">→</a> <a id="1540" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1542" href="Effect.Applicative.html#857" class="Generalizable">A</a>
|
|||
|
<a id="1546" href="Effect.Applicative.html#1527" class="Function">return</a> <a id="1553" class="Symbol">=</a> <a id="1555" href="Effect.Applicative.html#1152" class="Field">pure</a>
|
|||
|
|
|||
|
<a id="1563" class="Comment">-- backwards compatibility: unicode variants</a>
|
|||
|
<a id="RawApplicative._⊛_"></a><a id="1610" href="Effect.Applicative.html#1610" class="Function Operator">_⊛_</a> <a id="1614" class="Symbol">:</a> <a id="1616" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1618" class="Symbol">(</a><a id="1619" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1621" class="Symbol">→</a> <a id="1623" href="Effect.Applicative.html#859" class="Generalizable">B</a><a id="1624" class="Symbol">)</a> <a id="1626" class="Symbol">→</a> <a id="1628" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1630" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1632" class="Symbol">→</a> <a id="1634" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1636" href="Effect.Applicative.html#859" class="Generalizable">B</a>
|
|||
|
<a id="1640" href="Effect.Applicative.html#1610" class="Function Operator">_⊛_</a> <a id="1644" class="Symbol">=</a> <a id="1646" href="Effect.Applicative.html#1171" class="Field Operator">_<*>_</a>
|
|||
|
|
|||
|
<a id="RawApplicative._<⊛_"></a><a id="1655" href="Effect.Applicative.html#1655" class="Function Operator">_<⊛_</a> <a id="1660" class="Symbol">:</a> <a id="1662" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1664" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1666" class="Symbol">→</a> <a id="1668" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1670" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1672" class="Symbol">→</a> <a id="1674" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1676" href="Effect.Applicative.html#857" class="Generalizable">A</a>
|
|||
|
<a id="1680" href="Effect.Applicative.html#1655" class="Function Operator">_<⊛_</a> <a id="1685" class="Symbol">=</a> <a id="1687" href="Effect.Applicative.html#1241" class="Function Operator">_<*_</a>
|
|||
|
|
|||
|
<a id="RawApplicative._⊛>_"></a><a id="1695" href="Effect.Applicative.html#1695" class="Function Operator">_⊛>_</a> <a id="1700" class="Symbol">:</a> <a id="1702" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1704" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1706" class="Symbol">→</a> <a id="1708" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1710" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1712" class="Symbol">→</a> <a id="1714" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1716" href="Effect.Applicative.html#859" class="Generalizable">B</a>
|
|||
|
<a id="1720" href="Effect.Applicative.html#1695" class="Function Operator">_⊛>_</a> <a id="1725" class="Symbol">=</a> <a id="1727" href="Effect.Applicative.html#1296" class="Function Operator">_*>_</a>
|
|||
|
|
|||
|
<a id="RawApplicative._⊗_"></a><a id="1735" href="Effect.Applicative.html#1735" class="Function Operator">_⊗_</a> <a id="1739" class="Symbol">:</a> <a id="1741" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1743" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1745" class="Symbol">→</a> <a id="1747" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1749" href="Effect.Applicative.html#859" class="Generalizable">B</a> <a id="1751" class="Symbol">→</a> <a id="1753" href="Effect.Applicative.html#1000" class="Bound">F</a> <a id="1755" class="Symbol">(</a><a id="1756" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="1758" href="Data.Product.Base.html#1618" class="Function Operator">×</a> <a id="1760" href="Effect.Applicative.html#859" class="Generalizable">B</a><a id="1761" class="Symbol">)</a>
|
|||
|
<a id="1765" href="Effect.Applicative.html#1735" class="Function Operator">_⊗_</a> <a id="1769" class="Symbol">=</a> <a id="1771" href="Effect.Applicative.html#1431" class="Function">zip</a>
|
|||
|
|
|||
|
<a id="1776" class="Keyword">module</a> <a id="1783" href="Effect.Applicative.html#1783" class="Module">_</a> <a id="1785" class="Keyword">where</a>
|
|||
|
|
|||
|
<a id="1794" class="Keyword">open</a> <a id="1799" href="Effect.Applicative.html#984" class="Module">RawApplicative</a>
|
|||
|
<a id="1816" class="Keyword">open</a> <a id="1821" href="Effect.Functor.html#579" class="Module">RawFunctor</a>
|
|||
|
|
|||
|
<a id="1835" class="Comment">-- Smart constructor</a>
|
|||
|
<a id="1858" href="Effect.Applicative.html#1858" class="Function">mkRawApplicative</a> <a id="1875" class="Symbol">:</a>
|
|||
|
<a id="1881" class="Symbol">(</a><a id="1882" href="Effect.Applicative.html#1882" class="Bound">F</a> <a id="1884" class="Symbol">:</a> <a id="1886" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1890" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="1892" class="Symbol">→</a> <a id="1894" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1898" href="Effect.Applicative.html#841" class="Generalizable">f</a><a id="1899" class="Symbol">)</a> <a id="1901" class="Symbol">→</a>
|
|||
|
<a id="1907" class="Symbol">(</a><a id="1908" href="Effect.Applicative.html#1908" class="Bound">pure</a> <a id="1913" class="Symbol">:</a> <a id="1915" class="Symbol">∀</a> <a id="1917" class="Symbol">{</a><a id="1918" href="Effect.Applicative.html#1918" class="Bound">A</a><a id="1919" class="Symbol">}</a> <a id="1921" class="Symbol">→</a> <a id="1923" href="Effect.Applicative.html#1918" class="Bound">A</a> <a id="1925" class="Symbol">→</a> <a id="1927" href="Effect.Applicative.html#1882" class="Bound">F</a> <a id="1929" href="Effect.Applicative.html#1918" class="Bound">A</a><a id="1930" class="Symbol">)</a> <a id="1932" class="Symbol">→</a>
|
|||
|
<a id="1938" class="Symbol">(</a><a id="1939" href="Effect.Applicative.html#1939" class="Bound">app</a> <a id="1943" class="Symbol">:</a> <a id="1945" class="Symbol">∀</a> <a id="1947" class="Symbol">{</a><a id="1948" href="Effect.Applicative.html#1948" class="Bound">A</a> <a id="1950" href="Effect.Applicative.html#1950" class="Bound">B</a><a id="1951" class="Symbol">}</a> <a id="1953" class="Symbol">→</a> <a id="1955" href="Effect.Applicative.html#1882" class="Bound">F</a> <a id="1957" class="Symbol">(</a><a id="1958" href="Effect.Applicative.html#1948" class="Bound">A</a> <a id="1960" class="Symbol">→</a> <a id="1962" href="Effect.Applicative.html#1950" class="Bound">B</a><a id="1963" class="Symbol">)</a> <a id="1965" class="Symbol">→</a> <a id="1967" href="Effect.Applicative.html#1882" class="Bound">F</a> <a id="1969" href="Effect.Applicative.html#1948" class="Bound">A</a> <a id="1971" class="Symbol">→</a> <a id="1973" href="Effect.Applicative.html#1882" class="Bound">F</a> <a id="1975" href="Effect.Applicative.html#1950" class="Bound">B</a><a id="1976" class="Symbol">)</a> <a id="1978" class="Symbol">→</a>
|
|||
|
<a id="1984" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="1999" href="Effect.Applicative.html#1882" class="Bound">F</a>
|
|||
|
<a id="2003" href="Effect.Applicative.html#1858" class="Function">mkRawApplicative</a> <a id="2020" href="Effect.Applicative.html#2020" class="Bound">F</a> <a id="2022" href="Effect.Applicative.html#2022" class="Bound">pure</a> <a id="2027" href="Effect.Applicative.html#2027" class="Bound">app</a> <a id="2031" class="Symbol">.</a><a id="2032" href="Effect.Applicative.html#1122" class="Field">rawFunctor</a> <a id="2043" class="Symbol">.</a><a id="2044" href="Effect.Functor.html#687" class="Field Operator">_<$>_</a> <a id="2050" class="Symbol">=</a> <a id="2052" href="Effect.Applicative.html#2027" class="Bound">app</a> <a id="2056" href="Function.Base.html#3626" class="Function Operator">∘′</a> <a id="2059" href="Effect.Applicative.html#2022" class="Bound">pure</a>
|
|||
|
<a id="2066" href="Effect.Applicative.html#1858" class="Function">mkRawApplicative</a> <a id="2083" href="Effect.Applicative.html#2083" class="Bound">F</a> <a id="2085" href="Effect.Applicative.html#2085" class="Bound">pure</a> <a id="2090" href="Effect.Applicative.html#2090" class="Bound">app</a> <a id="2094" class="Symbol">.</a><a id="2095" href="Effect.Applicative.html#1152" class="Field">pure</a> <a id="2100" class="Symbol">=</a> <a id="2102" href="Effect.Applicative.html#2085" class="Bound">pure</a>
|
|||
|
<a id="2109" href="Effect.Applicative.html#1858" class="Function">mkRawApplicative</a> <a id="2126" href="Effect.Applicative.html#2126" class="Bound">F</a> <a id="2128" href="Effect.Applicative.html#2128" class="Bound">pure</a> <a id="2133" href="Effect.Applicative.html#2133" class="Bound">app</a> <a id="2137" class="Symbol">.</a><a id="2138" href="Effect.Applicative.html#1171" class="Field Operator">_<*>_</a> <a id="2144" class="Symbol">=</a> <a id="2146" href="Effect.Applicative.html#2133" class="Bound">app</a>
|
|||
|
|
|||
|
<a id="2151" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="2224" class="Comment">-- The type of raw applicatives with a zero</a>
|
|||
|
|
|||
|
<a id="2269" class="Keyword">record</a> <a id="RawApplicativeZero"></a><a id="2276" href="Effect.Applicative.html#2276" class="Record">RawApplicativeZero</a> <a id="2295" class="Symbol">(</a><a id="2296" href="Effect.Applicative.html#2296" class="Bound">F</a> <a id="2298" class="Symbol">:</a> <a id="2300" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2304" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="2306" class="Symbol">→</a> <a id="2308" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2312" href="Effect.Applicative.html#843" class="Generalizable">g</a><a id="2313" class="Symbol">)</a> <a id="2315" class="Symbol">:</a> <a id="2317" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2321" class="Symbol">(</a><a id="2322" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="2326" href="Effect.Applicative.html#2304" class="Bound">f</a> <a id="2328" href="Agda.Primitive.html#961" class="Primitive Operator">⊔</a> <a id="2330" href="Effect.Applicative.html#2312" class="Bound">g</a><a id="2331" class="Symbol">)</a> <a id="2333" class="Keyword">where</a>
|
|||
|
<a id="2341" class="Keyword">field</a>
|
|||
|
<a id="RawApplicativeZero.rawApplicative"></a><a id="2351" href="Effect.Applicative.html#2351" class="Field">rawApplicative</a> <a id="2366" class="Symbol">:</a> <a id="2368" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="2383" href="Effect.Applicative.html#2296" class="Bound">F</a>
|
|||
|
<a id="RawApplicativeZero.rawEmpty"></a><a id="2389" href="Effect.Applicative.html#2389" class="Field">rawEmpty</a> <a id="2398" class="Symbol">:</a> <a id="2400" href="Effect.Empty.html#384" class="Record">RawEmpty</a> <a id="2409" href="Effect.Applicative.html#2296" class="Bound">F</a>
|
|||
|
|
|||
|
<a id="2414" class="Keyword">open</a> <a id="2419" href="Effect.Applicative.html#984" class="Module">RawApplicative</a> <a id="2434" href="Effect.Applicative.html#2351" class="Field">rawApplicative</a> <a id="2449" class="Keyword">public</a>
|
|||
|
<a id="2458" class="Keyword">open</a> <a id="2463" href="Effect.Empty.html#384" class="Module">RawEmpty</a> <a id="2472" href="Effect.Applicative.html#2389" class="Field">rawEmpty</a> <a id="2481" class="Keyword">public</a>
|
|||
|
|
|||
|
<a id="RawApplicativeZero.guard"></a><a id="2491" href="Effect.Applicative.html#2491" class="Function">guard</a> <a id="2497" class="Symbol">:</a> <a id="2499" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a> <a id="2504" class="Symbol">→</a> <a id="2506" href="Effect.Applicative.html#2296" class="Bound">F</a> <a id="2508" href="Data.Unit.Polymorphic.Base.html#489" class="Function">⊤</a>
|
|||
|
<a id="2512" href="Effect.Applicative.html#2491" class="Function">guard</a> <a id="2518" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a> <a id="2523" class="Symbol">=</a> <a id="2525" href="Effect.Applicative.html#1152" class="Function">pure</a> <a id="2530" class="Symbol">_</a>
|
|||
|
<a id="2534" href="Effect.Applicative.html#2491" class="Function">guard</a> <a id="2540" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a> <a id="2546" class="Symbol">=</a> <a id="2548" href="Effect.Empty.html#451" class="Function">empty</a>
|
|||
|
|
|||
|
<a id="2555" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="2628" class="Comment">-- The type of raw alternative applicatives</a>
|
|||
|
|
|||
|
<a id="2673" class="Keyword">record</a> <a id="RawAlternative"></a><a id="2680" href="Effect.Applicative.html#2680" class="Record">RawAlternative</a> <a id="2695" class="Symbol">(</a><a id="2696" href="Effect.Applicative.html#2696" class="Bound">F</a> <a id="2698" class="Symbol">:</a> <a id="2700" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2704" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="2706" class="Symbol">→</a> <a id="2708" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2712" href="Effect.Applicative.html#843" class="Generalizable">g</a><a id="2713" class="Symbol">)</a> <a id="2715" class="Symbol">:</a> <a id="2717" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="2721" class="Symbol">(</a><a id="2722" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="2726" href="Effect.Applicative.html#2704" class="Bound">f</a> <a id="2728" href="Agda.Primitive.html#961" class="Primitive Operator">⊔</a> <a id="2730" href="Effect.Applicative.html#2712" class="Bound">g</a><a id="2731" class="Symbol">)</a> <a id="2733" class="Keyword">where</a>
|
|||
|
<a id="2741" class="Keyword">field</a>
|
|||
|
<a id="RawAlternative.rawApplicativeZero"></a><a id="2751" href="Effect.Applicative.html#2751" class="Field">rawApplicativeZero</a> <a id="2770" class="Symbol">:</a> <a id="2772" href="Effect.Applicative.html#2276" class="Record">RawApplicativeZero</a> <a id="2791" href="Effect.Applicative.html#2696" class="Bound">F</a>
|
|||
|
<a id="RawAlternative.rawChoice"></a><a id="2797" href="Effect.Applicative.html#2797" class="Field">rawChoice</a> <a id="2807" class="Symbol">:</a> <a id="2809" href="Effect.Choice.html#414" class="Record">RawChoice</a> <a id="2819" href="Effect.Applicative.html#2696" class="Bound">F</a>
|
|||
|
|
|||
|
<a id="2824" class="Keyword">open</a> <a id="2829" href="Effect.Applicative.html#2276" class="Module">RawApplicativeZero</a> <a id="2848" href="Effect.Applicative.html#2751" class="Field">rawApplicativeZero</a> <a id="2867" class="Keyword">public</a>
|
|||
|
<a id="2876" class="Keyword">open</a> <a id="2881" href="Effect.Choice.html#414" class="Module">RawChoice</a> <a id="2891" href="Effect.Applicative.html#2797" class="Field">rawChoice</a> <a id="2901" class="Keyword">public</a>
|
|||
|
|
|||
|
<a id="2909" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="2982" class="Comment">-- The type of applicative morphisms</a>
|
|||
|
|
|||
|
<a id="3020" class="Keyword">record</a> <a id="Morphism"></a><a id="3027" href="Effect.Applicative.html#3027" class="Record">Morphism</a> <a id="3036" class="Symbol">{</a><a id="3037" href="Effect.Applicative.html#3037" class="Bound">F₁</a> <a id="3040" href="Effect.Applicative.html#3040" class="Bound">F₂</a> <a id="3043" class="Symbol">:</a> <a id="3045" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3049" href="Effect.Applicative.html#841" class="Generalizable">f</a> <a id="3051" class="Symbol">→</a> <a id="3053" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3057" href="Effect.Applicative.html#843" class="Generalizable">g</a><a id="3058" class="Symbol">}</a>
|
|||
|
<a id="3076" class="Symbol">(</a><a id="3077" href="Effect.Applicative.html#3077" class="Bound">A₁</a> <a id="3080" class="Symbol">:</a> <a id="3082" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="3097" href="Effect.Applicative.html#3037" class="Bound">F₁</a><a id="3099" class="Symbol">)</a>
|
|||
|
<a id="3117" class="Symbol">(</a><a id="3118" href="Effect.Applicative.html#3118" class="Bound">A₂</a> <a id="3121" class="Symbol">:</a> <a id="3123" href="Effect.Applicative.html#984" class="Record">RawApplicative</a> <a id="3138" href="Effect.Applicative.html#3040" class="Bound">F₂</a><a id="3140" class="Symbol">)</a> <a id="3142" class="Symbol">:</a> <a id="3144" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="3148" class="Symbol">(</a><a id="3149" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="3153" href="Effect.Applicative.html#3049" class="Bound">f</a> <a id="3155" href="Agda.Primitive.html#961" class="Primitive Operator">⊔</a> <a id="3157" href="Effect.Applicative.html#3057" class="Bound">g</a><a id="3158" class="Symbol">)</a> <a id="3160" class="Keyword">where</a>
|
|||
|
<a id="3168" class="Keyword">module</a> <a id="Morphism.A₁"></a><a id="3175" href="Effect.Applicative.html#3175" class="Module">A₁</a> <a id="3178" class="Symbol">=</a> <a id="3180" href="Effect.Applicative.html#984" class="Module">RawApplicative</a> <a id="3195" href="Effect.Applicative.html#3077" class="Bound">A₁</a>
|
|||
|
<a id="3200" class="Keyword">module</a> <a id="Morphism.A₂"></a><a id="3207" href="Effect.Applicative.html#3207" class="Module">A₂</a> <a id="3210" class="Symbol">=</a> <a id="3212" href="Effect.Applicative.html#984" class="Module">RawApplicative</a> <a id="3227" href="Effect.Applicative.html#3118" class="Bound">A₂</a>
|
|||
|
<a id="3232" class="Keyword">field</a>
|
|||
|
<a id="Morphism.functorMorphism"></a><a id="3242" href="Effect.Applicative.html#3242" class="Field">functorMorphism</a> <a id="3258" class="Symbol">:</a> <a id="3260" href="Effect.Functor.html#958" class="Record">Fun.Morphism</a> <a id="3273" href="Effect.Applicative.html#1122" class="Function">A₁.rawFunctor</a> <a id="3287" href="Effect.Applicative.html#1122" class="Function">A₂.rawFunctor</a>
|
|||
|
|
|||
|
<a id="3304" class="Keyword">open</a> <a id="3309" href="Effect.Functor.html#958" class="Module">Fun.Morphism</a> <a id="3322" href="Effect.Applicative.html#3242" class="Field">functorMorphism</a> <a id="3338" class="Keyword">public</a>
|
|||
|
|
|||
|
<a id="3348" class="Keyword">field</a>
|
|||
|
<a id="Morphism.op-pure"></a><a id="3358" href="Effect.Applicative.html#3358" class="Field">op-pure</a> <a id="3366" class="Symbol">:</a> <a id="3368" class="Symbol">(</a><a id="3369" href="Effect.Applicative.html#3369" class="Bound">x</a> <a id="3371" class="Symbol">:</a> <a id="3373" href="Effect.Applicative.html#857" class="Generalizable">A</a><a id="3374" class="Symbol">)</a> <a id="3376" class="Symbol">→</a> <a id="3378" href="Effect.Functor.html#1149" class="Function">op</a> <a id="3381" class="Symbol">(</a><a id="3382" href="Effect.Applicative.html#1152" class="Function">A₁.pure</a> <a id="3390" href="Effect.Applicative.html#3369" class="Bound">x</a><a id="3391" class="Symbol">)</a> <a id="3393" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">≡</a> <a id="3395" href="Effect.Applicative.html#1152" class="Function">A₂.pure</a> <a id="3403" href="Effect.Applicative.html#3369" class="Bound">x</a>
|
|||
|
<a id="Morphism.op-<*>"></a><a id="3409" href="Effect.Applicative.html#3409" class="Field">op-<*></a> <a id="3417" class="Symbol">:</a> <a id="3419" class="Symbol">(</a><a id="3420" href="Effect.Applicative.html#3420" class="Bound">f</a> <a id="3422" class="Symbol">:</a> <a id="3424" href="Effect.Applicative.html#3037" class="Bound">F₁</a> <a id="3427" class="Symbol">(</a><a id="3428" href="Effect.Applicative.html#857" class="Generalizable">A</a> <a id="3430" class="Symbol">→</a> <a id="3432" href="Effect.Applicative.html#859" class="Generalizable">B</a><a id="3433" class="Symbol">))</a> <a id="3436" class="Symbol">(</a><a id="3437" href="Effect.Applicative.html#3437" class="Bound">x</a> <a id="3439" class="Symbol">:</a> <a id="3441" href="Effect.Applicative.html#3037" class="Bound">F₁</a> <a id="3444" href="Effect.Applicative.html#857" class="Generalizable">A</a><a id="3445" class="Symbol">)</a> <a id="3447" class="Symbol">→</a>
|
|||
|
<a id="3463" href="Effect.Functor.html#1149" class="Function">op</a> <a id="3466" class="Symbol">(</a><a id="3467" href="Effect.Applicative.html#3420" class="Bound">f</a> <a id="3469" href="Effect.Applicative.html#1610" class="Function Operator">A₁.⊛</a> <a id="3474" href="Effect.Applicative.html#3437" class="Bound">x</a><a id="3475" class="Symbol">)</a> <a id="3477" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">≡</a> <a id="3479" class="Symbol">(</a><a id="3480" href="Effect.Functor.html#1149" class="Function">op</a> <a id="3483" href="Effect.Applicative.html#3420" class="Bound">f</a> <a id="3485" href="Effect.Applicative.html#1610" class="Function Operator">A₂.⊛</a> <a id="3490" href="Effect.Functor.html#1149" class="Function">op</a> <a id="3493" href="Effect.Applicative.html#3437" class="Bound">x</a><a id="3494" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="3499" class="Comment">-- backwards compatibility: unicode variants</a>
|
|||
|
<a id="Morphism.op-⊛"></a><a id="3546" href="Effect.Applicative.html#3546" class="Function">op-⊛</a> <a id="3551" class="Symbol">=</a> <a id="3553" href="Effect.Applicative.html#3409" class="Field">op-<*></a>
|
|||
|
</pre></body></html>
|