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:
parent
953034ccb3
commit
d6cb7890b9
@ -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.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user