/
Lens.hs
92 lines (91 loc) · 2.75 KB
/
Lens.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
{-# LANGUAGE CPP #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE LiberalTypeSynonyms #-}
{-# LANGUAGE FlexibleContexts #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens
-- Copyright : (C) 2012 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : provisional
-- Portability : Rank2Types
--
-- Usage:
--
-- You can derive lenses automatically for many data types:
--
-- @
-- import Control.Lens
-- data Foo a = Foo { _fooArgs :: ['String'], _fooValue :: a }
-- 'makeLenses' ''Foo
-- @
--
-- This defines the following lenses:
--
-- @
-- fooArgs :: 'Simple' 'Lens' (Foo a) ['String']
-- fooValue :: 'Lens' (Foo a) (Foo b) a b
-- @
--
-- You can then access the value with ('^.') and set the value of the field
-- with ('.~') and can use almost any other combinator that is re-exported
-- here on those fields.
--
-- The combinators here have unusually specific type signatures, so for
-- particularly tricky ones, the simpler type signatures you might want to
-- pretend the combinators have are specified as well.
--
-- More information on how to use lenses is available on the lens wiki:
--
-- <http://github.com/ekmett/lens/wiki>
--
-- <<http://github.com/ekmett/lens/wiki/images/Hierarchy-2.8.png>>
----------------------------------------------------------------------------
module Control.Lens
( module Control.Lens.Type
, module Control.Lens.Traversal
, module Control.Lens.Getter
, module Control.Lens.Setter
, module Control.Lens.Action
, module Control.Lens.Combinators
, module Control.Lens.Fold
, module Control.Lens.Iso
, module Control.Lens.Indexed
, module Control.Lens.IndexedFold
, module Control.Lens.IndexedGetter
, module Control.Lens.IndexedLens
, module Control.Lens.IndexedTraversal
, module Control.Lens.IndexedSetter
, module Control.Lens.Plated
, module Control.Lens.Representable
#ifndef DISABLE_TEMPLATE_HASKELL
, module Control.Lens.TH
#endif
, module Control.Lens.Tuple
, module Control.Lens.WithIndex
, module Control.Lens.Zoom
) where
import Control.Lens.Action
import Control.Lens.Combinators
import Control.Lens.Fold
import Control.Lens.Getter
import Control.Lens.Indexed
import Control.Lens.IndexedFold
import Control.Lens.IndexedGetter
import Control.Lens.IndexedLens
import Control.Lens.IndexedSetter
import Control.Lens.IndexedTraversal
import Control.Lens.Iso
import Control.Lens.Plated
import Control.Lens.Representable
import Control.Lens.Setter
#ifndef DISABLE_TEMPLATE_HASKELL
import Control.Lens.TH
#endif
import Control.Lens.Traversal
import Control.Lens.Tuple
import Control.Lens.Type
import Control.Lens.WithIndex
import Control.Lens.Zoom