Move FileDriver from Objects to Types
[ganeti-local] / htools / Ganeti / Compat.hs
1 {-# LANGUAGE CPP #-}
2
3 {- | Compatibility helper module.
4
5 This module holds definitions that help with supporting multiple
6 library versions or transitions between versions.
7
8 -}
9
10 {-
11
12 Copyright (C) 2011, 2012 Google Inc.
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22 General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 02110-1301, USA.
28
29 -}
30
31 module Ganeti.Compat
32   ( rwhnf
33   , Control.Parallel.Strategies.parMap
34   ) where
35
36 import qualified Control.Parallel.Strategies
37
38 -- | Wrapper over the function exported from
39 -- "Control.Parallel.Strategies".
40 --
41 -- This wraps either the old or the new name of the function,
42 -- depending on the detected library version.
43 rwhnf :: Control.Parallel.Strategies.Strategy a
44 #ifdef PARALLEL3
45 rwhnf = Control.Parallel.Strategies.rseq
46 #else
47 rwhnf = Control.Parallel.Strategies.rwhnf
48 #endif