bound
bound copied to clipboard
Combinators for manipulating locally-nameless generalized de Bruijn terms
`(>>>= id)` gives a natural transformation `t m . m ⇒ t m,` i.e. m acts on the right.
Is it possible to use `bound` with `recursion-schemes` library? i.e. to define the names in an AST using `bound` and doing AST transformations (*optimisations, inlining, etc*) with `recursion-schemes`
The problem is, GHC can't figure out how to `fmap` the first `a` out of `Scope (Name a ()) Program a`. The `>>>=` operator will leave the `Name a ()`...
The following `makeBound` invocation chokes: ```haskell {-# LANGUAGE DeriveFunctor, TemplateHaskell #-} import Bound import Bound.Name import Data.Text type Named b = Name Text b data Term v = EVar v...
It states that it maps over both free and bound variables although it only modifies the bound ones.
`ListT` from `transformers` isn't really a monad transformer, so it seems most unlikely to be a valid `Bound` instance with the default definition.
The first thing the user reads after clicking on this library is > We represent the target language itself as an ideal monad supplied by the user I find this...
```haskell substitute :: Monad f => Eq a => a -> f a -> f a -> f a substitute = substituteOf . (==) substituteBy :: Monad m => (a...