morley-1.3.0: src/Util/Lens.hs
-- SPDX-FileCopyrightText: 2020 Tocqueville Group
--
-- SPDX-License-Identifier: LicenseRef-MIT-TQ
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
module Util.Lens
( postfixLFields
, makeLensesWith
) where
import Control.Lens (LensRules, lensField, lensRules, makeLensesWith, mappingNamer)
-- | For datatype with "myNyan" field it will create "myNyanL" lens.
postfixLFields :: LensRules
postfixLFields = lensRules & lensField .~ mappingNamer (\s -> [s++"L"])