extremely basic Rlp2Core

This commit is contained in:
crumbtoo
2024-04-07 14:17:41 -06:00
parent dd93b76b69
commit 2944025327
8 changed files with 106 additions and 20 deletions

View File

@@ -0,0 +1,14 @@
module Misc.MonadicRecursionSchemes
where
--------------------------------------------------------------------------------
import Control.Monad
import Data.Functor.Foldable
--------------------------------------------------------------------------------
-- | catamorphism
cataM :: (Monad m, Traversable (Base t), Recursive t)
=> (Base t a -> m a) -- ^ algebra
-> t -> m a
cataM phi = h
where h = phi <=< mapM h . project