purescript-profunctor icon indicating copy to clipboard operation
purescript-profunctor copied to clipboard

splitString/Choice are constrained to categories while they do not require identity

Open erykciepiela opened this issue 1 year ago • 0 comments

splitStrong
  :: forall p a b c d
   . Category p -- actually only Semigroupoid required 
  => Strong p
  => p a b
  -> p c d
  -> p (Tuple a c) (Tuple b d)
splitStrong l r = first l >>> second r
splitChoice
  :: forall p a b c d
   . Category p -- actually only Semigroupoid required 
  => Choice p
  => p a b
  -> p c d
  -> p (Either a c) (Either b d)
splitChoice l r = left l >>> right r

erykciepiela avatar Mar 03 '24 11:03 erykciepiela