This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +241
-176
lines changed Expand file tree Collapse file tree 4 files changed +241
-176
lines changed Original file line number Diff line number Diff line change 24
24
" tests"
25
25
],
26
26
"dependencies" : {
27
- "purescript-profunctor" : " joneshf/purescript-profunctors#master " ,
28
- "purescript-distributive" : " joneshf/purescript-distributive# ~0.2 .0" ,
29
- "purescript-const" : " ~0.1.1 " ,
30
- "purescript-identity" : " ~0.1 .0" ,
27
+ "purescript-profunctor" : " ~0.0.2 " ,
28
+ "purescript-distributive" : " ~0.3 .0" ,
29
+ "purescript-const" : " ~0.2.0 " ,
30
+ "purescript-identity" : " ~0.2 .0" ,
31
31
"purescript-either" : " ~0.1.4" ,
32
32
"purescript-maybe" : " ~0.2.1"
33
33
}
Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ module Optic.Internal.Prism where
21
21
-- I have no clue what's going on here.
22
22
-- This is basically a straight lift from:
23
23
-- https://github.com/ekmett/lens/blob/master/src/Control/Lens/Internal/Prism.hs#L56-L68
24
- left' (Market b2t s2Eta ) = Market (b2t >>> Left ) \thing -> case thing of
24
+ left (Market b2t s2Eta ) = Market (b2t >>> Left ) \thing -> case thing of
25
25
Left s -> either (Left >>> Left ) Right (s2Eta s )
26
26
Right c -> Left $ Right c
27
27
28
- right' (Market b2t s2Eta ) = Market (b2t >>> Right ) \thing -> case thing of
28
+ right (Market b2t s2Eta ) = Market (b2t >>> Right ) \thing -> case thing of
29
29
Left c -> Left $ Left c
30
30
Right s -> either (Right >>> Left ) Right (s2Eta s )
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ module Optic.Prism
17
17
import Data.Identity (runIdentity , Identity (..))
18
18
import Data.Maybe (maybe , Maybe (..))
19
19
import Data.Profunctor (dimap )
20
- import Data.Profunctor.Choice (right' , Choice )
20
+ import Data.Profunctor.Choice (right , Choice )
21
21
22
22
clonePrism :: forall f p s t a b. (Applicative f , Choice p ) => APrism s t a b -> p a (f b ) -> p s (f t )
23
23
clonePrism stab = withPrism stab prism
@@ -42,7 +42,7 @@ module Optic.Prism
42
42
only x = nearly x ((==) x )
43
43
44
44
prism :: forall f p s t a b. (Applicative f , Choice p ) => (b -> t ) -> (s -> Either t a ) -> p a (f b ) -> p s (f t )
45
- prism b2t s2Eta pafb = dimap s2Eta (either pure ((<$>) b2t )) (right' pafb )
45
+ prism b2t s2Eta pafb = dimap s2Eta (either pure ((<$>) b2t )) (right pafb )
46
46
47
47
prism' :: forall s a b. (b -> s ) -> (s -> Maybe a ) -> Prism s s a b
48
48
prism' b2s s2Ma = prism b2s (\s -> maybe (Left s) Right $ s2Ma s )
You can’t perform that action at this time.
0 commit comments