on master help sign in
Doc fixup
commitf4890119c3024c316f01434a99f226731f3f1606 authorCsongor Kiss <kiss.csongor.kiss@gmail.com> dateSat 10 Jun 2017, 15:25 (9 years ago) parent8193839
3 files changed+21−27
LICENSE+1−1 src/Data/Generic/Product/HasFieldAt.hs+17−25 src/Data/Generic/Record/Internal/Contains.hs+3−1
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2016, Csongor Kiss
1+Copyright (c) 2017, Csongor Kiss
22
33All rights reserved.
44
src/Data/Generic/Product/HasFieldAt.hs+17−25
@@ -13,32 +13,14 @@
1313-----------------------------------------------------------------------------
1414-- |
1515-- Module : Data.Generic.Product.HasFieldAt
16−-- Copyright : (C) 2017 Toby Shaw
16+-- Copyright : (C) 2017 Csongor Kiss
1717-- License : BSD3
18−-- Maintainer : Toby Shaw <toby.shaw.96@gmail.com>
18+-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
1919-- Stability : experimental
2020-- Portability : non-portable
2121--
2222-- Derive product items lenses generically.
2323--
24−-----------------------------------------------------------------------------
25−
26−module Data.Generic.Product.HasFieldAt
27− ( -- * Lens
28− -- $example
29− HasFieldAt (..)
30− -- * Getter and setter functions
31− , getFieldAt
32− , setFieldAt
33− ) where
34−
35−import Data.Generic.Internal.Lens
36−
37−import GHC.TypeLits
38−import Data.Kind (Type)
39−import GHC.Generics
40−
41−-- $example
4224-- @
4325--
4426-- module Example where
@@ -53,6 +35,21 @@ import GHC.Generics
5335-- human = Human \"Tunyasz\" 50 \"London\"
5436--
5537-- @
38+--
39+-----------------------------------------------------------------------------
40+
41+module Data.Generic.Product.HasFieldAt
42+ ( HasFieldAt (..)
43+ -- * Getter and setter functions
44+ , getFieldAt
45+ , setFieldAt
46+ ) where
47+
48+import Data.Generic.Internal.Lens
49+
50+import GHC.TypeLits
51+import Data.Kind (Type)
52+import GHC.Generics
5653
5754-- | Get positional field
5855--
@@ -73,11 +70,6 @@ class HasFieldAt (index :: Nat) a s | s index -> a where
7370 -- ^ Lens focusing on a field at a given index.
7471 -- Compatible with the lens package.
7572 --
76− -- @
77− -- type Lens' s a
78− -- = forall f. Functor f => (a -> f a) -> s -> f s
79− -- @
80− --
8173 -- >>> human & itemAt @1 .~ "Tamas"
8274 -- Human "Tamas" 50 "London"
8375 itemAt :: Lens' s a
src/Data/Generic/Record/Internal/Contains.hs+3−1
@@ -22,7 +22,9 @@
2222-- Look up fields in the generic representation
2323--
2424-----------------------------------------------------------------------------
25−module Data.Generic.Record.Internal.Contains where
25+module Data.Generic.Record.Internal.Contains
26+ ( Contains
27+ ) where
2628
2729import Data.Kind (Type)
2830import GHC.Generics