1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Define a function to promote F-algebras into R-algebras.

This commit is contained in:
Rob Rix 2017-04-24 15:45:50 -04:00
parent 953034ccb3
commit d6cb7890b9

View File

@ -115,6 +115,8 @@ 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
fToR :: Functor (Base t) => FAlgebra t a -> RAlgebra t a
fToR f = f . fmap snd
-- | Produce a list of identifiable subterms of a given term.
--