on master help sign in
12 files changed+111−57
since splitsnapshots
unifiedsplit
.gitignore+17−2 .travis.yml+25−18 CHANGELOG.md+5 README.md−16 bench/Bench.hs+1 bench/TupleInstances.hs+9 ether.cabal+20−14 shell.nix+22 src/Ether/Reader.hs+2−2 stack.yaml−5 test/Regression/T1.hs+1 test/TupleInstances.hs+9
.gitignore+17−2
@@ -1,6 +1,21 @@
1−tags
1+# Cabal
22dist
33dist-newstyle
4−.stack-work
54.cabal-sandbox/
65cabal.sandbox.config
6+cabal.project.local
7+.ghc.environment*
8+
9+# Profiling
10+*.prof
11+
12+# Stack
13+.stack-work
14+
15+# Emacs
16+TAGS
17+.dir-locals.el
18+
19+# Vim
20+tags
21+*.swp
.travis.yml+25−18
@@ -1,24 +1,31 @@
1−sudo: false
1+language: nix
22
3−cache:
4− directories:
5− - $HOME/.stack/
3+os:
4+ - linux
5+ - osx
66
7−before_install:
8− - mkdir -p ~/.local/bin
9− - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
10− - export PATH=~/.local/bin:$PATH
11− - stack --version
12− - stack setup
7+env:
8+ - HC=ghc822
9+ - HC=ghc844
10+ - HC=ghc861
1311
14−install:
15− - stack install --only-dependencies --no-terminal
12+before_install:
13+ - curl https://raw.githubusercontent.com/monadfix/nix-cabal/master/nix-cabal -o nix-cabal && chmod u+x nix-cabal
14+ - travis_retry ./nix-cabal new-update
1615
1716script:
18− - stack test ether:regression --no-terminal --ghc-options -Werror
19− - stack bench ether:bench --no-terminal --ghc-options -Werror
17+ - ./nix-cabal new-test ether:regression
18+ - ./nix-cabal new-bench ether:bench
19+
20+cache:
21+ directories:
22+ - ~/.cabal
23+ - ~/.ghc
2024
21−addons:
22− apt:
23− packages:
24− - libgmp-dev
25+matrix:
26+ # broken at the moment
27+ exclude:
28+ - os: osx
29+ env: HC=ghc822
30+ - os: osx
31+ env: HC=ghc861
CHANGELOG.md+5
@@ -1,3 +1,8 @@
1+0.5.1.0
2+-------
3+
4+* Disable `HasLens` for tuples via cabal flag.
5+
160.5.0.0
27-------
38
README.md−16
@@ -2,24 +2,8 @@
22
33[![Build Status](https://img.shields.io/travis/int-index/ether.svg)](https://travis-ci.org/int-index/ether)
44[![Hackage](https://img.shields.io/hackage/v/ether.svg)](https://hackage.haskell.org/package/ether)
5−[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/int-index/ether)
65
76
87Ether is a Haskell library that extends [mtl](https://hackage.haskell.org/package/mtl)
98and [transformers](https://hackage.haskell.org/package/transformers) with tagged
109monad transformers and classes in a compatible way.
11−
12−## Installation
13−
14−You can install `ether 0.4.0.0`
15−
16−1. using Cabal, from Hackage;
17−2. using Stack, from Stackage;
18−3. using Portage, from Gentoo Haskell Overlay.
19−
20−If unsure, use [Stack](https://github.com/commercialhaskell/stack).
21−
22−## Getting Started
23−
24−To get started, read the introduction on the [homepage](https://int-index.github.io/ether/).
25−If you need help with Ether or if you have any questions about it, ask me in the Gitter chat.
bench/Bench.hs+1
@@ -8,6 +8,7 @@ import qualified Control.Monad.Reader as M
88import qualified Control.Monad.State as M
99import Criterion.Main
1010import Ether
11+import TupleInstances ()
1112
1213id' :: a -> a
1314id' = id
bench/TupleInstances.hsnew file+9
@@ -0,0 +1,9 @@
1+{-# OPTIONS -fno-warn-orphans #-}
2+{-# LANGUAGE CPP #-}
3+
4+module TupleInstances () where
5+
6+#ifdef DISABLE_TUP_INSTANCES
7+import Ether.Internal (makeTupleInstancesHasLens)
8+makeTupleInstancesHasLens [4,5,9]
9+#endif
ether.cabal+20−14
@@ -1,21 +1,17 @@
1+cabal-version: 2.2
12name: ether
2−version: 0.5.0.0
3+version: 0.5.2.0
34synopsis: Monad transformers and classes
4−description:
5− Ether is a Haskell library that extends @mtl@ and @transformers@ with
6− tagged monad transformers and classes in a compatible way.
7−
8− Introduction <https://int-index.github.io/ether/>
9−
10−category: Control
11−license: BSD3
5+description: Lib
6+license: BSD-3-Clause
7+-- ^ unfortunately have to change this line due to the issue with cabal2nix
128license-file: LICENSE
9+category: Control
1310author: Vladislav Zavialov
1411maintainer: Vladislav Zavialov <vlad.z.4096@gmail.com>
1512homepage: https://int-index.github.io/ether/
1613bug-reports: https://github.com/int-index/ether/issues
1714build-type: Simple
18−cabal-version: >=1.18
1915extra-source-files: CHANGELOG.md
2016
2117source-repository head
@@ -58,10 +54,10 @@ library
5854 Ether.Internal.TupleInstances
5955
6056 build-depends:
61− base >=4.9 && <4.11,
57+ base >=4.9 && <4.13,
6258 transformers >=0.5.2.0,
6359 transformers-lift >=0.2.0.1,
64− mtl >=2.2.1,
60+ mtl >=2.2.2,
6561 mmorph >=1.0.4,
6662 monad-control >=1.0.0.4,
6763 transformers-base >=0.4.4,
@@ -111,7 +107,7 @@ library
111107test-suite regression
112108
113109 build-depends:
114− base >=4.9 && <4.11,
110+ base >=4.9 && <4.13,
115111 transformers >=0.4.2,
116112 mtl >=2.2.1,
117113 tasty >=0.10,
@@ -125,6 +121,7 @@ test-suite regression
125121 Regression.hs
126122
127123 other-modules:
124+ TupleInstances
128125 Regression.T1
129126 Regression.T2
130127 Regression.T3
@@ -175,11 +172,14 @@ test-suite regression
175172 ghc-options:
176173 -Wall -fno-warn-missing-signatures
177174
175+ if flag(disable-tup-instances)
176+ cpp-options: -DDISABLE_TUP_INSTANCES
177+
178178
179179benchmark bench
180180
181181 build-depends:
182− base >=4.9 && <4.11,
182+ base >=4.9 && <4.13,
183183 mtl >=2.2.1,
184184 transformers >=0.4.2,
185185 criterion >=1.1,
@@ -190,6 +190,9 @@ benchmark bench
190190 main-is:
191191 Bench.hs
192192
193+ other-modules:
194+ TupleInstances
195+
193196 type:
194197 exitcode-stdio-1.0
195198
@@ -229,3 +232,6 @@ benchmark bench
229232
230233 ghc-prof-options:
231234 -fprof-auto
235+
236+ if flag(disable-tup-instances)
237+ cpp-options: -DDISABLE_TUP_INSTANCES
shell.nixnew file+22
@@ -0,0 +1,22 @@
1+{ pkgs ? import <nixpkgs> {},
2+ hc ? "ghc844"
3+}:
4+
5+pkgs.stdenv.mkDerivation rec {
6+ name = "ether";
7+ buildInputs = [
8+ pkgs.haskell.compiler.${hc}
9+ pkgs.git
10+ pkgs.zlib
11+ pkgs.cabal-install
12+ pkgs.pkgconfig
13+ ];
14+ shellHook = ''
15+ export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath buildInputs}:$LD_LIBRARY_PATH
16+ export LANG=en_US.UTF-8
17+ '';
18+ LOCALE_ARCHIVE =
19+ if pkgs.stdenv.isLinux
20+ then "${pkgs.glibcLocales}/lib/locale/locale-archive"
21+ else "";
22+}
src/Ether/Reader.hs+2−2
@@ -139,7 +139,7 @@ readerT = coerce (T.ReaderT @r @m @a)
139139-- | Runs a 'ReaderT' with the given environment
140140-- and returns the final value.
141141runReaderT :: forall tag r m a . ReaderT tag r m a -> r -> m a
142−runReaderT = coerce (T.runReaderT @r @_ @m @a)
142+runReaderT = coerce (T.runReaderT @r @m @a)
143143
144144-- | Runs a 'ReaderT' with the given environment
145145-- and returns the final value.
@@ -203,7 +203,7 @@ type ReadersT r = TaggedTrans (READERS (Tags r)) (T.ReaderT r)
203203type Readers r = ReadersT r Identity
204204
205205runReadersT :: forall p m a . ReadersT p m a -> p -> m a
206−runReadersT = coerce (T.runReaderT @p @_ @m @a)
206+runReadersT = coerce (T.runReaderT @p @m @a)
207207
208208runReaders :: forall p a . Readers p a -> p -> a
209209runReaders = coerce (T.runReader @p @a)
stack.yamldeleted−5
@@ -1,5 +0,0 @@
1−resolver: lts-7.23
2−packages: ['.']
3−extra-deps:
4−- transformers-lift-0.2.0.1
5−- mmorph-1.1.0
test/Regression/T1.hs+1
@@ -1,6 +1,7 @@
11module Regression.T1 (test1) where
22
33import Ether
4+import TupleInstances ()
45import Data.List (group)
56
67import Test.Tasty
test/TupleInstances.hsnew file+9
@@ -0,0 +1,9 @@
1+{-# OPTIONS -fno-warn-orphans #-}
2+{-# LANGUAGE CPP #-}
3+
4+module TupleInstances () where
5+
6+#ifdef DISABLE_TUP_INSTANCES
7+import Ether.Internal (makeTupleInstancesHasLens)
8+makeTupleInstancesHasLens [2]
9+#endif