mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
88 lines
31 KiB
HTML
88 lines
31 KiB
HTML
|
<!DOCTYPE HTML>
|
|||
|
<html><head><meta charset="utf-8"><title>Data.Sum.Base</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">-- Sums (disjoint unions)</a>
|
|||
|
<a id="132" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
|
|||
|
<a id="206" class="Symbol">{-#</a> <a id="210" class="Keyword">OPTIONS</a> <a id="218" class="Pragma">--cubical-compatible</a> <a id="239" class="Pragma">--safe</a> <a id="246" class="Symbol">#-}</a>
|
|||
|
|
|||
|
<a id="251" class="Keyword">module</a> <a id="258" href="Data.Sum.Base.html" class="Module">Data.Sum.Base</a> <a id="272" class="Keyword">where</a>
|
|||
|
|
|||
|
<a id="279" class="Keyword">open</a> <a id="284" class="Keyword">import</a> <a id="291" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a> <a id="306" class="Keyword">using</a> <a id="312" class="Symbol">(</a><a id="313" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a><a id="317" class="Symbol">;</a> <a id="319" href="Agda.Builtin.Bool.html#175" class="InductiveConstructor">false</a><a id="324" class="Symbol">)</a>
|
|||
|
<a id="326" class="Keyword">open</a> <a id="331" class="Keyword">import</a> <a id="338" href="Function.Base.html" class="Module">Function.Base</a> <a id="352" class="Keyword">using</a> <a id="358" class="Symbol">(</a><a id="359" href="Function.Base.html#1040" class="Function Operator">_∘_</a><a id="362" class="Symbol">;</a> <a id="364" href="Function.Base.html#3715" class="Function Operator">_∘′_</a><a id="368" class="Symbol">;</a> <a id="370" href="Function.Base.html#5124" class="Function Operator">_-⟪_⟫-_</a> <a id="378" class="Symbol">;</a> <a id="380" href="Function.Base.html#624" class="Function">id</a><a id="382" class="Symbol">)</a>
|
|||
|
<a id="384" class="Keyword">open</a> <a id="389" class="Keyword">import</a> <a id="396" href="Relation.Nullary.Reflects.html" class="Module">Relation.Nullary.Reflects</a> <a id="422" class="Keyword">using</a> <a id="428" class="Symbol">(</a><a id="429" href="Relation.Nullary.Reflects.html#1040" class="Function">invert</a><a id="435" class="Symbol">)</a>
|
|||
|
<a id="437" class="Keyword">open</a> <a id="442" class="Keyword">import</a> <a id="449" href="Relation.Nullary.html" class="Module">Relation.Nullary</a> <a id="466" class="Keyword">using</a> <a id="472" class="Symbol">(</a><a id="473" href="Relation.Nullary.html#1520" class="Record">Dec</a><a id="476" class="Symbol">;</a> <a id="478" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a><a id="481" class="Symbol">;</a> <a id="483" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a><a id="485" class="Symbol">;</a> <a id="487" href="Relation.Nullary.html#1568" class="InductiveConstructor Operator">_because_</a><a id="496" class="Symbol">;</a> <a id="498" href="Relation.Nullary.html#665" class="Function Operator">¬_</a><a id="500" class="Symbol">)</a>
|
|||
|
<a id="502" class="Keyword">open</a> <a id="507" class="Keyword">import</a> <a id="514" href="Level.html" class="Module">Level</a> <a id="520" class="Keyword">using</a> <a id="526" class="Symbol">(</a><a id="527" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="532" class="Symbol">;</a> <a id="534" href="Agda.Primitive.html#804" class="Primitive Operator">_⊔_</a><a id="537" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="540" class="Keyword">private</a>
|
|||
|
<a id="550" class="Keyword">variable</a>
|
|||
|
<a id="563" href="Data.Sum.Base.html#563" class="Generalizable">a</a> <a id="565" href="Data.Sum.Base.html#565" class="Generalizable">b</a> <a id="567" href="Data.Sum.Base.html#567" class="Generalizable">c</a> <a id="569" href="Data.Sum.Base.html#569" class="Generalizable">d</a> <a id="571" class="Symbol">:</a> <a id="573" href="Agda.Primitive.html#591" class="Postulate">Level</a>
|
|||
|
<a id="583" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="585" class="Symbol">:</a> <a id="587" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="591" href="Data.Sum.Base.html#563" class="Generalizable">a</a>
|
|||
|
<a id="597" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="599" class="Symbol">:</a> <a id="601" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="605" href="Data.Sum.Base.html#565" class="Generalizable">b</a>
|
|||
|
<a id="611" href="Data.Sum.Base.html#611" class="Generalizable">C</a> <a id="613" class="Symbol">:</a> <a id="615" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="619" href="Data.Sum.Base.html#567" class="Generalizable">c</a>
|
|||
|
<a id="625" href="Data.Sum.Base.html#625" class="Generalizable">D</a> <a id="627" class="Symbol">:</a> <a id="629" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="633" href="Data.Sum.Base.html#569" class="Generalizable">d</a>
|
|||
|
|
|||
|
<a id="636" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="709" class="Comment">-- Definition</a>
|
|||
|
|
|||
|
<a id="724" class="Keyword">infixr</a> <a id="731" class="Number">1</a> <a id="733" href="Data.Sum.Base.html#743" class="Datatype Operator">_⊎_</a>
|
|||
|
|
|||
|
<a id="738" class="Keyword">data</a> <a id="_⊎_"></a><a id="743" href="Data.Sum.Base.html#743" class="Datatype Operator">_⊎_</a> <a id="747" class="Symbol">(</a><a id="748" href="Data.Sum.Base.html#748" class="Bound">A</a> <a id="750" class="Symbol">:</a> <a id="752" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="756" href="Data.Sum.Base.html#563" class="Generalizable">a</a><a id="757" class="Symbol">)</a> <a id="759" class="Symbol">(</a><a id="760" href="Data.Sum.Base.html#760" class="Bound">B</a> <a id="762" class="Symbol">:</a> <a id="764" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="768" href="Data.Sum.Base.html#565" class="Generalizable">b</a><a id="769" class="Symbol">)</a> <a id="771" class="Symbol">:</a> <a id="773" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="777" class="Symbol">(</a><a id="778" href="Data.Sum.Base.html#756" class="Bound">a</a> <a id="780" href="Agda.Primitive.html#804" class="Primitive Operator">⊔</a> <a id="782" href="Data.Sum.Base.html#768" class="Bound">b</a><a id="783" class="Symbol">)</a> <a id="785" class="Keyword">where</a>
|
|||
|
<a id="_⊎_.inj₁"></a><a id="793" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="798" class="Symbol">:</a> <a id="800" class="Symbol">(</a><a id="801" href="Data.Sum.Base.html#801" class="Bound">x</a> <a id="803" class="Symbol">:</a> <a id="805" href="Data.Sum.Base.html#748" class="Bound">A</a><a id="806" class="Symbol">)</a> <a id="808" class="Symbol">→</a> <a id="810" href="Data.Sum.Base.html#748" class="Bound">A</a> <a id="812" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="814" href="Data.Sum.Base.html#760" class="Bound">B</a>
|
|||
|
<a id="_⊎_.inj₂"></a><a id="818" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="823" class="Symbol">:</a> <a id="825" class="Symbol">(</a><a id="826" href="Data.Sum.Base.html#826" class="Bound">y</a> <a id="828" class="Symbol">:</a> <a id="830" href="Data.Sum.Base.html#760" class="Bound">B</a><a id="831" class="Symbol">)</a> <a id="833" class="Symbol">→</a> <a id="835" href="Data.Sum.Base.html#748" class="Bound">A</a> <a id="837" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="839" href="Data.Sum.Base.html#760" class="Bound">B</a>
|
|||
|
|
|||
|
<a id="842" class="Comment">------------------------------------------------------------------------</a>
|
|||
|
<a id="915" class="Comment">-- Functions</a>
|
|||
|
|
|||
|
<a id="[_,_]"></a><a id="929" href="Data.Sum.Base.html#929" class="Function Operator">[_,_]</a> <a id="935" class="Symbol">:</a> <a id="937" class="Symbol">∀</a> <a id="939" class="Symbol">{</a><a id="940" href="Data.Sum.Base.html#940" class="Bound">C</a> <a id="942" class="Symbol">:</a> <a id="944" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="946" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="948" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="950" class="Symbol">→</a> <a id="952" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="956" href="Data.Sum.Base.html#567" class="Generalizable">c</a><a id="957" class="Symbol">}</a> <a id="959" class="Symbol">→</a>
|
|||
|
<a id="969" class="Symbol">((</a><a id="971" href="Data.Sum.Base.html#971" class="Bound">x</a> <a id="973" class="Symbol">:</a> <a id="975" href="Data.Sum.Base.html#583" class="Generalizable">A</a><a id="976" class="Symbol">)</a> <a id="978" class="Symbol">→</a> <a id="980" href="Data.Sum.Base.html#940" class="Bound">C</a> <a id="982" class="Symbol">(</a><a id="983" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="988" href="Data.Sum.Base.html#971" class="Bound">x</a><a id="989" class="Symbol">))</a> <a id="992" class="Symbol">→</a> <a id="994" class="Symbol">((</a><a id="996" href="Data.Sum.Base.html#996" class="Bound">x</a> <a id="998" class="Symbol">:</a> <a id="1000" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1001" class="Symbol">)</a> <a id="1003" class="Symbol">→</a> <a id="1005" href="Data.Sum.Base.html#940" class="Bound">C</a> <a id="1007" class="Symbol">(</a><a id="1008" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1013" href="Data.Sum.Base.html#996" class="Bound">x</a><a id="1014" class="Symbol">))</a> <a id="1017" class="Symbol">→</a>
|
|||
|
<a id="1027" class="Symbol">((</a><a id="1029" href="Data.Sum.Base.html#1029" class="Bound">x</a> <a id="1031" class="Symbol">:</a> <a id="1033" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1035" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1037" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1038" class="Symbol">)</a> <a id="1040" class="Symbol">→</a> <a id="1042" href="Data.Sum.Base.html#940" class="Bound">C</a> <a id="1044" href="Data.Sum.Base.html#1029" class="Bound">x</a><a id="1045" class="Symbol">)</a>
|
|||
|
<a id="1047" href="Data.Sum.Base.html#929" class="Function Operator">[</a> <a id="1049" href="Data.Sum.Base.html#1049" class="Bound">f</a> <a id="1051" href="Data.Sum.Base.html#929" class="Function Operator">,</a> <a id="1053" href="Data.Sum.Base.html#1053" class="Bound">g</a> <a id="1055" href="Data.Sum.Base.html#929" class="Function Operator">]</a> <a id="1057" class="Symbol">(</a><a id="1058" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1063" href="Data.Sum.Base.html#1063" class="Bound">x</a><a id="1064" class="Symbol">)</a> <a id="1066" class="Symbol">=</a> <a id="1068" href="Data.Sum.Base.html#1049" class="Bound">f</a> <a id="1070" href="Data.Sum.Base.html#1063" class="Bound">x</a>
|
|||
|
<a id="1072" href="Data.Sum.Base.html#929" class="Function Operator">[</a> <a id="1074" href="Data.Sum.Base.html#1074" class="Bound">f</a> <a id="1076" href="Data.Sum.Base.html#929" class="Function Operator">,</a> <a id="1078" href="Data.Sum.Base.html#1078" class="Bound">g</a> <a id="1080" href="Data.Sum.Base.html#929" class="Function Operator">]</a> <a id="1082" class="Symbol">(</a><a id="1083" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1088" href="Data.Sum.Base.html#1088" class="Bound">y</a><a id="1089" class="Symbol">)</a> <a id="1091" class="Symbol">=</a> <a id="1093" href="Data.Sum.Base.html#1078" class="Bound">g</a> <a id="1095" href="Data.Sum.Base.html#1088" class="Bound">y</a>
|
|||
|
|
|||
|
<a id="[_,_]′"></a><a id="1098" href="Data.Sum.Base.html#1098" class="Function Operator">[_,_]′</a> <a id="1105" class="Symbol">:</a> <a id="1107" class="Symbol">(</a><a id="1108" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1110" class="Symbol">→</a> <a id="1112" href="Data.Sum.Base.html#611" class="Generalizable">C</a><a id="1113" class="Symbol">)</a> <a id="1115" class="Symbol">→</a> <a id="1117" class="Symbol">(</a><a id="1118" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1120" class="Symbol">→</a> <a id="1122" href="Data.Sum.Base.html#611" class="Generalizable">C</a><a id="1123" class="Symbol">)</a> <a id="1125" class="Symbol">→</a> <a id="1127" class="Symbol">(</a><a id="1128" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1130" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1132" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1134" class="Symbol">→</a> <a id="1136" href="Data.Sum.Base.html#611" class="Generalizable">C</a><a id="1137" class="Symbol">)</a>
|
|||
|
<a id="1139" href="Data.Sum.Base.html#1098" class="Function Operator">[_,_]′</a> <a id="1146" class="Symbol">=</a> <a id="1148" href="Data.Sum.Base.html#929" class="Function Operator">[_,_]</a>
|
|||
|
|
|||
|
<a id="fromInj₁"></a><a id="1155" href="Data.Sum.Base.html#1155" class="Function">fromInj₁</a> <a id="1164" class="Symbol">:</a> <a id="1166" class="Symbol">(</a><a id="1167" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1169" class="Symbol">→</a> <a id="1171" href="Data.Sum.Base.html#583" class="Generalizable">A</a><a id="1172" class="Symbol">)</a> <a id="1174" class="Symbol">→</a> <a id="1176" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1178" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1180" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1182" class="Symbol">→</a> <a id="1184" href="Data.Sum.Base.html#583" class="Generalizable">A</a>
|
|||
|
<a id="1186" href="Data.Sum.Base.html#1155" class="Function">fromInj₁</a> <a id="1195" class="Symbol">=</a> <a id="1197" href="Data.Sum.Base.html#1098" class="Function Operator">[</a> <a id="1199" href="Function.Base.html#624" class="Function">id</a> <a id="1202" href="Data.Sum.Base.html#1098" class="Function Operator">,_]′</a>
|
|||
|
|
|||
|
<a id="fromInj₂"></a><a id="1208" href="Data.Sum.Base.html#1208" class="Function">fromInj₂</a> <a id="1217" class="Symbol">:</a> <a id="1219" class="Symbol">(</a><a id="1220" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1222" class="Symbol">→</a> <a id="1224" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1225" class="Symbol">)</a> <a id="1227" class="Symbol">→</a> <a id="1229" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1231" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1233" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1235" class="Symbol">→</a> <a id="1237" href="Data.Sum.Base.html#597" class="Generalizable">B</a>
|
|||
|
<a id="1239" href="Data.Sum.Base.html#1208" class="Function">fromInj₂</a> <a id="1248" class="Symbol">=</a> <a id="1250" href="Data.Sum.Base.html#1098" class="Function Operator">[_,</a> <a id="1254" href="Function.Base.html#624" class="Function">id</a> <a id="1257" href="Data.Sum.Base.html#1098" class="Function Operator">]′</a>
|
|||
|
|
|||
|
<a id="reduce"></a><a id="1261" href="Data.Sum.Base.html#1261" class="Function">reduce</a> <a id="1268" class="Symbol">:</a> <a id="1270" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1272" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1274" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1276" class="Symbol">→</a> <a id="1278" href="Data.Sum.Base.html#583" class="Generalizable">A</a>
|
|||
|
<a id="1280" href="Data.Sum.Base.html#1261" class="Function">reduce</a> <a id="1287" class="Symbol">=</a> <a id="1289" href="Data.Sum.Base.html#1098" class="Function Operator">[</a> <a id="1291" href="Function.Base.html#624" class="Function">id</a> <a id="1294" href="Data.Sum.Base.html#1098" class="Function Operator">,</a> <a id="1296" href="Function.Base.html#624" class="Function">id</a> <a id="1299" href="Data.Sum.Base.html#1098" class="Function Operator">]′</a>
|
|||
|
|
|||
|
<a id="swap"></a><a id="1303" href="Data.Sum.Base.html#1303" class="Function">swap</a> <a id="1308" class="Symbol">:</a> <a id="1310" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1312" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1314" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1316" class="Symbol">→</a> <a id="1318" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1320" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1322" href="Data.Sum.Base.html#583" class="Generalizable">A</a>
|
|||
|
<a id="1324" href="Data.Sum.Base.html#1303" class="Function">swap</a> <a id="1329" class="Symbol">(</a><a id="1330" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1335" href="Data.Sum.Base.html#1335" class="Bound">x</a><a id="1336" class="Symbol">)</a> <a id="1338" class="Symbol">=</a> <a id="1340" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1345" href="Data.Sum.Base.html#1335" class="Bound">x</a>
|
|||
|
<a id="1347" href="Data.Sum.Base.html#1303" class="Function">swap</a> <a id="1352" class="Symbol">(</a><a id="1353" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1358" href="Data.Sum.Base.html#1358" class="Bound">x</a><a id="1359" class="Symbol">)</a> <a id="1361" class="Symbol">=</a> <a id="1363" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1368" href="Data.Sum.Base.html#1358" class="Bound">x</a>
|
|||
|
|
|||
|
<a id="map"></a><a id="1371" href="Data.Sum.Base.html#1371" class="Function">map</a> <a id="1375" class="Symbol">:</a> <a id="1377" class="Symbol">(</a><a id="1378" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1380" class="Symbol">→</a> <a id="1382" href="Data.Sum.Base.html#611" class="Generalizable">C</a><a id="1383" class="Symbol">)</a> <a id="1385" class="Symbol">→</a> <a id="1387" class="Symbol">(</a><a id="1388" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1390" class="Symbol">→</a> <a id="1392" href="Data.Sum.Base.html#625" class="Generalizable">D</a><a id="1393" class="Symbol">)</a> <a id="1395" class="Symbol">→</a> <a id="1397" class="Symbol">(</a><a id="1398" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1400" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1402" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1404" class="Symbol">→</a> <a id="1406" href="Data.Sum.Base.html#611" class="Generalizable">C</a> <a id="1408" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1410" href="Data.Sum.Base.html#625" class="Generalizable">D</a><a id="1411" class="Symbol">)</a>
|
|||
|
<a id="1413" href="Data.Sum.Base.html#1371" class="Function">map</a> <a id="1417" href="Data.Sum.Base.html#1417" class="Bound">f</a> <a id="1419" href="Data.Sum.Base.html#1419" class="Bound">g</a> <a id="1421" class="Symbol">=</a> <a id="1423" href="Data.Sum.Base.html#1098" class="Function Operator">[</a> <a id="1425" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1430" href="Function.Base.html#1040" class="Function Operator">∘</a> <a id="1432" href="Data.Sum.Base.html#1417" class="Bound">f</a> <a id="1434" href="Data.Sum.Base.html#1098" class="Function Operator">,</a> <a id="1436" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1441" href="Function.Base.html#1040" class="Function Operator">∘</a> <a id="1443" href="Data.Sum.Base.html#1419" class="Bound">g</a> <a id="1445" href="Data.Sum.Base.html#1098" class="Function Operator">]′</a>
|
|||
|
|
|||
|
<a id="map₁"></a><a id="1449" href="Data.Sum.Base.html#1449" class="Function">map₁</a> <a id="1454" class="Symbol">:</a> <a id="1456" class="Symbol">(</a><a id="1457" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1459" class="Symbol">→</a> <a id="1461" href="Data.Sum.Base.html#611" class="Generalizable">C</a><a id="1462" class="Symbol">)</a> <a id="1464" class="Symbol">→</a> <a id="1466" class="Symbol">(</a><a id="1467" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1469" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1471" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1473" class="Symbol">→</a> <a id="1475" href="Data.Sum.Base.html#611" class="Generalizable">C</a> <a id="1477" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1479" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1480" class="Symbol">)</a>
|
|||
|
<a id="1482" href="Data.Sum.Base.html#1449" class="Function">map₁</a> <a id="1487" href="Data.Sum.Base.html#1487" class="Bound">f</a> <a id="1489" class="Symbol">=</a> <a id="1491" href="Data.Sum.Base.html#1371" class="Function">map</a> <a id="1495" href="Data.Sum.Base.html#1487" class="Bound">f</a> <a id="1497" href="Function.Base.html#624" class="Function">id</a>
|
|||
|
|
|||
|
<a id="map₂"></a><a id="1501" href="Data.Sum.Base.html#1501" class="Function">map₂</a> <a id="1506" class="Symbol">:</a> <a id="1508" class="Symbol">(</a><a id="1509" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1511" class="Symbol">→</a> <a id="1513" href="Data.Sum.Base.html#625" class="Generalizable">D</a><a id="1514" class="Symbol">)</a> <a id="1516" class="Symbol">→</a> <a id="1518" class="Symbol">(</a><a id="1519" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1521" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1523" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1525" class="Symbol">→</a> <a id="1527" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1529" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1531" href="Data.Sum.Base.html#625" class="Generalizable">D</a><a id="1532" class="Symbol">)</a>
|
|||
|
<a id="1534" href="Data.Sum.Base.html#1501" class="Function">map₂</a> <a id="1539" class="Symbol">=</a> <a id="1541" href="Data.Sum.Base.html#1371" class="Function">map</a> <a id="1545" href="Function.Base.html#624" class="Function">id</a>
|
|||
|
|
|||
|
<a id="assocʳ"></a><a id="1549" href="Data.Sum.Base.html#1549" class="Function">assocʳ</a> <a id="1556" class="Symbol">:</a> <a id="1558" class="Symbol">(</a><a id="1559" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1561" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1563" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1564" class="Symbol">)</a> <a id="1566" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1568" href="Data.Sum.Base.html#611" class="Generalizable">C</a> <a id="1570" class="Symbol">→</a> <a id="1572" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1574" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1576" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1578" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1580" href="Data.Sum.Base.html#611" class="Generalizable">C</a>
|
|||
|
<a id="1582" href="Data.Sum.Base.html#1549" class="Function">assocʳ</a> <a id="1589" class="Symbol">=</a> <a id="1591" href="Data.Sum.Base.html#1098" class="Function Operator">[</a> <a id="1593" href="Data.Sum.Base.html#1501" class="Function">map₂</a> <a id="1598" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1603" href="Data.Sum.Base.html#1098" class="Function Operator">,</a> <a id="1605" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1610" href="Function.Base.html#3715" class="Function Operator">∘′</a> <a id="1613" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1618" href="Data.Sum.Base.html#1098" class="Function Operator">]′</a>
|
|||
|
|
|||
|
<a id="assocˡ"></a><a id="1622" href="Data.Sum.Base.html#1622" class="Function">assocˡ</a> <a id="1629" class="Symbol">:</a> <a id="1631" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1633" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1635" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1637" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1639" href="Data.Sum.Base.html#611" class="Generalizable">C</a> <a id="1641" class="Symbol">→</a> <a id="1643" class="Symbol">(</a><a id="1644" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1646" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1648" href="Data.Sum.Base.html#597" class="Generalizable">B</a><a id="1649" class="Symbol">)</a> <a id="1651" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1653" href="Data.Sum.Base.html#611" class="Generalizable">C</a>
|
|||
|
<a id="1655" href="Data.Sum.Base.html#1622" class="Function">assocˡ</a> <a id="1662" class="Symbol">=</a> <a id="1664" href="Data.Sum.Base.html#1098" class="Function Operator">[</a> <a id="1666" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1671" href="Function.Base.html#3715" class="Function Operator">∘′</a> <a id="1674" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1679" href="Data.Sum.Base.html#1098" class="Function Operator">,</a> <a id="1681" href="Data.Sum.Base.html#1449" class="Function">map₁</a> <a id="1686" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1691" href="Data.Sum.Base.html#1098" class="Function Operator">]′</a>
|
|||
|
|
|||
|
<a id="1695" class="Keyword">infixr</a> <a id="1702" class="Number">1</a> <a id="1704" href="Data.Sum.Base.html#1710" class="Function Operator">_-⊎-_</a>
|
|||
|
<a id="_-⊎-_"></a><a id="1710" href="Data.Sum.Base.html#1710" class="Function Operator">_-⊎-_</a> <a id="1716" class="Symbol">:</a> <a id="1718" class="Symbol">(</a><a id="1719" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1721" class="Symbol">→</a> <a id="1723" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1725" class="Symbol">→</a> <a id="1727" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1731" href="Data.Sum.Base.html#567" class="Generalizable">c</a><a id="1732" class="Symbol">)</a> <a id="1734" class="Symbol">→</a> <a id="1736" class="Symbol">(</a><a id="1737" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1739" class="Symbol">→</a> <a id="1741" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1743" class="Symbol">→</a> <a id="1745" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1749" href="Data.Sum.Base.html#569" class="Generalizable">d</a><a id="1750" class="Symbol">)</a> <a id="1752" class="Symbol">→</a> <a id="1754" class="Symbol">(</a><a id="1755" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1757" class="Symbol">→</a> <a id="1759" href="Data.Sum.Base.html#597" class="Generalizable">B</a> <a id="1761" class="Symbol">→</a> <a id="1763" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1767" class="Symbol">(</a><a id="1768" href="Data.Sum.Base.html#567" class="Generalizable">c</a> <a id="1770" href="Agda.Primitive.html#804" class="Primitive Operator">⊔</a> <a id="1772" href="Data.Sum.Base.html#569" class="Generalizable">d</a><a id="1773" class="Symbol">))</a>
|
|||
|
<a id="1776" href="Data.Sum.Base.html#1776" class="Bound">f</a> <a id="1778" href="Data.Sum.Base.html#1710" class="Function Operator">-⊎-</a> <a id="1782" href="Data.Sum.Base.html#1782" class="Bound">g</a> <a id="1784" class="Symbol">=</a> <a id="1786" href="Data.Sum.Base.html#1776" class="Bound">f</a> <a id="1788" href="Function.Base.html#5124" class="Function Operator">-⟪</a> <a id="1791" href="Data.Sum.Base.html#743" class="Datatype Operator">_⊎_</a> <a id="1795" href="Function.Base.html#5124" class="Function Operator">⟫-</a> <a id="1798" href="Data.Sum.Base.html#1782" class="Bound">g</a>
|
|||
|
|
|||
|
<a id="1801" class="Comment">-- Conversion back and forth with Dec</a>
|
|||
|
|
|||
|
<a id="fromDec"></a><a id="1840" href="Data.Sum.Base.html#1840" class="Function">fromDec</a> <a id="1848" class="Symbol">:</a> <a id="1850" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1854" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1856" class="Symbol">→</a> <a id="1858" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1860" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1862" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1864" href="Data.Sum.Base.html#583" class="Generalizable">A</a>
|
|||
|
<a id="1866" href="Data.Sum.Base.html#1840" class="Function">fromDec</a> <a id="1874" class="Symbol">(</a> <a id="1876" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a> <a id="1881" href="Relation.Nullary.html#1568" class="InductiveConstructor Operator">because</a> <a id="1890" href="Data.Sum.Base.html#1890" class="Bound">[p]</a><a id="1893" class="Symbol">)</a> <a id="1895" class="Symbol">=</a> <a id="1897" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="1902" class="Symbol">(</a><a id="1903" href="Relation.Nullary.Reflects.html#1040" class="Function">invert</a> <a id="1911" href="Data.Sum.Base.html#1890" class="Bound">[p]</a><a id="1914" class="Symbol">)</a>
|
|||
|
<a id="1916" href="Data.Sum.Base.html#1840" class="Function">fromDec</a> <a id="1924" class="Symbol">(</a><a id="1925" href="Agda.Builtin.Bool.html#175" class="InductiveConstructor">false</a> <a id="1931" href="Relation.Nullary.html#1568" class="InductiveConstructor Operator">because</a> <a id="1939" href="Data.Sum.Base.html#1939" class="Bound">[¬p]</a><a id="1943" class="Symbol">)</a> <a id="1945" class="Symbol">=</a> <a id="1947" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="1952" class="Symbol">(</a><a id="1953" href="Relation.Nullary.Reflects.html#1040" class="Function">invert</a> <a id="1960" href="Data.Sum.Base.html#1939" class="Bound">[¬p]</a><a id="1964" class="Symbol">)</a>
|
|||
|
|
|||
|
<a id="toDec"></a><a id="1967" href="Data.Sum.Base.html#1967" class="Function">toDec</a> <a id="1973" class="Symbol">:</a> <a id="1975" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1977" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="1979" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1981" href="Data.Sum.Base.html#583" class="Generalizable">A</a> <a id="1983" class="Symbol">→</a> <a id="1985" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1989" href="Data.Sum.Base.html#583" class="Generalizable">A</a>
|
|||
|
<a id="1991" href="Data.Sum.Base.html#1967" class="Function">toDec</a> <a id="1997" class="Symbol">(</a><a id="1998" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="2003" href="Data.Sum.Base.html#2003" class="Bound">p</a><a id="2004" class="Symbol">)</a> <a id="2007" class="Symbol">=</a> <a id="2009" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a> <a id="2013" href="Data.Sum.Base.html#2003" class="Bound">p</a>
|
|||
|
<a id="2015" href="Data.Sum.Base.html#1967" class="Function">toDec</a> <a id="2021" class="Symbol">(</a><a id="2022" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="2027" href="Data.Sum.Base.html#2027" class="Bound">¬p</a><a id="2029" class="Symbol">)</a> <a id="2031" class="Symbol">=</a> <a id="2033" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a> <a id="2036" href="Data.Sum.Base.html#2027" class="Bound">¬p</a>
|
|||
|
</pre></body></html>
|