I'm trying to write Robinson's unification algorithm using recursion schemes. The unification algorithm takes two types and spits a result. A type is a:
data TypeF a
= TypeApplication a a
| TypeVariable Name
deriving (Read,Show,Eq,Functor,Foldable,Traversable)
type Type = Fix TypeF
unify :: Type -> Type -> Result
unify = ...
How can this be done elegantly using recursion schemes?