on master help sign in
Doc fixup
f489011Csongor Kiss
LICENSE+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2016, Csongor Kiss
1+Copyright (c) 2017, Csongor Kiss
2
2
3All rights reserved.
3All rights reserved.
4
4
src/Data/Generic/Product/HasFieldAt.hs+17−25
@@ -13,32 +13,14 @@
13-----------------------------------------------------------------------------
13-----------------------------------------------------------------------------
14-- |
14-- |
15-- Module : Data.Generic.Product.HasFieldAt
15-- Module : Data.Generic.Product.HasFieldAt
16−-- Copyright : (C) 2017 Toby Shaw
16+-- Copyright : (C) 2017 Csongor Kiss
17-- License : BSD3
17-- License : BSD3
18−-- Maintainer : Toby Shaw <toby.shaw.96@gmail.com>
18+-- Maintainer : Csongor Kiss <kiss.csongor.kiss@gmail.com>
19-- Stability : experimental
19-- Stability : experimental
20-- Portability : non-portable
20-- Portability : non-portable
21--
21--
22-- Derive product items lenses generically.
22-- Derive product items lenses generically.
23--
23--
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
42-- @
24-- @
43--
25--
44-- module Example where
26-- module Example where
@@ -53,6 +35,21 @@ import GHC.Generics
53-- human = Human \"Tunyasz\" 50 \"London\"
35-- human = Human \"Tunyasz\" 50 \"London\"
54--
36--
55-- @
37-- @
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
56
53
57-- | Get positional field
54-- | Get positional field
58--
55--
@@ -73,11 +70,6 @@ class HasFieldAt (index :: Nat) a s | s index -> a where
73 -- ^ Lens focusing on a field at a given index.
70 -- ^ Lens focusing on a field at a given index.
74 -- Compatible with the lens package.
71 -- Compatible with the lens package.
75 --
72 --
76− -- @
77− -- type Lens' s a
78− -- = forall f. Functor f => (a -> f a) -> s -> f s
79− -- @
80− --
81 -- >>> human & itemAt @1 .~ "Tamas"
73 -- >>> human & itemAt @1 .~ "Tamas"
82 -- Human "Tamas" 50 "London"
74 -- Human "Tamas" 50 "London"
83 itemAt :: Lens' s a
75 itemAt :: Lens' s a
src/Data/Generic/Record/Internal/Contains.hs+3−1
@@ -22,7 +22,9 @@
22-- Look up fields in the generic representation
22-- Look up fields in the generic representation
23--
23--
24-----------------------------------------------------------------------------
24-----------------------------------------------------------------------------
25−module Data.Generic.Record.Internal.Contains where
25+module Data.Generic.Record.Internal.Contains
26+ ( Contains
27+ ) where
26
28
27import Data.Kind (Type)
29import Data.Kind (Type)
28import GHC.Generics
30import GHC.Generics