Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | hpacheco@di.uminho.pt |
Pointless Lenses: bidirectional lenses with point-free programming
More example involving composed maps.
- mapbang_hand :: Lens [Either [(Int, Char)] [(Bool, Char)]] [One]
- mapbang_pf :: Lens [Either [(Int, Char)] [(Bool, Char)]] [One]
- mapbang_opt :: Lens [Either [(Int, Char)] [(Bool, Char)]] [One]
- type Person = (Name, Gender)
- type Name = String
- data Gender
- innGender :: Either One One -> Gender
- outGender :: Gender -> Either One One
- outGender_lns :: Lens Gender (Either One One)
- women_hand :: Lens [Person] Nat
- women_pf :: Lens [Person] Nat
- women_opt :: Lens [Person] Nat
map ! . filter_left . map (map f -|- map g)
Persons (count the number of women)
women_hand :: Lens [Person] NatSource