Skip to content

Commit 0f7bb5b

Browse files
committed
Add Functor instance for Split
1 parent 82244de commit 0f7bb5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Data/Profunctor/Split.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ newtype Split f a b = Split (Exists (SplitF f a b))
1717

1818
data SplitF f a b x = SplitF (a -> x) (x -> b) (f x)
1919

20+
instance functorSplit :: Functor (Split f a) where
21+
map f = unSplit \g h fx -> split g (f <<< h) fx
22+
2023
instance profunctorSplit :: Profunctor (Split f) where
2124
dimap f g = unSplit \h i -> split (h <<< f) (g <<< i)
2225

0 commit comments

Comments
 (0)