Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed linking

  • Loading branch information...
commit 0308c54e871403f0e81939b4585fe948c2dae9d8 1 parent 4fe8a15
Edward Kmett authored January 25, 2013

Showing 1 changed file with 38 additions and 32 deletions. Show diff stats Hide diff stats

  1. 70  src/Control/Lens/Internal/Exception.hs
70  src/Control/Lens/Internal/Exception.hs
@@ -47,76 +47,82 @@ import System.IO.Unsafe
47 47
 -- This lets us write combinators to build handlers that are agnostic about the choice of
48 48
 -- which of these they use.
49 49
 class Handleable e (m :: * -> *) (h :: * -> *) | h -> e m where
50  
-  -- | This builds a 'Handler' for just the targets of a given 'Prism' (or any 'Getter', really)
  50
+  -- | This builds a 'Handler' for just the targets of a given 'Control.Lens.Type.Prism' (or any 'Getter', really)
51 51
   --
52 52
   -- @
53  
-  -- ... `catches` [ 'handler' 'Control.Exception.Lens._AssertionFailed' (\s -> print $ "Assertion Failed\n" ++ s)
54  
-  --               , 'handler' 'Control.Exception.Lens._ErrorCall' (\s -> print $ "Error\n" ++ s)
55  
-  --               ]
  53
+  -- 'catches' ... [ 'handler' 'Control.Exception.Lens._AssertionFailed' (\s -> print $ "Assertion Failed\n" ++ s)
  54
+  --             , 'handler' 'Control.Exception.Lens._ErrorCall' (\s -> print $ "Error\n" ++ s)
  55
+  --             ]
56 56
   -- @
57 57
   --
58 58
   -- This works ith both the 'Exception.Handler' type provided by @Control.Exception@:
59 59
   --
60 60
   -- @
61  
-  -- 'handler' :: 'Getter'    'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
62  
-  -- 'handler' :: 'Prism'     'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
63  
-  -- 'handler' :: 'Lens'      'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
64  
-  -- 'handler' :: 'Traversal' 'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
  61
+  -- 'handler' :: 'Getter'     'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
  62
+  -- 'handler' :: 'Fold'       'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
  63
+  -- 'handler' :: 'Control.Lens.Prism.Prism''     'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
  64
+  -- 'handler' :: 'Control.Lens.Lens.Lens''      'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
  65
+  -- 'handler' :: 'Control.Lens.Traversal.Traversal'' 'SomeException' a -> (a -> 'IO' r) -> 'Exception.Handler' r
65 66
   -- @
66 67
   --
67 68
   -- and with the 'CatchIO.Handler' type provided by @Control.Monad.CatchIO@:
68 69
   --
69 70
   -- @
70  
-  -- 'handler' :: 'Getter'    'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
71  
-  -- 'handler' :: 'Prism'     'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
72  
-  -- 'handler' :: 'Lens'      'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
73  
-  -- 'handler' :: 'Traversal' 'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
  71
+  -- 'handler' :: 'Getter'     'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
  72
+  -- 'handler' :: 'Fold'       'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
  73
+  -- 'handler' :: 'Control.Lens.Prism.Prism''     'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
  74
+  -- 'handler' :: 'Control.Lens.Lens.Lens''      'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
  75
+  -- 'handler' :: 'Control.Lens.Traversal.Traversal'' 'SomeException' a -> (a -> m r) -> 'CatchIO.Handler' m r
74 76
   -- @
75 77
   --
76 78
   -- and with the 'Control.Monad.Error.Lens.Handler' type provided by @Control.Monad.Error.Lens@:
77 79
   --
78 80
   -- @
79  
-  -- 'handler' :: 'Getter'    e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
80  
-  -- 'handler' :: 'Prism'     e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
81  
-  -- 'handler' :: 'Lens'      e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
82  
-  -- 'handler' :: 'Traversal' e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
  81
+  -- 'handler' :: 'Getter'     e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
  82
+  -- 'handler' :: 'Fold'       e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
  83
+  -- 'handler' :: 'Control.Lens.Prism.Prism''     e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
  84
+  -- 'handler' :: 'Control.Lens.Lens.Lens''      e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
  85
+  -- 'handler' :: 'Control.Lens.Traversal.Traversal'' e a -> (a -> m r) -> 'Control.Monad.Error.Lens.Handler' e m r
83 86
   -- @
84 87
   handler :: Getting (First a) e t a b -> (a -> m r) -> h r
85 88
 
86  
-  -- | This builds a 'Handler' for just the targets of a given 'Prism' (or any 'Getter', really)
  89
+  -- | This builds a 'Handler' for just the targets of a given 'Control.Lens.Prism.Prism' (or any 'Getter', really)
87 90
   -- that ignores its input and just recovers with the stated monadic action.
88 91
   --
89 92
   -- @
90  
-  -- ... `catches` [ 'handler_' 'Control.Exception.Lens._NonTermination' ('return' "looped")
91  
-  --               , 'handler_' 'Control.Exception.Lens._StackOverflow' ('return' "overflow")
92  
-  --               ]
  93
+  -- 'catches' ... [ 'handler_' 'Control.Exception.Lens._NonTermination' ('return' "looped")
  94
+  --             , 'handler_' 'Control.Exception.Lens._StackOverflow' ('return' "overflow")
  95
+  --             ]
93 96
   -- @
94 97
   --
95 98
   -- This works with the 'Exception.Handler' type provided by @Control.Exception@:
96 99
   --
97 100
   -- @
98  
-  -- 'handler_' :: 'Getter'    'SomeException' a -> 'IO' r -> 'Exception.Handler' r
99  
-  -- 'handler_' :: 'Prism'     'SomeException' a -> 'IO' r -> 'Exception.Handler' r
100  
-  -- 'handler_' :: 'Lens'      'SomeException' a -> 'IO' r -> 'Exception.Handler' r
101  
-  -- 'handler_' :: 'Traversal' 'SomeException' a -> 'IO' r -> 'Exception.Handler' r
  101
+  -- 'handler_' :: 'Getter'     'SomeException' a -> 'IO' r -> 'Exception.Handler' r
  102
+  -- 'handler_' :: 'Fold'       'SomeException' a -> 'IO' r -> 'Exception.Handler' r
  103
+  -- 'handler_' :: 'Control.Lens.Prism.Prism''     'SomeException' a -> 'IO' r -> 'Exception.Handler' r
  104
+  -- 'handler_' :: 'Control.Lens.Lens.Lens''      'SomeException' a -> 'IO' r -> 'Exception.Handler' r
  105
+  -- 'handler_' :: 'Control.Lens.Traversal.Traversal'' 'SomeException' a -> 'IO' r -> 'Exception.Handler' r
102 106
   -- @
103 107
   --
104 108
   -- and with the 'CatchIO.Handler' type provided by @Control.Monad.CatchIO@:
105 109
   --
106 110
   -- @
107  
-  -- 'handler_' :: 'Getter'    'SomeException' a -> m r -> 'CatchIO.Handler' m r
108  
-  -- 'handler_' :: 'Prism'     'SomeException' a -> m r -> 'CatchIO.Handler' m r
109  
-  -- 'handler_' :: 'Lens'      'SomeException' a -> m r -> 'CatchIO.Handler' m r
110  
-  -- 'handler_' :: 'Traversal' 'SomeException' a -> m r -> 'CatchIO.Handler' m r
  111
+  -- 'handler_' :: 'Getter'     'SomeException' a -> m r -> 'CatchIO.Handler' m r
  112
+  -- 'handler_' :: 'Fold'       'SomeException' a -> m r -> 'CatchIO.Handler' m r
  113
+  -- 'handler_' :: 'Control.Lens.Prism.Prism''     'SomeException' a -> m r -> 'CatchIO.Handler' m r
  114
+  -- 'handler_' :: 'Control.Lens.Lens.Lens''      'SomeException' a -> m r -> 'CatchIO.Handler' m r
  115
+  -- 'handler_' :: 'Control.Lens.Traversal.Traversal'' 'SomeException' a -> m r -> 'CatchIO.Handler' m r
111 116
   -- @
112 117
   --
113 118
   -- and with the 'Control.Monad.Error.Lens.Handler' type provided by @Control.Monad.Error.Lens@:
114 119
   --
115 120
   -- @
116  
-  -- 'handler_' :: 'Getter'    e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
117  
-  -- 'handler_' :: 'Prism'     e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
118  
-  -- 'handler_' :: 'Lens'      e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
119  
-  -- 'handler_' :: 'Traversal' e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
  121
+  -- 'handler_' :: 'Getter'     e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
  122
+  -- 'handler_' :: 'Fold'       e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
  123
+  -- 'handler_' :: 'Control.Lens.Prism.Prism''     e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
  124
+  -- 'handler_' :: 'Control.Lens.Lens.Lens''      e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
  125
+  -- 'handler_' :: 'Control.Lens.Traversal.Traversal'' e a -> m r -> 'Control.Monad.Error.Lens.Handler' e m r
120 126
   -- @
121 127
   handler_ :: Getting (First a) e t a b -> m r -> h r
122 128
   handler_ l = handler l . const

0 notes on commit 0308c54

Please sign in to comment.
Something went wrong with that request. Please try again.