morley-0.4.0: src/Util/Lens.hs
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
module Util.Lens
( postfixLFields
, makeLensesWith
, unwrappedP
) where
import Control.Lens (LensRules, Wrapped(..), lensField, lensRules, makeLensesWith, mappingNamer)
-- | For datatype with "myNyan" field it will create "myNyanL" lens.
postfixLFields :: LensRules
postfixLFields = lensRules & lensField .~ mappingNamer (\s -> [s++"L"])
unwrappedP :: Wrapped a => Proxy a -> Proxy (Unwrapped a)
unwrappedP _ = Proxy