Continuation of Encoding Overlapping, Extensible Isomorphisms: encoding "open kinds" to better express some awkward type classes.
Last active
January 26, 2020 20:53
-
-
Save Icelandjack/865476f2299a4916d4e237d0f8ed0119 to your computer and use it in GitHub Desktop.
Rethinking Tricky Classes: Explicit Witnesses of Monoid Actions, Semigroup / Monoid / Applicative homomorphisms
Author
Author
N
e
x
t
up
...
Author
Adjunctions?
Really witnessed by a natural isomorphism (Iso1).
Author
Functors?
Once we go Category polymorphic we start running into similar issues: See reddit thread.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We can also define a
Semigroupaction, and make it a super class ofMonoidactions:Lifting a
Semigroupaction to aMonoidactionIf we wanted to lift a
SemigroupActionto aMonoidActionin the style of semigroups-actions we would need to define anewtype OptionSet s a = OptionSet aand the final type would look like:Using the approach under study the type becomes the more palatable
Option s -> (a -> a):Generalize Cayley to
SemigroupDifferentiating between
SemigroupActionandMonoidActionallows us to use the more general(<>)in the definitionWith semigroups-actions
actwould get the unnecessarily wrapped typeSelfAct s -> (SelfAct s -> SelfAct s).Repeating n-times
Acting on
EnumFrom
Data.Semigroup.Act.Enum. Semigroup action of an integer acting on anEnum.