Safe Haskell | None |
---|---|
Language | Haskell98 |
A module for creating lenses to fields of simple, tuple data structures like pairs, triplets, and so on.
Documentation
data TupleConf
A tuple configuration is a scheme for tuple-like data structures.
makeTupleRefs :: TupleConf -> Int -> Int -> Q [Dec]
Creates Lens_1
... Lens_n
classes, and instances for tuples up to m
.
Classes and instances look like the following:
class Lens_1 s t a b | s -> a, t -> b , a t -> s, b s -> t where _1 :: Lens s t a b instance Lens_1 (a,b) (a',b) a a' where _1 = lens ((a,b) -> a) (a' (a,b) -> (a',b))