git.iko.soy/semi-iso-optics
on master help sign in
Workaround a bug with haddock and pattern synyonyms. Fixed some docs issues.
commit180dcbcb7987eeed383c00c1d1d94d78ecdbfa3d authorPaweł Nowak <pawel834@gmail.com> dateSun 23 Nov 2014, 14:00 (12 years ago) parentff4a426
1 file changed+19−11
Data/SemiIsoFunctor.hs+19−11
Data/SemiIsoFunctor.hs+19−11
@@ -57,29 +57,37 @@ class SemiIsoFunctor f where
5757(/$/) :: SemiIsoFunctor f => ASemiIso' a b -> f b -> f a
5858(/$/) = simap
5959
60−-- | @ai /$~ f@ is equal to @ai . morphed /$/ f@.
60+-- | > ai /$~ f = ai . morphed /$/ f
6161--
6262-- This operator handles all the hairy stuff with uncurried application:
6363-- it reassociates the argument tuple and removes unnecessary (or adds necessary)
64−-- units to match the function type. You don't have to use /* and */ with this
64+-- units to match the function type. You don't have to use @/*@ and @*/@ with this
6565-- operator.
6666(/$~) :: (SemiIsoFunctor f, HFoldable b', HFoldable b,
6767 HUnfoldable b', HUnfoldable b, Rep b' ~ Rep b)
6868 => ASemiIso' a b' -> f b -> f a
69−(SemiIso f g) /$~ h = semiIso f g . morphed /$/ h
69+-- TODO GHC 7.10: haddock doesn't work with pattern synynonyms yet
70+-- (SemiIso f g) /$~ h = semiIso f g . morphed /$/ h
71+ai /$~ h = withSemiIso ai $ \f g -> semiIso f g . morphed /$/ h
7072
71−-- | @ai ~$/ f@ is equal to @morphed . ai /$/ f@.
73+-- | > ai ~$/ f = morphed . ai /$/ f
7274(~$/) :: (SemiIsoFunctor f, HFoldable a', HFoldable a,
7375 HUnfoldable a', HUnfoldable a, Rep a' ~ Rep a)
7476 => ASemiIso' a' b -> f b -> f a
75−(SemiIso f g) ~$/ h = morphed . semiIso f g /$/ h
76−
77−-- | @ai ~$~ f@ is equal to @morphed . ai . morphed /$/ f@.
78−(~$~) :: (SemiIsoFunctor f, HFoldable b', HFoldable b', HFoldable b,
79− HFoldable a, HUnfoldable b', HUnfoldable b', HUnfoldable b,
80− HUnfoldable a, Rep b' ~ Rep b, Rep b' ~ Rep a)
77+-- TODO GHC 7.10: haddock doesn't work with pattern synynonyms yet
78+--(SemiIso f g) ~$/ h = morphed . semiIso f g /$/ h
79+ai ~$/ h = withSemiIso ai $ \f g -> morphed . semiIso f g /$/ h
80+
81+-- | > ai ~$~ f = morphed . ai . morphed /$/ f
82+(~$~) :: (SemiIsoFunctor f,
83+ HFoldable a, HUnfoldable a,
84+ HFoldable b, HUnfoldable b,
85+ HFoldable b', HUnfoldable b',
86+ Rep b' ~ Rep b, Rep b' ~ Rep a)
8187 => ASemiIso b' b' b' b' -> f b -> f a
82−(SemiIso f g) ~$~ h = morphed . semiIso f g . morphed /$/ h
88+-- TODO GHC 7.10: haddock doesn't work with pattern synynonyms yet
89+--(SemiIso f g) ~$~ h = morphed . semiIso f g . morphed /$/ h
90+ai ~$~ h = withSemiIso ai $ \f g -> morphed . semiIso f g . morphed /$/ h
8391
8492-- | Equivalent of 'Applicative' for 'SemiIsoFunctor'.
8593--