Last active
March 10, 2019 19:23
-
-
Save nebtrx/d646b87b0ee8c062dfa791a653da90b1 to your computer and use it in GitHub Desktop.
Tagless Final Styles
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
// 1. Accessing algebras through Type Class(the Fake Type Class Jhon mentioned in his TF dead talk) | |
// instance for F | |
class Service { | |
def fetchUserInfo[F[_]: Concurrent: UserAlg: OrderAlg](id: UserId): F[UserInfo] = ??? | |
} | |
// 2. Accessing algebras through interpreters dependencies | |
class Service[F[_]: Concurrent](u: UserAlg[F], o: OrderAlg[F]) extends ServiceAlg[F]{ | |
def fetchUserInfo[F[_]: Concurrent](id: UserId): F[UserInfo] = ??? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment