Provide a better, more robust implementation for Free.
Implementation details
Free is a type that, given any Functor, it is able to provide a Monad for it. This Monad can be later interpreted into different, less restrictive Monads. Free is modeled as a sum type where the two cases roughly correspond to the pure and flatten methods in Monad. From there, instances of Functor, Applicative, Selective, and Monad are able to be provided.
This PR also includes some utilities in terms of natural transformations (extensions to FunctionK) that will help in the interpretation of Free Monads.
Testing details
Type class laws and general behavior of the Free implementation are tested.
Related issues
Closes #286
Goal
Provide a better, more robust implementation for
Free
.Implementation details
Free is a type that, given any Functor, it is able to provide a Monad for it. This Monad can be later interpreted into different, less restrictive Monads. Free is modeled as a sum type where the two cases roughly correspond to the
pure
andflatten
methods in Monad. From there, instances of Functor, Applicative, Selective, and Monad are able to be provided.This PR also includes some utilities in terms of natural transformations (extensions to FunctionK) that will help in the interpretation of Free Monads.
Testing details
Type class laws and general behavior of the Free implementation are tested.