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
|
{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
module Text.OPML.Lens (module Text.OPML.Lens) where
-- {{{ Imports
import Lens.Simple
import Text.OPML.Types
-- }}}
-- * 'Opml' lenses
makeLensesFor
[ ("opmlVersion", "opmlVersionL")
, ("opmlHead", "opmlHeadL")
, ("opmlOutlines", "opmlOutlinesL")
] ''Opml
-- * 'OpmlHead' lenses
makeLensesFor
[ ("opmlTitle", "opmlTitleL")
, ("opmlCreated", "opmlCreatedL")
, ("modified", "modifiedL")
, ("ownerName", "ownerNameL")
, ("ownerEmail", "ownerEmailL")
, ("ownerId", "ownerIdL")
, ("docs", "docsL")
-- , ("expansionState", "expansionStateL")
, ("vertScrollState", "vertScrollStateL")
, ("windowBottom", "windowBottomL")
, ("windowLeft", "windowLeftL")
, ("windowRight", "windowRightL")
, ("windowTop", "windowTopL")
] ''OpmlHead
expansionStateL :: Traversal' OpmlHead Int
expansionStateL inj a@OpmlHead { expansionState = es } = (\x -> a { expansionState = x }) <$> traverse inj es
{-# INLINE expansionStateL #-}
-- * 'OutlineSubscription' lenses
makeLensesFor
[ ("xmlUri", "xmlUriL")
, ("htmlUri", "htmlUriL")
, ("description", "descriptionL")
, ("language", "languageL")
, ("subscriptionTitle", "subscriptionTitleL")
, ("subscriptionVersion", "subscriptionVersionL")
] ''OutlineSubscription
-- * 'OutlineBase' lenses
makeLensesFor
[ ("text", "textL")
, ("isComment", "isCommentL")
, ("isBreakpoint", "isBreakpointL")
, ("outlineCreated", "outlineCreatedL")
, ("categories", "categoriesL")
] ''OutlineBase
-- * 'OpmlOutline' traversals
makeTraversals ''OpmlOutline
|