data-has 0.1.0.0 → 0.2.0.0
raw patch · 4 files changed
+381/−154 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Data.Has: get :: Has a t => t -> a
- Data.Has: modify :: Has a t => (a -> a) -> t -> t
+ Data.Has: getter :: Has a t => t -> a
+ Data.Has: instance Data.Has.Has a (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has a (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has a (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has a (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has b (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has b (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has b (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has b (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has c (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has c (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has c (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has c (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has d (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has d (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has d (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has d (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has e (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has e (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has e (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has e (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has f (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has f (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has f (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has f (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has g (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has g (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has g (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has g (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has h (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has h (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has h (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has h (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has i (a, b, c, d, e, f, g, h, i)
+ Data.Has: instance Data.Has.Has i (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has i (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has i (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has j (a, b, c, d, e, f, g, h, i, j)
+ Data.Has: instance Data.Has.Has j (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has j (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has k (a, b, c, d, e, f, g, h, i, j, k)
+ Data.Has: instance Data.Has.Has k (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: instance Data.Has.Has l (a, b, c, d, e, f, g, h, i, j, k, l)
+ Data.Has: modifier :: Has a t => (a -> a) -> t -> t
Files
- CHANGELOG +5/−0
- Data/Has.hs +372/−150
- README.md +2/−2
- data-has.cabal +2/−2
+ CHANGELOG view
@@ -0,0 +1,5 @@+# v0.2.0.0++* Change `get/modify` to `getter/modifier` to reduce naming collision, namely `get/modify` would collide with `MonadState`.++* Add tuple instances up to 12 elements.
Data/Has.hs view
@@ -19,10 +19,10 @@ -- in some library code ... logInAnyReaderHasLogger :: (Has Logger r, MonadReader r m) => LogString -> m ()- logInAnyReaderHasLogger s = asks get >>= logWithLogger s+ logInAnyReaderHasLogger s = asks getter >>= logWithLogger s queryInAnyReaderHasSQL :: (Has SqlBackEnd r, MonadReader r m) => Query -> m a- queryInAnyReaderHasSQL q = asks get >>= queryWithSQL q+ queryInAnyReaderHasSQL q = asks getter >>= queryWithSQL q ... -- now you want to use these effects together@@ -30,7 +30,7 @@ logger <- initLogger ... sql <- initSqlBackEnd ... - (`runReader` (logger, sql)) $ do+ (\`runReader\` (logger, sql)) $ do ... logInAnyReaderHasLogger ... ...@@ -68,209 +68,431 @@ -- | A type class for extensible product. ----- We provide instances for tuples up to 8 elements by default.+-- We provide instances for tuples up to 12 elements by default. -- You can define your own instance of 'Has', but most of the time tuples will do fine. -- class Has a t where- get :: t -> a- modify :: (a -> a) -> t -> t+ getter :: t -> a+ modifier :: (a -> a) -> t -> t instance Has a a where- get = id- {-# INLINABLE get #-}- modify = id- {-# INLINABLE modify #-}+ getter = id+ {-# INLINABLE getter #-}+ modifier = id+ {-# INLINABLE modifier #-} instance Has a (a, b) where- get (a, _) = a- {-# INLINABLE get #-}- modify f (a, b) = (f a, b)- {-# INLINABLE modify #-}+ getter (a, _) = a+ {-# INLINABLE getter #-}+ modifier f (a, b) = (f a, b)+ {-# INLINABLE modifier #-} instance Has b (a, b) where- get (_, b) = b- {-# INLINABLE get #-}- modify f (a, b) = (a, f b)- {-# INLINABLE modify #-}+ getter (_, b) = b+ {-# INLINABLE getter #-}+ modifier f (a, b) = (a, f b)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c) where- get (a, _, _) = a- {-# INLINABLE get #-}- modify f (a, b, c) = (f a, b, c)- {-# INLINABLE modify #-}+ getter (a, _, _) = a+ {-# INLINABLE getter #-}+ modifier f (a, b, c) = (f a, b, c)+ {-# INLINABLE modifier #-} instance Has b (a, b, c) where- get (_, b, _) = b- {-# INLINABLE get #-}- modify f (a, b, c) = (a, f b, c)- {-# INLINABLE modify #-}+ getter (_, b, _) = b+ {-# INLINABLE getter #-}+ modifier f (a, b, c) = (a, f b, c)+ {-# INLINABLE modifier #-} instance Has c (a, b, c) where- get (_, _, c) = c- {-# INLINABLE get #-}- modify f (a, b, c) = (a, b, f c)- {-# INLINABLE modify #-}+ getter (_, _, c) = c+ {-# INLINABLE getter #-}+ modifier f (a, b, c) = (a, b, f c)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c, d) where- get (a, _, _, _) = a- {-# INLINABLE get #-}- modify f (a, b, c, d) = (f a, b, c, d)- {-# INLINABLE modify #-}+ getter (a, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d) = (f a, b, c, d)+ {-# INLINABLE modifier #-} instance Has b (a, b, c, d) where- get (_, b, _, _) = b- {-# INLINABLE get #-}- modify f (a, b, c, d) = (a, f b, c, d)- {-# INLINABLE modify #-}+ getter (_, b, _, _) = b+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d) = (a, f b, c, d)+ {-# INLINABLE modifier #-} instance Has c (a, b, c, d) where- get (_, _, c, _) = c- {-# INLINABLE get #-}- modify f (a, b, c, d) = (a, b, f c, d)- {-# INLINABLE modify #-}+ getter (_, _, c, _) = c+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d) = (a, b, f c, d)+ {-# INLINABLE modifier #-} instance Has d (a, b, c, d) where- get (_, _, _, d) = d- {-# INLINABLE get #-}- modify f (a, b, c, d) = (a, b, c, f d)- {-# INLINABLE modify #-}+ getter (_, _, _, d) = d+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d) = (a, b, c, f d)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c, d, e) where- get (a, _, _, _, _) = a- {-# INLINABLE get #-}- modify f (a, b, c, d, e) = (f a, b, c, d, e)- {-# INLINABLE modify #-}+ getter (a, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d, e) = (f a, b, c, d, e)+ {-# INLINABLE modifier #-} instance Has b (a, b, c, d, e) where- get (_, b, _, _, _) = b- {-# INLINABLE get #-}- modify f (a, b, c, d, e) = (a, f b, c, d, e)- {-# INLINABLE modify #-}+ getter (_, b, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d, e) = (a, f b, c, d, e)+ {-# INLINABLE modifier #-} instance Has c (a, b, c, d, e) where- get (_, _, c, _, _) = c- {-# INLINABLE get #-}- modify f (a, b, c, d, e) = (a, b, f c, d, e)- {-# INLINABLE modify #-}+ getter (_, _, c, _, _) = c+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d, e) = (a, b, f c, d, e)+ {-# INLINABLE modifier #-} instance Has d (a, b, c, d, e) where- get (_, _, _, d, _) = d- {-# INLINABLE get #-}- modify f (a, b, c, d, e) = (a, b, c, f d, e)- {-# INLINABLE modify #-}+ getter (_, _, _, d, _) = d+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d, e) = (a, b, c, f d, e)+ {-# INLINABLE modifier #-} instance Has e (a, b, c, d, e) where- get (_, _, _, _, e) = e- {-# INLINABLE get #-}- modify f (a, b, c, d, e) = (a, b, c, d, f e)- {-# INLINABLE modify #-}+ getter (_, _, _, _, e) = e+ {-# INLINABLE getter #-}+ modifier f (a, b, c, d, e) = (a, b, c, d, f e)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c, d, e, f) where- get (a, _, _, _, _, _) = a- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (ff a, b, c, d, e, f)- {-# INLINABLE modify #-}+ getter (a, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (ff a, b, c, d, e, f)+ {-# INLINABLE modifier #-} instance Has b (a, b, c, d, e, f) where- get (_, b, _, _, _, _) = b- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (a, ff b, c, d, e, f)- {-# INLINABLE modify #-}+ getter (_, b, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (a, ff b, c, d, e, f)+ {-# INLINABLE modifier #-} instance Has c (a, b, c, d, e, f) where- get (_, _, c, _, _, _) = c- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (a, b, ff c, d, e, f)- {-# INLINABLE modify #-}+ getter (_, _, c, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (a, b, ff c, d, e, f)+ {-# INLINABLE modifier #-} instance Has d (a, b, c, d, e, f) where- get (_, _, _, d, _, _) = d- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (a, b, c, ff d, e, f)- {-# INLINABLE modify #-}+ getter (_, _, _, d, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (a, b, c, ff d, e, f)+ {-# INLINABLE modifier #-} instance Has e (a, b, c, d, e, f) where- get (_, _, _, _, e, _) = e- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (a, b, c, d, ff e, f)- {-# INLINABLE modify #-}+ getter (_, _, _, _, e, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (a, b, c, d, ff e, f)+ {-# INLINABLE modifier #-} instance Has f (a, b, c, d, e, f) where- get (_, _, _, _, _, f) = f- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f) = (a, b, c, d, e, ff f)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, f) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f) = (a, b, c, d, e, ff f)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c, d, e, f, g) where- get (a, _, _, _, _, _, _) = a- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (ff a, b, c, d, e, f, g)- {-# INLINABLE modify #-}+ getter (a, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (ff a, b, c, d, e, f, g)+ {-# INLINABLE modifier #-} instance Has b (a, b, c, d, e, f, g) where- get (_, b, _, _, _, _, _) = b- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, ff b, c, d, e, f, g)- {-# INLINABLE modify #-}+ getter (_, b, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, ff b, c, d, e, f, g)+ {-# INLINABLE modifier #-} instance Has c (a, b, c, d, e, f, g) where- get (_, _, c, _, _, _, _) = c- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, b, ff c, d, e, f, g)- {-# INLINABLE modify #-}+ getter (_, _, c, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, b, ff c, d, e, f, g)+ {-# INLINABLE modifier #-} instance Has d (a, b, c, d, e, f, g) where- get (_, _, _, d, _, _, _) = d- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, b, c, ff d, e, f, g)- {-# INLINABLE modify #-}+ getter (_, _, _, d, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, b, c, ff d, e, f, g)+ {-# INLINABLE modifier #-} instance Has e (a, b, c, d, e, f, g) where- get (_, _, _, _, e, _, _) = e- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, b, c, d, ff e, f, g)- {-# INLINABLE modify #-}+ getter (_, _, _, _, e, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, b, c, d, ff e, f, g)+ {-# INLINABLE modifier #-} instance Has f (a, b, c, d, e, f, g) where- get (_, _, _, _, _, f, _) = f- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, b, c, d, e, ff f, g)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, f, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, b, c, d, e, ff f, g)+ {-# INLINABLE modifier #-} instance Has g (a, b, c, d, e, f, g) where- get (_, _, _, _, _, _, g) = g- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g) = (a, b, c, d, e, f, ff g)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, _, g) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g) = (a, b, c, d, e, f, ff g)+ {-# INLINABLE modifier #-} -------------------------------------------------------------------------------- instance Has a (a, b, c, d, e, f, g, h) where- get (a, _, _, _, _, _, _, _) = a- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (ff a, b, c, d, e, f, g, h)- {-# INLINABLE modify #-}+ getter (a, _, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (ff a, b, c, d, e, f, g, h)+ {-# INLINABLE modifier #-} instance Has b (a, b, c, d, e, f, g, h) where- get (_, b, _, _, _, _, _, _) = b- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, ff b, c, d, e, f, g, h)- {-# INLINABLE modify #-}+ getter (_, b, _, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, ff b, c, d, e, f, g, h)+ {-# INLINABLE modifier #-} instance Has c (a, b, c, d, e, f, g, h) where- get (_, _, c, _, _, _, _, _) = c- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, ff c, d, e, f, g, h)- {-# INLINABLE modify #-}+ getter (_, _, c, _, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, ff c, d, e, f, g, h)+ {-# INLINABLE modifier #-} instance Has d (a, b, c, d, e, f, g, h) where- get (_, _, _, d, _, _, _, _) = d- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, c, ff d, e, f, g, h)- {-# INLINABLE modify #-}+ getter (_, _, _, d, _, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, c, ff d, e, f, g, h)+ {-# INLINABLE modifier #-} instance Has e (a, b, c, d, e, f, g, h) where- get (_, _, _, _, e, _, _, _) = e- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, c, d, ff e, f, g, h)- {-# INLINABLE modify #-}+ getter (_, _, _, _, e, _, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, c, d, ff e, f, g, h)+ {-# INLINABLE modifier #-} instance Has f (a, b, c, d, e, f, g, h) where- get (_, _, _, _, _, f, _, _) = f- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, ff f, g, h)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, f, _, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, ff f, g, h)+ {-# INLINABLE modifier #-} instance Has g (a, b, c, d, e, f, g, h) where- get (_, _, _, _, _, _, g, _) = g- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, f, ff g, h)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, _, g, _) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, f, ff g, h)+ {-# INLINABLE modifier #-} instance Has h (a, b, c, d, e, f, g, h) where- get (_, _, _, _, _, _, _, h) = h- {-# INLINABLE get #-}- modify ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, f, g, ff h)- {-# INLINABLE modify #-}+ getter (_, _, _, _, _, _, _, h) = h+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h) = (a, b, c, d, e, f, g, ff h)+ {-# INLINABLE modifier #-}++--------------------------------------------------------------------------------++instance Has a (a, b, c, d, e, f, g, h, i) where+ getter (a, _, _, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (ff a, b, c, d, e, f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has b (a, b, c, d, e, f, g, h, i) where+ getter (_, b, _, _, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, ff b, c, d, e, f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has c (a, b, c, d, e, f, g, h, i) where+ getter (_, _, c, _, _, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, ff c, d, e, f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has d (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, d, _, _, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, ff d, e, f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has e (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, _, e, _, _, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, d, ff e, f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has f (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, _, _, f, _, _, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, d, e, ff f, g, h, i)+ {-# INLINABLE modifier #-}+instance Has g (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, _, _, _, g, _, _) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, d, e, f, ff g, h, i)+ {-# INLINABLE modifier #-}+instance Has h (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, _, _, _, _, h, _) = h+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, d, e, f, g, ff h, i)+ {-# INLINABLE modifier #-}+instance Has i (a, b, c, d, e, f, g, h, i) where+ getter (_, _, _, _, _, _, _, _, i) = i+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i) = (a, b, c, d, e, f, g, h, ff i)+ {-# INLINABLE modifier #-}++--------------------------------------------------------------------------------++instance Has a (a, b, c, d, e, f, g, h, i, j) where+ getter (a, _, _, _, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (ff a, b, c, d, e, f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has b (a, b, c, d, e, f, g, h, i, j) where+ getter (_, b, _, _, _, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, ff b, c, d, e, f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has c (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, c, _, _, _, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, ff c, d, e, f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has d (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, d, _, _, _, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, ff d, e, f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has e (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, e, _, _, _, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, ff e, f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has f (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, _, f, _, _, _, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, e, ff f, g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has g (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, _, _, g, _, _, _) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, e, f, ff g, h, i, j)+ {-# INLINABLE modifier #-}+instance Has h (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, _, _, _, h, _, _) = h+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, e, f, g, ff h, i, j)+ {-# INLINABLE modifier #-}+instance Has i (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, _, _, _, _, i, _) = i+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, e, f, g, h, ff i, j)+ {-# INLINABLE modifier #-}+instance Has j (a, b, c, d, e, f, g, h, i, j) where+ getter (_, _, _, _, _, _, _, _, _, j) = j+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j) = (a, b, c, d, e, f, g, h, i, ff j)+ {-# INLINABLE modifier #-}++--------------------------------------------------------------------------------++instance Has a (a, b, c, d, e, f, g, h, i, j, k) where+ getter (a, _, _, _, _, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (ff a, b, c, d, e, f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has b (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, b, _, _, _, _, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, ff b, c, d, e, f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has c (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, c, _, _, _, _, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, ff c, d, e, f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has d (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, d, _, _, _, _, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, ff d, e, f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has e (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, e, _, _, _, _, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, ff e, f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has f (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, f, _, _, _, _, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, ff f, g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has g (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, _, g, _, _, _, _) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, f, ff g, h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has h (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, _, _, h, _, _, _) = h+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, f, g, ff h, i, j, k)+ {-# INLINABLE modifier #-}+instance Has i (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, _, _, _, i, _, _) = i+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, f, g, h, ff i, j, k)+ {-# INLINABLE modifier #-}+instance Has j (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, _, _, _, _, j, _) = j+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, f, g, h, i, ff j, k)+ {-# INLINABLE modifier #-}+instance Has k (a, b, c, d, e, f, g, h, i, j, k) where+ getter (_, _, _, _, _, _, _, _, _, _, k) = k+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k) = (a, b, c, d, e, f, g, h, i, j, ff k)+ {-# INLINABLE modifier #-}++--------------------------------------------------------------------------------++instance Has a (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (a, _, _, _, _, _, _, _, _, _, _, _) = a+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (ff a, b, c, d, e, f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has b (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, b, _, _, _, _, _, _, _, _, _, _) = b+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, ff b, c, d, e, f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has c (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, c, _, _, _, _, _, _, _, _, _) = c+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, ff c, d, e, f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has d (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, d, _, _, _, _, _, _, _, _) = d+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, ff d, e, f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has e (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, e, _, _, _, _, _, _, _) = e+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, ff e, f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has f (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, f, _, _, _, _, _, _) = f+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, ff f, g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has g (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, g, _, _, _, _, _) = g+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, ff g, h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has h (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, _, h, _, _, _, _) = h+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, g, ff h, i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has i (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, _, _, i, _, _, _) = i+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, g, h, ff i, j, k, l)+ {-# INLINABLE modifier #-}+instance Has j (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, _, _, _, j, _, _) = j+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, g, h, i, ff j, k, l)+ {-# INLINABLE modifier #-}+instance Has k (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, _, _, _, _, k, _) = k+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, g, h, i, j, ff k, l)+ {-# INLINABLE modifier #-}+instance Has l (a, b, c, d, e, f, g, h, i, j, k, l) where+ getter (_, _, _, _, _, _, _, _, _, _, _, l) = l+ {-# INLINABLE getter #-}+ modifier ff (a, b, c, d, e, f, g, h, i, j, k, l) = (a, b, c, d, e, f, g, h, i, j, k, ff l)+ {-# INLINABLE modifier #-}
README.md view
@@ -12,10 +12,10 @@ -- in some library code ... logInAnyReaderHasLogger :: (Has Logger r, MonadReader r m) => LogString -> m ()- logInAnyReaderHasLogger s = asks get >>= logWithLogger s+ logInAnyReaderHasLogger s = asks getter >>= logWithLogger s queryInAnyReaderHasSQL :: (Has SqlBackEnd r, MonadReader r m) => Query -> m a- queryInAnyReaderHasSQL q = asks get >>= queryWithSQL q+ queryInAnyReaderHasSQL q = asks getter >>= queryWithSQL q ... -- now you want to use these effects together
data-has.cabal view
@@ -1,5 +1,5 @@ name: data-has-version: 0.1.0.0+version: 0.2.0.0 synopsis: Simple extensible product description: Simple extensible product license: BSD3@@ -9,7 +9,7 @@ -- copyright: category: Data build-type: Simple-extra-source-files: README.md+extra-source-files: README.md, CHANGELOG cabal-version: >=1.10 homepage: https://github.com/winterland1989/data-has