mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Define a convenience to unwrap and project.
This commit is contained in:
parent
76218f1b9f
commit
2ab72ea378
@ -13,6 +13,10 @@ data Union (ts :: [* -> *]) (a :: *) where
|
||||
wrapU :: (MonadFree (Union fs) m, InUnion fs f) => f (m a) -> m a
|
||||
wrapU = wrap . emb
|
||||
|
||||
-- | Unwrap a cofree comonad and project a functor from the resulting union.
|
||||
unwrapU :: (ComonadCofree (Union fs) w, InUnion fs f) => w a -> Maybe (f (w a))
|
||||
unwrapU = proj . unwrap
|
||||
|
||||
|
||||
-- Classes
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user