Skip to content

Commit

Permalink
Add concludedP as analogue to conclude from semigroupoids
Browse files Browse the repository at this point in the history
  • Loading branch information
endgame committed Apr 10, 2023
1 parent 53e787d commit 6b03c15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Class methods now capture two perspectives: "`Decidable`
operations on the input (`decideP`)" and "eithering" (`(+++!)`).
* Add `decidedP = decideP id`
* Add `concludedP = concludeP id`

# 0.11.0.3

Expand Down
7 changes: 7 additions & 0 deletions Data/Profunctor/Product/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,10 @@ class SemisumProfunctor p => SumProfunctor p where
concludeP :: (a -> Void) -> p a x
concludeP f = Profunctor.dimap f absurd voidP
{-# MINIMAL voidP | concludeP #-}

-- | Analogue to @concluded@ (from "semigroupoids") or
-- 'Data.Functor.Contravariant.Divisible.lost'. Potentially more
-- meaningful than 'concludeP', as it shows that we definitely cannot
-- receive _anything_ on the input side.
concludedP :: SumProfunctor p => p Void x
concludedP = concludeP id

0 comments on commit 6b03c15

Please sign in to comment.