[Haskell-cafe] ANNOUNCE: partial-lens 0.0.1

roconnor at theorem.ca roconnor at theorem.ca
Wed Dec 21 04:54:47 CET 2011


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.''



More information about the Haskell-Cafe mailing list