Skip to content

Commit 7df3be7

Browse files
joneshfpaf31
authored andcommitted
Add Closed instance for Tagged (#69)
1 parent ca87c46 commit 7df3be7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Data/Lens/Internal/Tagged.purs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
module Data.Lens.Internal.Tagged where
33

44
import Data.Either (Either(..))
5+
import Data.Function (const)
56
import Data.Newtype (class Newtype)
67
import Data.Profunctor (class Profunctor)
78
import Data.Profunctor.Choice (class Choice)
9+
import Data.Profunctor.Closed (class Closed)
810
import Data.Profunctor.Costrong (class Costrong)
911
import Data.Tuple (Tuple(..))
1012

@@ -22,3 +24,6 @@ instance taggedChoice :: Choice Tagged where
2224
instance taggedCostrong :: Costrong Tagged where
2325
unfirst (Tagged (Tuple b _)) = Tagged b
2426
unsecond (Tagged (Tuple _ c)) = Tagged c
27+
28+
instance taggedClosed :: Closed Tagged where
29+
closed (Tagged b) = Tagged (const b)

0 commit comments

Comments
 (0)