New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with lens 4.0 #4

Closed
bartavelle opened this Issue Jan 30, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@bartavelle
Contributor

bartavelle commented Jan 30, 2014

I would like to upgrade some of my libraries to latest lens, but strict-base-types doesn't seem to build against it :

cabal install -p
Resolving dependencies...
Configuring strict-base-types-0.2.1...
Building strict-base-types-0.2.1...
Preprocessing library strict-base-types-0.2.1...
[1 of 3] Compiling Data.Either.Strict ( src/Data/Either/Strict.hs, dist/build/Data/Either/Strict.o )
[2 of 3] Compiling Data.Maybe.Strict ( src/Data/Maybe/Strict.hs, dist/build/Data/Maybe/Strict.o )
[3 of 3] Compiling Data.Tuple.Strict ( src/Data/Tuple/Strict.hs, dist/build/Data/Tuple/Strict.o )

src/Data/Tuple/Strict.hs:44:39:
    Module `Control.Lens.Each' does not export `Index'
Failed to install strict-base-types-0.2.1
cabal: Error: some packages failed to install:
filecache-0.2.2 depends on strict-base-types-0.2.1 which failed to install.
strict-base-types-0.2.1 failed during the building phase. The exception was:
ExitFailure 1
@bartavelle

This comment has been minimized.

Show comment
Hide comment
@bartavelle

bartavelle Jan 30, 2014

Contributor

The following change seems to let the module compile :

diff -ruN strict-base-types-0.2.1/src/Data/Tuple/Strict.hs strict-base-types-0.2.1-btvl/src/Data/Tuple/Strict.hs
--- strict-base-types-0.2.1/src/Data/Tuple/Strict.hs    2014-01-30 15:11:35.664525001 +0100
+++ strict-base-types-0.2.1-btvl/src/Data/Tuple/Strict.hs   2014-01-30 15:05:46.096537104 +0100
@@ -41,7 +41,8 @@

 import           Control.Applicative (Applicative ((<*>)), (<$>))
 import           Control.DeepSeq     (NFData (..))
-import           Control.Lens.Each   (Index, Each(..))
+import           Control.Lens.Each   (Each(..))
+import           Control.Lens.At     (Index)
 import           Control.Lens.Iso    (Strict (..), Swapped (..), iso)
 import           Control.Lens.Indexed (indexed)
 import           Control.Lens.Operators ((<&>))
@@ -136,7 +137,7 @@

 type instance Index (Pair a b) = Int

-instance (Applicative f, a~a', b~b') => Each f (Pair a a') (Pair b b') a b where
+instance (Applicative f, a~a', b~b') => Each (Pair a a') (Pair b b') a b where
   each f (a :!: b) = (:!:) <$> indexed f (0::Int) a <*> indexed f (1::Int) b

 {-  To be added once they make it to base
Contributor

bartavelle commented Jan 30, 2014

The following change seems to let the module compile :

diff -ruN strict-base-types-0.2.1/src/Data/Tuple/Strict.hs strict-base-types-0.2.1-btvl/src/Data/Tuple/Strict.hs
--- strict-base-types-0.2.1/src/Data/Tuple/Strict.hs    2014-01-30 15:11:35.664525001 +0100
+++ strict-base-types-0.2.1-btvl/src/Data/Tuple/Strict.hs   2014-01-30 15:05:46.096537104 +0100
@@ -41,7 +41,8 @@

 import           Control.Applicative (Applicative ((<*>)), (<$>))
 import           Control.DeepSeq     (NFData (..))
-import           Control.Lens.Each   (Index, Each(..))
+import           Control.Lens.Each   (Each(..))
+import           Control.Lens.At     (Index)
 import           Control.Lens.Iso    (Strict (..), Swapped (..), iso)
 import           Control.Lens.Indexed (indexed)
 import           Control.Lens.Operators ((<&>))
@@ -136,7 +137,7 @@

 type instance Index (Pair a b) = Int

-instance (Applicative f, a~a', b~b') => Each f (Pair a a') (Pair b b') a b where
+instance (Applicative f, a~a', b~b') => Each (Pair a a') (Pair b b') a b where
   each f (a :!: b) = (:!:) <$> indexed f (0::Int) a <*> indexed f (1::Int) b

 {-  To be added once they make it to base

meiersi added a commit that referenced this issue Jan 30, 2014

@meiersi

This comment has been minimized.

Show comment
Hide comment
@meiersi

meiersi Jan 30, 2014

Owner

Thanks for the report. I've used some CPP hackery to make it compile both with lens < 4.0 and lens >= 4.0. Avaliable as http://hackage.haskell.org/package/strict-base-types-0.2.2.

Owner

meiersi commented Jan 30, 2014

Thanks for the report. I've used some CPP hackery to make it compile both with lens < 4.0 and lens >= 4.0. Avaliable as http://hackage.haskell.org/package/strict-base-types-0.2.2.

@meiersi meiersi closed this Jan 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment