From 4c67ea742a5633f8a43782ee81125565f7e08d6c Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 22 Apr 2014 17:17:26 +0200 Subject: [PATCH] Add lenses for OpCodes ...to simplify manipulation of them. Signed-off-by: Klaus Aehlig Reviewed-by: Petr Pudlak --- Makefile.am | 2 ++ src/Ganeti/OpCodes/Lens.hs | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/Ganeti/OpCodes/Lens.hs diff --git a/Makefile.am b/Makefile.am index a22c0539d..f2589e6d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -134,6 +134,7 @@ HS_DIRS = \ src/Ganeti/Monitoring \ src/Ganeti/Metad \ src/Ganeti/Objects \ + src/Ganeti/OpCodes \ src/Ganeti/Query \ src/Ganeti/Storage \ src/Ganeti/Storage/Diskstats \ @@ -801,6 +802,7 @@ HS_LIB_SRCS = \ src/Ganeti/Objects.hs \ src/Ganeti/Objects/Lens.hs \ src/Ganeti/OpCodes.hs \ + src/Ganeti/OpCodes/Lens.hs \ src/Ganeti/OpParams.hs \ src/Ganeti/Path.hs \ src/Ganeti/Parsers.hs \ diff --git a/src/Ganeti/OpCodes/Lens.hs b/src/Ganeti/OpCodes/Lens.hs new file mode 100644 index 000000000..15a16bd99 --- /dev/null +++ b/src/Ganeti/OpCodes/Lens.hs @@ -0,0 +1,35 @@ +{-# LANGUAGE TemplateHaskell #-} + +{-| Lenses for OpCodes + +-} + +{- + +Copyright (C) 2014 Google Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. + +-} + +module Ganeti.OpCodes.Lens where + +import Ganeti.Lens (makeCustomLenses) +import Ganeti.OpCodes + +$(makeCustomLenses ''MetaOpCode) +$(makeCustomLenses ''CommonOpParams) + -- GitLab