on master help sign in
Fix up documentation spacing.
e6300f1Will Jones
src/Data/Generics/Product/Any.hs+13−13
@@ -21,9 +21,9 @@
21-----------------------------------------------------------------------------
21-----------------------------------------------------------------------------
22
22
23module Data.Generics.Product.Any
23module Data.Generics.Product.Any
24− ( -- * Lenses
24+ ( -- *Lenses
25 --
25 --
26− -- $example
26+ -- $example
27 HasAny (..)
27 HasAny (..)
28 ) where
28 ) where
29
29
@@ -50,19 +50,19 @@ import Data.Generics.Product.Typed
50-- human = Human \"Tunyasz\" 50 \"London\"
50-- human = Human \"Tunyasz\" 50 \"London\"
51-- @
51-- @
52
52
53−-- | Records that have generic lenses.
53+-- |Records that have generic lenses.
54class HasAny (sel :: k) a s | s sel k -> a where
54class HasAny (sel :: k) a s | s sel k -> a where
55− -- | A lens that focuses on a part of a product as identified by some
55+ -- |A lens that focuses on a part of a product as identified by some
56− -- selector. Currently supported selectors are field names, positions and
56+ -- selector. Currently supported selectors are field names, positions and
57− -- unique types. Compatible with the lens package's 'Control.Lens.Lens'
57+ -- unique types. Compatible with the lens package's 'Control.Lens.Lens'
58− -- type.
58+ -- type.
59 --
59 --
60− -- >>> human ^. its @Int
60+ -- >>> human ^. its @Int
61− -- 50
61+ -- 50
62− -- >>> human ^. its @"name"
62+ -- >>> human ^. its @"name"
63− -- "Tunyasz"
63+ -- "Tunyasz"
64− -- >>> human ^. its @3
64+ -- >>> human ^. its @3
65− -- "London"
65+ -- "London"
66 its :: Lens' s a
66 its :: Lens' s a
67
67
68instance HasPosition i a s => HasAny i a s where
68instance HasPosition i a s => HasAny i a s where
src/Data/Generics/Product/Fields.hs+11−11
@@ -24,12 +24,12 @@
24-----------------------------------------------------------------------------
24-----------------------------------------------------------------------------
25
25
26module Data.Generics.Product.Fields
26module Data.Generics.Product.Fields
27− ( -- * Lenses
27+ ( -- *Lenses
28 --
28 --
29− -- $example
29+ -- $example
30 HasField (..)
30 HasField (..)
31
31
32− -- * Internals
32+ -- *Internals
33 , GHasField (..)
33 , GHasField (..)
34 ) where
34 ) where
35
35
@@ -60,13 +60,13 @@ import GHC.TypeLits
60
60
61-- | Records that have a field with a given name.
61-- | Records that have a field with a given name.
62class HasField (field :: Symbol) a s | s field -> a where
62class HasField (field :: Symbol) a s | s field -> a where
63− -- | A lens that focuses on a field with a given name. Compatible with the
63+ -- |A lens that focuses on a field with a given name. Compatible with the
64− -- lens package's 'Control.Lens.Lens' type.
64+ -- lens package's 'Control.Lens.Lens' type.
65 --
65 --
66− -- >>> human ^. field @"age"
66+ -- >>> human ^. field @"age"
67− -- 50
67+ -- 50
68− -- >>> human & field @"name" .~ "Tamas"
68+ -- >>> human & field @"name" .~ "Tamas"
69− -- Human {name = "Tamas", age = 50, address = "London"}
69+ -- Human {name = "Tamas", age = 50, address = "London"}
70 field :: Lens' s a
70 field :: Lens' s a
71
71
72instance (Generic s,
72instance (Generic s,
@@ -91,8 +91,8 @@ type family ErrorUnlessJust (field :: Symbol) (s :: Type) (found :: Maybe Type)
91 ErrorUnlessJust _ _ ('Just _)
91 ErrorUnlessJust _ _ ('Just _)
92 = ()
92 = ()
93
93
94−-- | As 'HasField' but over generic representations as defined by
94+-- |As 'HasField' but over generic representations as defined by
95−-- "GHC.Generics".
95+-- "GHC.Generics".
96class GHasField (field :: Symbol) (f :: Type -> Type) a | field f -> a where
96class GHasField (field :: Symbol) (f :: Type -> Type) a | field f -> a where
97 gfield :: Lens' (f x) a
97 gfield :: Lens' (f x) a
98
98
src/Data/Generics/Product/Numbered.hs+13−13
@@ -24,12 +24,12 @@
24-----------------------------------------------------------------------------
24-----------------------------------------------------------------------------
25
25
26module Data.Generics.Product.Numbered
26module Data.Generics.Product.Numbered
27− ( -- * Lenses
27+ ( -- *Lenses
28 --
28 --
29− -- $example
29+ -- $example
30 HasPosition (..)
30 HasPosition (..)
31
31
32− -- * Internals
32+ -- *Internals
33 , GHasPosition (..)
33 , GHasPosition (..)
34 ) where
34 ) where
35
35
@@ -57,18 +57,18 @@ import GHC.TypeLits
57-- human = Human \"Tunyasz\" 50 \"London\"
57-- human = Human \"Tunyasz\" 50 \"London\"
58-- @
58-- @
59
59
60−-- | Records that have a field at a given position.
60+-- |Records that have a field at a given position.
61class HasPosition (i :: Nat) a s | s i -> a where
61class HasPosition (i :: Nat) a s | s i -> a where
62− -- | A lens that focuses on a field at a given position. Compatible with the
62+ -- |A lens that focuses on a field at a given position. Compatible with the
63− -- lens package's 'Control.Lens.Lens' type.
63+ -- lens package's 'Control.Lens.Lens' type.
64 --
64 --
65− -- >>> human ^. numbered @1
65+ -- >>> human ^. numbered @1
66− -- "Tunyasz"
66+ -- "Tunyasz"
67− -- >>> human & numbered @2 .~ "Berlin"
67+ -- >>> human & numbered @2 .~ "Berlin"
68− -- Human {name = "Tunyasz", age = 50, address = "Berlin"}
68+ -- Human {name = "Tunyasz", age = 50, address = "Berlin"}
69 numbered :: Lens' s a
69 numbered :: Lens' s a
70
70
71−-- | The base index from which positions are counted.
71+-- |The base index from which positions are counted.
72type BaseIndex
72type BaseIndex
73 = 1
73 = 1
74
74
@@ -94,8 +94,8 @@ type family ErrorUnlessTrue (i :: Nat) (s :: Type) (hasP :: Bool) :: Constraint
94 ErrorUnlessTrue _ _ 'True
94 ErrorUnlessTrue _ _ 'True
95 = ()
95 = ()
96
96
97−-- | As 'HasPosition' but over generic representations as defined by
97+-- |As 'HasPosition' but over generic representations as defined by
98−-- "GHC.Generics".
98+-- "GHC.Generics".
99class GHasPosition (offset :: Nat) (i :: Nat) (f :: Type -> Type) a | offset i f -> a where
99class GHasPosition (offset :: Nat) (i :: Nat) (f :: Type -> Type) a | offset i f -> a where
100 gnumbered :: Lens' (f x) a
100 gnumbered :: Lens' (f x) a
101
101
src/Data/Generics/Product/Typed.hs+9−9
@@ -24,12 +24,12 @@
24-----------------------------------------------------------------------------
24-----------------------------------------------------------------------------
25
25
26module Data.Generics.Product.Typed
26module Data.Generics.Product.Typed
27− ( -- * Lenses
27+ ( -- *Lenses
28 --
28 --
29− -- $example
29+ -- $example
30 HasType (..)
30 HasType (..)
31
31
32− -- * Internals
32+ -- *Internals
33 , GHasType (..)
33 , GHasType (..)
34 ) where
34 ) where
35
35
@@ -60,11 +60,11 @@ import GHC.TypeLits
60
60
61-- | Records that have a field with a unique type.
61-- | Records that have a field with a unique type.
62class HasType a s where
62class HasType a s where
63− -- | A lens that focuses on a field with a unique type in its parent type.
63+ -- |A lens that focuses on a field with a unique type in its parent type.
64− -- Compatible with the lens package's 'Control.Lens.Lens' type.
64+ -- Compatible with the lens package's 'Control.Lens.Lens' type.
65 --
65 --
66− -- >>> human ^. @typed Int
66+ -- >>> human ^. @typed Int
67− -- 50
67+ -- 50
68 typed :: Lens' s a
68 typed :: Lens' s a
69
69
70instance (Generic s,
70instance (Generic s,
@@ -97,8 +97,8 @@ type family ErrorUnlessOne (a :: Type) (s :: Type) (count :: Count) :: Constrain
97 ErrorUnlessOne _ _ 'One
97 ErrorUnlessOne _ _ 'One
98 = ()
98 = ()
99
99
100−-- | As 'HasType' but over generic representations as defined by
100+-- |As 'HasType' but over generic representations as defined by
101−-- "GHC.Generics".
101+-- "GHC.Generics".
102class GHasType (f :: Type -> Type) a where
102class GHasType (f :: Type -> Type) a where
103 gtyped :: Lens' (f x) a
103 gtyped :: Lens' (f x) a
104
104