# codo-notation: A notation for comonads, analogous to the do-notation for monads.

A notation for comonads, analogous to the do-notation for monads.

Requires the `TemplateHaskell`

and `QuasiQuotes`

extensions.

Example 1:

{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE QuasiQuotes #-} import Control.Comonad import Language.Haskell.Codo foo :: (Comonad c, Num a) => c a -> a foo = [codo| x => extract x + 1 |]

Example 2:

import Data.Monoid instance Monoid Double where mempty = 0.0 mappend = (+) differentiate f = ((f 0.001) - f 0) / 0.001 minima :: (Double -> Double) -> Bool minima = [codo| f => f' <- differentiate f f'' <- differentiate f' (extract f' < 0.001) && (extract f'' > 0) |]

Further explanation of the syntax can be found in the following (short) paper: http://www.cl.cam.ac.uk/~dao29/drafts/codo-notation-orchard-ifl12.pdf with a numer of examples.

Further examples can be found here: https://github.com/dorchard/codo-notation.

Versions [faq] | 0.5, 0.5.2 |
---|---|

Dependencies | base (>=4.2 && <5), comonad (>=3), haskell-src-meta (>=0.5.1), parsec (>=3), template-haskell (>=2.7), uniplate (>=1.6) [details] |

License | BSD-3-Clause |

Author | Dominic Orchard <dom.orchard@gmail.com> |

Maintainer | Dominic Orchard <dom.orchard@gmail.com> |

Category | Language |

Source repo | head: git clone git://github.com/dorchard/codo-notation.git |

Uploaded | by DominicOrchard at Thu Nov 22 20:04:19 UTC 2012 |

Distributions | LTSHaskell:0.5.2, NixOS:0.5.2, Stackage:0.5.2 |

Downloads | 1435 total (21 in the last 30 days) |

Rating | (no votes yet) [estimated by rule of succession] |

Your Rating | |

Status | Docs uploaded by user Build status unknown [no reports yet] |

## Downloads

- codo-notation-0.5.2.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)