-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | BSON lenses
--   
--   Lenses for Data.Bson
@package bson-lens
@version 0.1.1

module Data.Bson.Lens
_Float :: Prism' Value Double
_String :: Prism' Value Text
_Doc :: Prism' Value Document
_Array :: Prism' Value [Value]
_Bin :: Prism' Value Binary
_Fun :: Prism' Value Function
_Uuid :: Prism' Value UUID
_Md5 :: Prism' Value MD5
_UserDef :: Prism' Value UserDefined
_ObjId :: Prism' Value ObjectId
_Bool :: Prism' Value Bool
_UTC :: Prism' Value UTCTime
_Null :: Prism' Value ()
_RegEx :: Prism' Value Regex
_JavaScr :: Prism' Value Javascript
_Sym :: Prism' Value Symbol
_Int32 :: Prism' Value Int32
_Int64 :: Prism' Value Int64

-- | Like <a>ix</a>, but for <a>Document</a> values with Text indices
--   
--   <pre>
--   &gt;&gt;&gt; ["someKey" := Float 3.0] ^? key "someKey"
--   Just 3.0
--   </pre>
key :: AsDocument t => Label -> Traversal' t Value

-- | An indexed Traversal into Array elements
--   
--   <pre>
--   &gt;&gt;&gt; Array [String "hey", Float 2.0] ^.. values
--   ["hey", 2.0]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; "Array [Float 2.0,Float 3.0,Float 4.0]" &amp; values . _Float *~ 2.0
--   "[4.0,6.0,8.0]"
--   </pre>
values :: AsValue v => IndexedTraversal' Int v Value

-- | An indexed Traversal into Document fields
--   
--   <pre>
--   &gt;&gt;&gt; Array [Doc ["doc1" := Float 3.0], Doc ["doc2" := Bool True]] ^.. values . fields
--   [ key: 3.0, key2: True ]
--   </pre>
fields :: AsDocument v => IndexedTraversal' Int v Field

-- | A Traversal into Document values
--   
--   <pre>
--   &gt;&gt;&gt; ["key" := Float 3.0, "key2" := Bool True] &amp; members . _Float *~ 2
--   [ key: 6.0, key2: True ]
--   </pre>
members :: AsDocument v => Traversal' v Value

-- | Like <a>ix</a>, but for Arrays with Int indexes
--   
--   <pre>
--   &gt;&gt;&gt; "Array [Float 1.0, Float 2.0, Float 3.0]" ^? nth 1
--   Just 2.0
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; "Array [Float 1.0, Float 2.0, Float 3.0]" &amp; nth 1 .~ Float 20.0
--   "[1.0,20.0,3.0]"
--   </pre>
nth :: AsValue v => Int -> Traversal' v Value

-- | A Traversal into Document keys
--   
--   <pre>
--   &gt;&gt;&gt; ["key" := Float 3.0, "key2" := Bool True] &amp; labels %~ Data.Text.toUpper
--   ["KEY": 3.0, "KEY2": True]
--   </pre>
labels :: AsDocument v => Traversal' v Label
class AsValue t

-- | A traversal for types that contain <a>Value</a>s
--   
--   <pre>
--   &gt;&gt;&gt; ("key" .= Bool True) ^? _Value
--   Just True
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Doc ["key" .= Bool True] ^? _Value
--   Just [ key: True]
--   </pre>
_Value :: AsValue t => Traversal' t Value
class AsDocument t

-- | A traversal for types that contain documents
--   
--   <pre>
--   &gt;&gt;&gt; ["key" .= Bool True] ^? _Document
--   Just [ key: True]
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; Doc ["key" .= Bool True] ^? _Document
--   Just [ key: True]
--   </pre>
_Document :: AsDocument t => Traversal' t Document
instance Control.Lens.At.Ixed Data.Bson.Lens.IndexedDocument
instance Data.Bson.Lens.AsValue Data.Bson.Value
instance Data.Bson.Lens.AsValue Data.Bson.Field
instance Data.Bson.Lens.AsDocument Data.Bson.Value
instance Data.Bson.Lens.AsDocument Data.Bson.Document
instance Data.Bson.Lens.AsDocument Data.Bson.Javascript
