I am trying to use the bound package to represent terms and propositions in a simple logical language. Here is what I have so far:
import Bound
data Term a = V a
| Func String [Term a]
deriving (Eq, Ord, Read, Show, Functor, Foldable, Traversable)
data Prop a = And (Prop a) (Prop a)
| Relation String [Term a]
| Forall (Scope () Prop a)
deriving (Functor, Foldable, Traversable)
In particular, there are terms which are either variables, or functions applied to some terms, as well as propositions which are: conjunction of two propositions, a relation applied to some terms, and quantification over variables in another proposition.
But when I try to create a function to construct a "Forall", following the example in the package documentation, I am told that Prop is not a monad:
forall' :: Eq a => a -> Prop a -> Prop a
forall' v b = Forall (abstract1 v b)
This is expected, since I didn't define Monad Prop. But there is no sensible pure (or return) into Prop, so how can I support this language using the bound package?