Remove uses of CPP from the generator, and bump dependency requirements.

Also fixes some long lines in QMetaObject.hs.
parent 18b5f50f
......@@ -2,6 +2,10 @@
## Unreleased
- Removed uses of CPP from qtah-generator, except for Setup.hs. This bumps
minimum version requirements to base >= 4.8.0 (GHC 8.0) and mtl >= 2.2.1, both
of which have been available for over two years.
## (2018-06-05) *-0.5.0
Thanks to Yuriy Syrovetskiy, Maxim Koltsov, and Paul Tsupikoff for contributions
......
......@@ -37,14 +37,14 @@ library
executable qtah-generator
build-depends:
base >=4 && <5
base >=4.8 && <5
, containers >=0.5 && <0.6
, directory >=1.2 && <1.4
, filepath >=1.3 && <1.5
, hoppy-generator >=0.5 && <0.6
, hoppy-std >=0.5 && <0.6
, haskell-src >=1.0 && <1.1
, mtl >=2.1 && <2.3
, mtl >=2.2.1 && <2.3
, process >=1.2 && <1.7
, transformers >=0.3 && <0.6
hs-source-dirs: src
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
-- | General routines.
module Graphics.UI.Qtah.Generator.Common (
splitOn,
......@@ -26,9 +24,6 @@ module Graphics.UI.Qtah.Generator.Common (
writeFileIfDifferent,
) where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.Exception (evaluate)
import Control.Monad (when)
import Control.Monad.Trans.Maybe (MaybeT (MaybeT), runMaybeT)
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QByteArray (
aModule,
c_QByteArray,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
indent,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QChar (
aModule,
c_QChar,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
-- | Bindings for @QList@.
module Graphics.UI.Qtah.Generator.Interface.Core.QList (
-- * Template
......@@ -40,9 +38,6 @@ module Graphics.UI.Qtah.Generator.Interface.Core.QList (
) where
import Control.Monad (forM_, when)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat, mempty)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
Generator,
HsTypeSide (HsHsSide),
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QMargins (
aModule,
c_QMargins,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -71,20 +71,20 @@ c_QMetaObject =
, mkConstMethod "enumerator" [intT] $ objT c_QMetaEnum
, mkConstMethod "enumeratorCount" [] intT
, mkConstMethod "enumeratorOffset" [] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfClassInfo") "indexOfClassInfo" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfConstructor") "indexOfConstructor" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfEnumerator") "indexOfEnumerator" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfMethod") "indexOfMethod" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfProperty") "indexOfProperty" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfSignal") "indexOfSignal" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfSlot") "indexOfSlot" MConst Nonpure
[objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfClassInfo") "indexOfClassInfo"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfConstructor") "indexOfConstructor"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfEnumerator") "indexOfEnumerator"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfMethod") "indexOfMethod"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfProperty") "indexOfProperty"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfSignal") "indexOfSignal"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, makeFnMethod (ident2 "qtah" "qmetaobject" "indexOfSlot") "indexOfSlot"
MConst Nonpure [objT c_QMetaObject, objT c_QString] intT
, mkConstMethod "inherits" [ptrT $ constT $ objT c_QMetaObject] boolT
, mkConstMethod "method" [intT] $ objT c_QMetaMethod
, mkConstMethod "methodCount" [] intT
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QPoint (
aModule,
c_QPoint,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QPointF (
aModule,
c_QPointF,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QRect (
aModule,
c_QRect,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QSize (
aModule,
c_QSize,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QString (
aModule,
c_QString,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
sayLn,
......
......@@ -15,16 +15,11 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QStringList (
aModule,
c_QStringList,
) where
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
indent,
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Core.QTextCodec (
aModule,
c_QTextCodec,
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
-- | Bindings for @QVector@.
module Graphics.UI.Qtah.Generator.Interface.Core.QVector (
-- * Template
......@@ -32,9 +30,6 @@ module Graphics.UI.Qtah.Generator.Interface.Core.QVector (
) where
import Control.Monad (forM_, when)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat, mempty)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
HsTypeSide (HsHsSide),
addImports,
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Interface.Gui.QColor (
aModule,
c_QColor,
......@@ -24,9 +22,6 @@ module Graphics.UI.Qtah.Generator.Interface.Gui.QColor (
) where
import Control.Monad (forM_)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Haskell (
addImports,
indent,
......
......@@ -15,8 +15,6 @@
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
{-# LANGUAGE CPP #-}
module Graphics.UI.Qtah.Generator.Module (
AModule (..),
aModuleHoppyModules,
......@@ -29,18 +27,12 @@ module Graphics.UI.Qtah.Generator.Module (
) where
import Control.Monad (unless)
#if MIN_VERSION_mtl(2,2,1)
import Control.Monad.Except (throwError)
#else
import Control.Monad.Error (throwError)
#endif
import Data.Char (toLower)
import Data.Foldable (forM_)
import Data.List (find, intersperse, sort)
import Data.Maybe (isJust, mapMaybe)
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (mconcat)
#endif
import Foreign.Hoppy.Generator.Language.Cpp (execChunkWriter, sayType)
import Foreign.Hoppy.Generator.Language.Haskell (
Generator,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment