Safe Haskell | None |
---|---|
Language | Haskell98 |
Minimal redefine + re-export of a lens package, fclabels currently. in addition providing some of the instances for datatypes defined in the remainder of the uhc-util package.
- type (:->) f o = Lens Total f o
- type Lens a b = a :-> b
- (^*) :: (a :-> b) -> (b :-> c) -> a :-> c
- (^.) :: a -> (a :-> b) -> b
- (^=) :: (a :-> b) -> b -> a -> a
- (^$=) :: (a :-> b) -> (b -> b) -> a -> a
- (=.) :: MonadState f m => Lens (->) f o -> (o -> o) -> m ()
- (=:) :: MonadState f m => Lens (->) f o -> o -> m ()
- (=$:) :: MonadState f m => (f :-> o) -> (o -> o) -> m ()
- getl :: MonadState f m => (f :-> o) -> m o
- focus :: (MonadState a m, MonadState b m) => (a :-> b) -> m c -> m c
- mkLabel :: Name -> Q [Dec]
- isoMb :: String -> (f :-> Maybe o) -> f :-> o
- isoMbWithDefault :: o -> (f :-> Maybe o) -> f :-> o
Documentation
Access
(=.) :: MonadState f m => Lens (->) f o -> (o -> o) -> m () infixr 2
Alias for modify
that reads more or less like an assignment.
(=:) :: MonadState f m => Lens (->) f o -> o -> m () infixr 2
Alias for puts
that reads like an assignment.
(=$:) :: MonadState f m => (f :-> o) -> (o -> o) -> m () infixr 4 Source
monadic modify & set
getl :: MonadState f m => (f :-> o) -> m o Source
Alias for gets
avoiding conflict with MonadState
Misc
focus :: (MonadState a m, MonadState b m) => (a :-> b) -> m c -> m c Source
Derive labels including type signatures for all the record selectors in a single datatype. The types will be polymorphic and can be used in an arbitrary context.
Wrappers
isoMb :: String -> (f :-> Maybe o) -> f :-> o Source
Wrapper around a Maybe with an embedded panic in case of Nothing, with a panic message
isoMbWithDefault :: o -> (f :-> Maybe o) -> f :-> o Source
Wrapper around a Maybe with a default in case of Nothing