diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index 3957c0805..70eb5028b 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -115,6 +115,9 @@ type FAlgebra t a = Base t a -> a -- | An R-algebra on the base functor of some type 't'. type RAlgebra t a = Base t (t, a) -> a +-- | A CV-algebra (Course of Value) on the base functor of some type 't'; an algebra which provides its references upon request. +type CVAlgebra t a = Base t (Cofree (Base t) a) -> a + -- | Promote an FAlgebra into an RAlgebra (by dropping the original parameter). fToR :: Functor (Base t) => FAlgebra t a -> RAlgebra t a fToR f = f . fmap snd