morley-1.16.3: src/Morley/Util/Lens.hs
-- SPDX-FileCopyrightText: 2021 Oxhead Alpha
-- SPDX-License-Identifier: LicenseRef-MIT-OA
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
module Morley.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"])