Do you miss null references from your old imperative programming days? Wish that the worlds best imperative language had null references? Now your wishes have come true with the new partial-lens package!

partial-lens augment edwardk's data-lens package with partial lens. Partial lenses are like regular lenses but have the possibility of not referencing anything. In other words, null references are possible. One notable different with null references from this package is that you can set them without getting a run-time error. Instead setting a null reference is a no-op; however it is possible to determine if setting failed from the return value of the assignment operation.

Actually I don't have any applications for partial lenses myself, so if you find this library useful, please let me know. I wrote this mostly because we know what partial lenses are in theory (they are the coalgebras of the (Identity :+: Store b) comonad) but I wanted to see what a real library would look like.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to