From 3853a32259738c384b6f2445fee2aa13dc1a8dfb Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Wed, 12 Dec 2018 17:04:23 -0500 Subject: [PATCH] added lenses to PWPolicy --- src/Password.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Password.hs b/src/Password.hs index 965efb6..1a7b34e 100644 --- a/src/Password.hs +++ b/src/Password.hs @@ -22,11 +22,18 @@ License along with this program. If not, see -} +{-# LANGUAGE TemplateHaskell #-} + module Password ( -- * Data Types - PWPolicy (..) + PWPolicy (..), + -- ** Lenses + -- $lenses + pwLength, pwUpper, pwLower, pwDigits, pwSpecial ) where +import Control.Lens (makeLenses) + -- | defines a password policy data PWPolicy = PWPolicy { _pwLength :: Int @@ -42,4 +49,11 @@ data PWPolicy = PWPolicy -- if @"Nothing"@) } deriving (Eq, Show) +-- $lenses The following functions are automatically generated by +-- @makeLenses@. See the +-- [lens](http://hackage.haskell.org/package/lens) package for further +-- details. + +makeLenses ''PWPolicy + --jl