typelevel / typelevel/cats

Free with more than 2 algebra

Open
#914 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

I am trying to define a Free monad similar to http://typelevel.org/cats/tut/freemonad.html using 3 instead of 2 algebras. However, I am having issues to get Inject automatically derived. Here is the best solution I could come up with but I would like to get rid of the implicit inject3a, inject3b and inject3c

https://gist.github.com/julien-truffaut/78cc00b9ff5d4bb234e3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Cats Free monad tutorial and the supplied gist, then inspect how Inject is derived for two algebras in the Cats codebase. Determine whether automatic derivation can cover three algebras without the explicit inject3a, inject3b, and inject3c instances; done means a working three-algebra Free example with those implicits removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.