Skip to content

Commit c1e1ce3

Browse files
author
Mike Solomon
authored
Removes costrong and cochoice from costar (#38)
* Removes costrong and cochoice from costar * Removes unused import
1 parent 120a764 commit c1e1ce3

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

src/Data/Profunctor/Costar.purs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import Control.Comonad (class Comonad, extract)
66
import Control.Extend (class Extend, (=<=))
77

88
import Data.Distributive (class Distributive, distribute)
9-
import Data.Either (Either(..), either)
109
import Data.Functor.Invariant (class Invariant, imapF)
1110
import Data.Newtype (class Newtype)
1211
import Data.Profunctor (class Profunctor, lcmap)
1312
import Data.Profunctor.Closed (class Closed)
14-
import Data.Profunctor.Cochoice (class Cochoice)
15-
import Data.Profunctor.Costrong (class Costrong)
1613
import Data.Profunctor.Strong (class Strong)
1714
import Data.Tuple (Tuple(..), fst, snd)
1815

@@ -58,20 +55,6 @@ instance strongCostar :: Comonad f => Strong (Costar f) where
5855
first (Costar f) = Costar \x -> Tuple (f (map fst x)) (snd (extract x))
5956
second (Costar f) = Costar \x -> Tuple (fst (extract x)) (f (map snd x))
6057

61-
instance costrongCostar :: Functor f => Costrong (Costar f) where
62-
unfirst (Costar f) = Costar \fb ->
63-
let bd = f ((\a -> Tuple a (snd bd)) <$> fb) in fst bd
64-
unsecond (Costar f) = Costar \fb ->
65-
let db = f ((\a -> Tuple (fst db) a) <$> fb) in snd db
66-
67-
instance cochoiceCostar :: Applicative f => Cochoice (Costar f) where
68-
unleft (Costar f) =
69-
let g = either identity (\r -> g (pure (Right r))) <<< f
70-
in Costar (g <<< map Left)
71-
unright (Costar f) =
72-
let g = either (\l -> g (pure (Left l))) identity <<< f
73-
in Costar (g <<< map Right)
74-
7558
instance closedCostar :: Functor f => Closed (Costar f) where
7659
closed (Costar f) = Costar \g x -> f (map (_ $ x) g)
7760

0 commit comments

Comments
 (0)