Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

Naive Free monads suffer from a quadratic complexity, as explained in

- Janis Voigtlander,
*Asymptotic Improvement of Computations over Free Monads, MPC'08*

The solution is to redefine the Free datatype in CPS, similar to what is done in difference lists to solve the problem on quadratic append for lists.

# Documentation

C (forall b. (a -> mu b) -> mu b) |

## Instances

MonadTrans C Source # | |

Defined in Control.Monad.Free.Improve | |

(Monad m, Functor f) => MonadFree f (C (FreeT f m)) Source # | |

Functor f => MonadFree f (C (Free f)) Source # | |

Monad (C mu) Source # | |

Functor (C mu) Source # | |

Applicative (C mu) Source # | |

MonadPlus mu => Alternative (C mu) Source # | |

MonadPlus mu => MonadPlus (C mu) Source # | |