You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
This feature works on top of implicit function types and polymorphic functions. Having given derivations should allow you to write similar code (syntax may vary):
given [F[_], A](given [B] =>> (givenEq[B]) =>Eq[F[B]])):Eq[Free[F, A]]
It's realy useful for generalized recursion as well it makes typeclasses like MonoidK SemigroupK, EqK, OrdK etc. obsolete
Also a whole new space for modularization and library design emerges.
Syntax
In any point where given parameter is suitable it type can be one of the following
// polymorphic function type which result is normal type for Given
[A, B, ...] =>>GivenType[A, B, ...]
// implicit function type which result is normal type for Givengiven(T1, T2) =>GivenType// combination of previous two
[A, B, ...] =>> (givenT1[A, B,...], T2[A, B,...]) =>GivenType[A, B, ...]
This have basically same motivation and use cases as Haskell Extension with the same name
More idiomatic name: Given Derivations
Basic usage
This feature works on top of implicit function types and polymorphic functions. Having given derivations should allow you to write similar code (syntax may vary):
It's realy useful for generalized recursion as well it makes typeclasses like MonoidK SemigroupK, EqK, OrdK etc. obsolete
Also a whole new space for modularization and library design emerges.
Syntax
In any point where given parameter is suitable it type can be one of the following
Instance matching
When the instance for
is searched, following definitions should match :
as it expected the applicability of the latter depends on searching for
given Ord[String]
Instance generation
Generates instances should be generated and passed as normal lambda functions, closed on additional derived given params of the instance
Instance application
Whenever
given Ord[Either[String, Int]]
is searched. given function of typeif it found in the impicit context should be tried for applicability as if it were defined following way
The text was updated successfully, but these errors were encountered: