From 3dd4d12af82e4427068ded23d8d96c201e835d89 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 24 Apr 2017 13:28:56 -0400 Subject: [PATCH] Define the strengthening of a single-member union. --- src/Data/Functor/Union.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Data/Functor/Union.hs b/src/Data/Functor/Union.hs index ed2cfdc55..6fee9f877 100644 --- a/src/Data/Functor/Union.hs +++ b/src/Data/Functor/Union.hs @@ -25,6 +25,11 @@ unwrapU :: (ComonadCofree (Union fs) w, InUnion fs f) => w a -> Maybe (f (w a)) unwrapU = prj . unwrap +strengthen :: Union '[f] a -> f a +strengthen (Here f) = f +strengthen _ = undefined + + -- Classes class InUnion (fs :: [* -> *]) (f :: * -> *) where