Skip to content

Instantly share code, notes, and snippets.

@nebtrx
Last active March 10, 2019 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nebtrx/d646b87b0ee8c062dfa791a653da90b1 to your computer and use it in GitHub Desktop.
Save nebtrx/d646b87b0ee8c062dfa791a653da90b1 to your computer and use it in GitHub Desktop.
Tagless Final Styles
// 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