Using lenses
Ben Gamari
bgamari.foss
Thu Oct 3 04:08:55 UTC 2013
Simon Peyton-Jones <simonpj at microsoft.com> writes:
> Friends
>
snip
>
> The use-case everyone starts with is nested records, but I'd like to go beyond that. The next levels seem to be:
>
> * Lenses as views of data that isn't "really there" e.g. regarding a record with rectangular coordinates as having polar coordinates too.
>
Along these lines, I've found lenses to be quite useful in providing a
means of peering into and modifying packed binary data structures and
bitfields. One example would be lines 50 - 100 of this module[1].
Cheers,
- Ben
[1] https://github.com/bgamari/hphoton/blob/master/hphoton-fpga-timetagger/HPhoton/FpgaTimetagger.hs#L50
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/libraries/attachments/20131003/86d15361/attachment.sig>
More information about the Libraries
mailing list