-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove hierarchy derivations, as these are causing problems - Add methods to get instances from effect types directly - Add transitions from MTL typeclasses to core typeclasses - Bump version to 0.2.0
- Loading branch information
Showing
10 changed files
with
241 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/main/scala/com/olegpy/meow/internal/ParentInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.olegpy.meow.internal | ||
|
||
import cats.{Applicative, Functor, Monad} | ||
import cats.mtl._ | ||
import shapeless.LowPriority | ||
|
||
|
||
private[meow] trait ParentInstances extends ParentInstances1 { | ||
implicit def monadStateIsMonad[F[_], S]( | ||
implicit LP: LowPriority, | ||
MS: MonadState[F, S] | ||
): Monad[F] = MS.monad | ||
} | ||
|
||
private[meow] trait ParentInstances1 extends ParentInstances2 { | ||
implicit def monadChronicleIsMonad[F[_], S]( | ||
implicit LP: LowPriority, | ||
MC: MonadChronicle[F, S] | ||
): Monad[F] = MC.monad | ||
} | ||
|
||
private[meow] trait ParentInstances2 extends ParentInstances3 { | ||
implicit def applicativeHandleIsApplicative[F[_], S]( | ||
implicit LP: LowPriority, | ||
AH: ApplicativeHandle[F, S] | ||
): Applicative[F] = AH.applicative | ||
} | ||
|
||
private[meow] trait ParentInstances3 extends ParentInstances4 { | ||
implicit def applicativeAskIsApplicative[F[_], S]( | ||
implicit LP: LowPriority, | ||
AA: ApplicativeAsk[F, S] | ||
): Applicative[F] = AA.applicative | ||
} | ||
|
||
private[meow] trait ParentInstances4 extends ParentInstances5 { | ||
implicit def applicativeLocalIsApplicative[F[_], S]( | ||
implicit LP: LowPriority, | ||
AL: ApplicativeLocal[F, S] | ||
): Applicative[F] = AL.applicative | ||
} | ||
|
||
private[meow] trait ParentInstances5 extends ParentInstances6 { | ||
implicit def functorRaiseIsFunctor[F[_], S]( | ||
implicit LP: LowPriority, | ||
FR: FunctorRaise[F, S] | ||
): Functor[F] = FR.functor | ||
} | ||
|
||
private[meow] trait ParentInstances6 extends ParentInstances7 { | ||
implicit def functorTellIsFunctor[F[_], S]( | ||
implicit LP: LowPriority, | ||
FT: FunctorTell[F, S] | ||
): Functor[F] = FT.functor | ||
} | ||
|
||
private[meow] trait ParentInstances7 { | ||
implicit def functorListenIsFunctor[F[_], S]( | ||
implicit LP: LowPriority, | ||
FL: FunctorListen[F, S] | ||
): Functor[F] = FL.functor | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.olegpy.meow | ||
|
||
import com.olegpy.meow.internal.ParentInstances | ||
|
||
|
||
object prelude extends ParentInstances |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.