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 2424 " tests"
2525 ],
2626 "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" ,
3131 "purescript-either" : " ~0.1.4" ,
3232 "purescript-maybe" : " ~0.2.1"
3333 }
Original file line number Diff line number Diff line change @@ -21,10 +21,10 @@ module Optic.Internal.Prism where
2121 -- I have no clue what's going on here.
2222 -- This is basically a straight lift from:
2323 -- 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
2525 Left s -> either (Left >>> Left ) Right (s2Eta s )
2626 Right c -> Left $ Right c
2727
28- right' (Market b2t s2Eta ) = Market (b2t >>> Right ) \thing -> case thing of
28+ right (Market b2t s2Eta ) = Market (b2t >>> Right ) \thing -> case thing of
2929 Left c -> Left $ Left c
3030 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
1717 import Data.Identity (runIdentity , Identity (..))
1818 import Data.Maybe (maybe , Maybe (..))
1919 import Data.Profunctor (dimap )
20- import Data.Profunctor.Choice (right' , Choice )
20+ import Data.Profunctor.Choice (right , Choice )
2121
2222 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 )
2323 clonePrism stab = withPrism stab prism
@@ -42,7 +42,7 @@ module Optic.Prism
4242 only x = nearly x ((==) x )
4343
4444 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 )
4646
4747 prism' :: forall s a b. (b -> s ) -> (s -> Maybe a ) -> Prism s s a b
4848 prism' b2s s2Ma = prism b2s (\s -> maybe (Left s) Right $ s2Ma s )
You can’t perform that action at this time.
0 commit comments