lenses 0.1.2 → 0.1.3
raw patch · 2 files changed
+8/−6 lines, 2 files
Files
- lenses.cabal +2/−1
- src/Data/Lenses.hs +6/−5
lenses.cabal view
@@ -1,7 +1,8 @@ Name: lenses-Version: 0.1.2+Version: 0.1.3 Author: Job Vranish Maintainer: jvranish@gmail.com+Homepage: http://github.com/jvranish/Lenses/tree/master License: BSD3 License-file: LICENSE category: Data
src/Data/Lenses.hs view
@@ -2,7 +2,7 @@ {- | This modules provides a convienient way to access and update the elements of a structure.-It is very similar to "Data.Accessors", but a bit more generic and has fewer dependencies.+It is very similar to Data.Accessors, but a bit more generic and has fewer dependencies. I particularly like how cleanly it handles nested structures in state monads. 'runSTLense' is also a very useful function. @@ -128,8 +128,8 @@ Or say we want to put the value of c_y into a_x, but want to throw an error if c_y is zero. We can do that as well! -> updatdeTriangle :: Either String Triangle-> updatdeTriangle = execInT someTriangle $ do+> updatedTriangle :: Either String Triangle+> updatedTriangle = execInT someTriangle $ do > cy <- c_y get > when (cy == 0) $ throwError "Something bad happend" > a_x $ put cy@@ -152,9 +152,10 @@ and nothing appears to be wrong with your code, try turning the restriction off with -XNoMonomorphismRestriction and see if it goes away. If it does then you probably need to add some explicit type signatures somewhere. -I whipped out this documentation in a hurry, so if you spot any errors, or think I should explain something better, /please/ let me know.+I whipped out this documentation in a hurry, so if you spot any errors, or think I should explain something better, /please/ let me know. This library is hosted on github (click on the /Contents/ link above and you should see the Homepage link) so it should be very easy to forked it and send patches to me. Also since this module is new I'm open to radical modifications if you have a good suggestion, so suggest away! :) + -} module Data.Lenses (@@ -410,7 +411,7 @@ See 'to' for example of use. -}-from :: (Traversable t) => (forall s. t (State a b -> s) -> t s) -> t a -> t a+from :: (Traversable t, Traversable f) => (forall s. t (State a b -> s) -> f s) -> t a -> t a from f x = snd $ runSTLense f x