on master help sign in
Remove dependency on HList (via morphed) to fix compilation

This fixes compilation with GHC 8.4.3. HList is an old package that is no longer actively maintained, and so should not be depended on. Luckily, the part of this package that did so is not huge.

commita19adc588ae49e1f9c95d86431bcf35f9f07c64d authorLangston Barrett <langston.barrett@gmail.com> dateThu 13 Dec 2018, 16:31 (8 years ago) parent689792e
3 files changed+8−29
Control/Lens/SemiIso.hs−10 Control/SIArrow.hs+2−17 semi-iso.cabal+6−2
Control/Lens/SemiIso.hs−10
@@ -64,7 +64,6 @@ module Control.Lens.SemiIso (
6464 unit,
6565 swapped,
6666 associated,
67− morphed,
6867 constant,
6968 exact,
7069 bifiltered,
@@ -106,7 +105,6 @@ import Data.Foldable
106105import Data.Functor.Identity
107106import Data.Profunctor.Exposed
108107import Data.Traversable
109−import Data.Tuple.Morph
110108import Prelude hiding (id, (.))
111109
112110-- | A semi-isomorphism is a partial isomorphism with weakened laws.
@@ -222,14 +220,6 @@ unit = iso (, ()) fst
222220associated :: Iso' (a, (b, c)) ((a, b), c)
223221associated = iso (\(a, (b, c)) -> ((a, b), c)) (\((a, b), c) -> (a, (b, c)))
224222
225−-- | An isomorphism between two arbitrary nested tuples, as long the contained
226−-- types (ignoring units!) read from left to right are the same.
227−--
228−-- This is implemented using 'Data.Tuple.Morph.morph' from 'tuple-morph'.
229−morphed :: (HFoldable a, HUnfoldable a, HFoldable b, HUnfoldable b, Rep a ~ Rep b)
230− => Iso' a b
231−morphed = iso morph morph
232−
233223-- | \-> Always returns the argument.
234224--
235225-- \<- Maps everything to a @()@.
Control/SIArrow.hs+2−17
@@ -21,8 +21,7 @@ module Control.SIArrow (
2121 (#>>), (>>#), (#<<), (<<#),
2222
2323 -- * Functor and applicative.
24− (/$/), (/$~),
25− (/*/), (/*), (*/),
24+ (/$/), (/*/), (/*), (*/),
2625
2726 -- * Signaling errors.
2827 sifail, (/?/),
@@ -43,12 +42,11 @@ import Control.Lens.Iso
4342import Control.Lens.SemiIso
4443import Control.Monad
4544import Data.Semigroupoid.Dual
46−import Data.Tuple.Morph
4745import Prelude hiding (id, (.))
4846
4947infixr 1 ^>>, ^<<, #>>, #<<
5048infixr 1 >>^, <<^, >>#, <<#
51−infixl 4 /$/, /$~
49+infixl 4 /$/
5250infixl 5 /*/, */, /*
5351infixl 3 /?/
5452
@@ -143,19 +141,6 @@ a <<# f = a . sipure f
143141(/$/) :: SIArrow cat => ASemiIso' b' b -> cat a b -> cat a b'
144142(/$/) = (#<<)
145143
146−-- | Convenient fmap.
147−--
148−-- > ai /$~ f = ai . morphed /$/ f
149−--
150−-- This operator handles all the hairy stuff with uncurried application:
151−-- it reassociates the argument tuple and removes unnecessary (or adds necessary)
152−-- units to match the function type. You don't have to use @/*@ and @*/@ with this
153−-- operator.
154−(/$~) :: (SIArrow cat, HFoldable b', HFoldable b,
155− HUnfoldable b', HUnfoldable b, Rep b' ~ Rep b)
156− => ASemiIso' a b' -> cat c b -> cat c a
157−ai /$~ h = cloneSemiIso ai . morphed /$/ h
158−
159144-- | The product of two arrows with duplicate units removed. Side effect are
160145-- sequenced from left to right.
161146--
semi-iso.cabal+6−2
@@ -53,7 +53,7 @@ maintainer: Paweł Nowak <pawel834@gmail.com>
5353copyright: Paweł Nowak 2014
5454category: Control, Data
5555build-type: Simple
56−cabal-version: >=1.10
56+cabal-version: >=1.11
5757
5858source-repository head
5959 type: git
@@ -66,6 +66,10 @@ library
6666 Control.Category.Reader
6767 Control.Category.Structures
6868 Data.Profunctor.Exposed
69− build-depends: base >= 4 && < 5, profunctors, transformers, lens, tuple-morph, semigroupoids
69+ build-depends: base >= 4
70+ , profunctors == 5.*
71+ , transformers
72+ , lens == 4.*
73+ , semigroupoids
7074 default-language: Haskell2010
7175 ghc-options: -Wall