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

51 lines
No EOL
13 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.Functor</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">-- Functors</a>
<a id="118" class="Comment">------------------------------------------------------------------------</a>
<a id="192" class="Comment">-- Note that currently the functor laws are not included here.</a>
<a id="256" class="Symbol">{-#</a> <a id="260" class="Keyword">OPTIONS</a> <a id="268" class="Pragma">--cubical-compatible</a> <a id="289" class="Pragma">--safe</a> <a id="296" class="Symbol">#-}</a>
<a id="301" class="Keyword">module</a> <a id="308" href="Effect.Functor.html" class="Module">Effect.Functor</a> <a id="323" class="Keyword">where</a>
<a id="330" class="Keyword">open</a> <a id="335" class="Keyword">import</a> <a id="342" href="Data.Unit.Polymorphic.Base.html" class="Module">Data.Unit.Polymorphic.Base</a> <a id="369" class="Keyword">using</a> <a id="375" class="Symbol">(</a><a id="376" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a><a id="377" class="Symbol">)</a>
<a id="379" class="Keyword">open</a> <a id="384" class="Keyword">import</a> <a id="391" href="Function.Base.html" class="Module">Function.Base</a> <a id="405" class="Keyword">using</a> <a id="411" class="Symbol">(</a><a id="412" href="Function.Base.html#725" class="Function">const</a><a id="417" class="Symbol">;</a> <a id="419" href="Function.Base.html#1638" class="Function">flip</a><a id="423" class="Symbol">)</a>
<a id="425" class="Keyword">open</a> <a id="430" class="Keyword">import</a> <a id="437" href="Level.html" class="Module">Level</a>
<a id="444" class="Keyword">open</a> <a id="449" class="Keyword">import</a> <a id="456" href="Relation.Binary.PropositionalEquality.Core.html" class="Module">Relation.Binary.PropositionalEquality.Core</a> <a id="499" class="Keyword">using</a> <a id="505" class="Symbol">(</a><a id="506" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">_≡_</a><a id="509" class="Symbol">)</a>
<a id="512" class="Keyword">private</a>
<a id="522" class="Keyword">variable</a>
<a id="535" href="Effect.Functor.html#535" class="Generalizable"></a> <a id="537" href="Effect.Functor.html#537" class="Generalizable"></a> <a id="540" href="Effect.Functor.html#540" class="Generalizable">ℓ″</a> <a id="543" class="Symbol">:</a> <a id="545" href="Agda.Primitive.html#742" class="Postulate">Level</a>
<a id="555" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="557" href="Effect.Functor.html#557" class="Generalizable">B</a> <a id="559" href="Effect.Functor.html#559" class="Generalizable">X</a> <a id="561" href="Effect.Functor.html#561" class="Generalizable">Y</a> <a id="563" class="Symbol">:</a> <a id="565" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="569" href="Effect.Functor.html#535" class="Generalizable"></a>
<a id="572" class="Keyword">record</a> <a id="RawFunctor"></a><a id="579" href="Effect.Functor.html#579" class="Record">RawFunctor</a> <a id="590" class="Symbol">(</a><a id="591" href="Effect.Functor.html#591" class="Bound">F</a> <a id="593" class="Symbol">:</a> <a id="595" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="599" href="Effect.Functor.html#535" class="Generalizable"></a> <a id="601" class="Symbol"></a> <a id="603" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="607" href="Effect.Functor.html#537" class="Generalizable"></a><a id="609" class="Symbol">)</a> <a id="611" class="Symbol">:</a> <a id="613" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="617" class="Symbol">(</a><a id="618" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="622" href="Effect.Functor.html#599" class="Bound"></a> <a id="624" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="626" href="Effect.Functor.html#607" class="Bound"></a><a id="628" class="Symbol">)</a> <a id="630" class="Keyword">where</a>
<a id="638" class="Keyword">infixl</a> <a id="645" class="Number">4</a> <a id="647" href="Effect.Functor.html#687" class="Field Operator">_&lt;$&gt;_</a> <a id="653" href="Effect.Functor.html#718" class="Function Operator">_&lt;$_</a>
<a id="660" class="Keyword">infixl</a> <a id="667" class="Number">1</a> <a id="669" href="Effect.Functor.html#767" class="Function Operator">_&lt;&amp;&gt;_</a>
<a id="677" class="Keyword">field</a>
<a id="RawFunctor._&lt;$&gt;_"></a><a id="687" href="Effect.Functor.html#687" class="Field Operator">_&lt;$&gt;_</a> <a id="693" class="Symbol">:</a> <a id="695" class="Symbol">(</a><a id="696" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="698" class="Symbol"></a> <a id="700" href="Effect.Functor.html#557" class="Generalizable">B</a><a id="701" class="Symbol">)</a> <a id="703" class="Symbol"></a> <a id="705" href="Effect.Functor.html#591" class="Bound">F</a> <a id="707" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="709" class="Symbol"></a> <a id="711" href="Effect.Functor.html#591" class="Bound">F</a> <a id="713" href="Effect.Functor.html#557" class="Generalizable">B</a>
<a id="RawFunctor._&lt;$_"></a><a id="718" href="Effect.Functor.html#718" class="Function Operator">_&lt;$_</a> <a id="723" class="Symbol">:</a> <a id="725" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="727" class="Symbol"></a> <a id="729" href="Effect.Functor.html#591" class="Bound">F</a> <a id="731" href="Effect.Functor.html#557" class="Generalizable">B</a> <a id="733" class="Symbol"></a> <a id="735" href="Effect.Functor.html#591" class="Bound">F</a> <a id="737" href="Effect.Functor.html#555" class="Generalizable">A</a>
<a id="741" href="Effect.Functor.html#741" class="Bound">x</a> <a id="743" href="Effect.Functor.html#718" class="Function Operator">&lt;$</a> <a id="746" href="Effect.Functor.html#746" class="Bound">y</a> <a id="748" class="Symbol">=</a> <a id="750" href="Function.Base.html#725" class="Function">const</a> <a id="756" href="Effect.Functor.html#741" class="Bound">x</a> <a id="758" href="Effect.Functor.html#687" class="Field Operator">&lt;$&gt;</a> <a id="762" href="Effect.Functor.html#746" class="Bound">y</a>
<a id="RawFunctor._&lt;&amp;&gt;_"></a><a id="767" href="Effect.Functor.html#767" class="Function Operator">_&lt;&amp;&gt;_</a> <a id="773" class="Symbol">:</a> <a id="775" href="Effect.Functor.html#591" class="Bound">F</a> <a id="777" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="779" class="Symbol"></a> <a id="781" class="Symbol">(</a><a id="782" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="784" class="Symbol"></a> <a id="786" href="Effect.Functor.html#557" class="Generalizable">B</a><a id="787" class="Symbol">)</a> <a id="789" class="Symbol"></a> <a id="791" href="Effect.Functor.html#591" class="Bound">F</a> <a id="793" href="Effect.Functor.html#557" class="Generalizable">B</a>
<a id="797" href="Effect.Functor.html#767" class="Function Operator">_&lt;&amp;&gt;_</a> <a id="803" class="Symbol">=</a> <a id="805" href="Function.Base.html#1638" class="Function">flip</a> <a id="810" href="Effect.Functor.html#687" class="Field Operator">_&lt;$&gt;_</a>
<a id="RawFunctor.ignore"></a><a id="819" href="Effect.Functor.html#819" class="Function">ignore</a> <a id="826" class="Symbol">:</a> <a id="828" href="Effect.Functor.html#591" class="Bound">F</a> <a id="830" href="Effect.Functor.html#555" class="Generalizable">A</a> <a id="832" class="Symbol"></a> <a id="834" href="Effect.Functor.html#591" class="Bound">F</a> <a id="836" href="Data.Unit.Polymorphic.Base.html#489" class="Function"></a>
<a id="840" href="Effect.Functor.html#819" class="Function">ignore</a> <a id="847" class="Symbol">=</a> <a id="849" class="Symbol">_</a> <a id="851" href="Effect.Functor.html#718" class="Function Operator">&lt;$_</a>
<a id="856" class="Comment">-- A functor morphism from F₁ to F₂ is an operation op such that</a>
<a id="921" class="Comment">-- op (F₁ f x) ≡ F₂ f (op x)</a>
<a id="951" class="Keyword">record</a> <a id="Morphism"></a><a id="958" href="Effect.Functor.html#958" class="Record">Morphism</a> <a id="967" class="Symbol">{</a><a id="968" href="Effect.Functor.html#968" class="Bound">F₁</a> <a id="971" class="Symbol">:</a> <a id="973" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="977" href="Effect.Functor.html#535" class="Generalizable"></a> <a id="979" class="Symbol"></a> <a id="981" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="985" href="Effect.Functor.html#537" class="Generalizable"></a><a id="987" class="Symbol">}</a> <a id="989" class="Symbol">{</a><a id="990" href="Effect.Functor.html#990" class="Bound">F₂</a> <a id="993" class="Symbol">:</a> <a id="995" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="999" href="Effect.Functor.html#535" class="Generalizable"></a> <a id="1001" class="Symbol"></a> <a id="1003" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1007" href="Effect.Functor.html#540" class="Generalizable">ℓ″</a><a id="1009" class="Symbol">}</a>
<a id="1027" class="Symbol">(</a><a id="1028" href="Effect.Functor.html#1028" class="Bound">fun₁</a> <a id="1033" class="Symbol">:</a> <a id="1035" href="Effect.Functor.html#579" class="Record">RawFunctor</a> <a id="1046" href="Effect.Functor.html#968" class="Bound">F₁</a><a id="1048" class="Symbol">)</a>
<a id="1066" class="Symbol">(</a><a id="1067" href="Effect.Functor.html#1067" class="Bound">fun₂</a> <a id="1072" class="Symbol">:</a> <a id="1074" href="Effect.Functor.html#579" class="Record">RawFunctor</a> <a id="1085" href="Effect.Functor.html#990" class="Bound">F₂</a><a id="1087" class="Symbol">)</a> <a id="1089" class="Symbol">:</a> <a id="1091" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1095" class="Symbol">(</a><a id="1096" href="Agda.Primitive.html#931" class="Primitive">suc</a> <a id="1100" href="Effect.Functor.html#977" class="Bound"></a> <a id="1102" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="1104" href="Effect.Functor.html#985" class="Bound"></a> <a id="1107" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="1109" href="Effect.Functor.html#1007" class="Bound">ℓ″</a><a id="1111" class="Symbol">)</a> <a id="1113" class="Keyword">where</a>
<a id="1121" class="Keyword">open</a> <a id="1126" href="Effect.Functor.html#579" class="Module">RawFunctor</a>
<a id="1139" class="Keyword">field</a>
<a id="Morphism.op"></a><a id="1149" href="Effect.Functor.html#1149" class="Field">op</a> <a id="1156" class="Symbol">:</a> <a id="1158" href="Effect.Functor.html#968" class="Bound">F₁</a> <a id="1161" href="Effect.Functor.html#559" class="Generalizable">X</a> <a id="1163" class="Symbol"></a> <a id="1165" href="Effect.Functor.html#990" class="Bound">F₂</a> <a id="1168" href="Effect.Functor.html#559" class="Generalizable">X</a>
<a id="Morphism.op-&lt;$&gt;"></a><a id="1174" href="Effect.Functor.html#1174" class="Field">op-&lt;$&gt;</a> <a id="1181" class="Symbol">:</a> <a id="1183" class="Symbol">(</a><a id="1184" href="Effect.Functor.html#1184" class="Bound">f</a> <a id="1186" class="Symbol">:</a> <a id="1188" href="Effect.Functor.html#559" class="Generalizable">X</a> <a id="1190" class="Symbol"></a> <a id="1192" href="Effect.Functor.html#561" class="Generalizable">Y</a><a id="1193" class="Symbol">)</a> <a id="1195" class="Symbol">(</a><a id="1196" href="Effect.Functor.html#1196" class="Bound">x</a> <a id="1198" class="Symbol">:</a> <a id="1200" href="Effect.Functor.html#968" class="Bound">F₁</a> <a id="1203" href="Effect.Functor.html#559" class="Generalizable">X</a><a id="1204" class="Symbol">)</a> <a id="1206" class="Symbol"></a>
<a id="1221" href="Effect.Functor.html#1149" class="Field">op</a> <a id="1224" class="Symbol">(</a><a id="1225" href="Effect.Functor.html#1028" class="Bound">fun₁</a> <a id="1230" class="Symbol">.</a><a id="1231" href="Effect.Functor.html#687" class="Field Operator">_&lt;$&gt;_</a> <a id="1237" href="Effect.Functor.html#1184" class="Bound">f</a> <a id="1239" href="Effect.Functor.html#1196" class="Bound">x</a><a id="1240" class="Symbol">)</a> <a id="1242" href="Agda.Builtin.Equality.html#150" class="Datatype Operator"></a> <a id="1244" href="Effect.Functor.html#1067" class="Bound">fun₂</a> <a id="1249" class="Symbol">.</a><a id="1250" href="Effect.Functor.html#687" class="Field Operator">_&lt;$&gt;_</a> <a id="1256" href="Effect.Functor.html#1184" class="Bound">f</a> <a id="1258" class="Symbol">(</a><a id="1259" href="Effect.Functor.html#1149" class="Field">op</a> <a id="1262" href="Effect.Functor.html#1196" class="Bound">x</a><a id="1263" class="Symbol">)</a>
</pre></body></html>