diff --git a/Makefile b/Makefile index b1b1e77b9..f0858243a 100644 --- a/Makefile +++ b/Makefile @@ -101,25 +101,27 @@ PATCHLEVEL:=$(shell git describe --long | awk -F - '{print $$2}') # build flags WARNINGS:=-W -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-name-shadowing #-fwarn-orphans -fwarn-simple-patterns -fwarn-monomorphism-restriction -# Language extensions similar to the ones enabled by yesod in hledger-web.cabal, -# so that we can do full dev builds of hledger-web. Warning, they are not -# exactly the same, in particular NoImplicitPrelude is not enabled since -# hledger and hledger-lib won't build with that. So don't rely on the dev -# build to show all compilation warnings and errors, do a cabal build as well. + +# For ghc-only dev builds of hledger-web: enable the language +# extensions specified in hledger-web.cabal, except for some which are +# not compatible with hledger-lib and hledger, or little-used; those +# are enabled with source file pragmas instead. Note: compilation +# warnings and errors might differ between ghc-only and cabal builds. WEBLANGEXTS:=\ - -XTemplateHaskell \ - -XQuasiQuotes \ -XCPP \ -XMultiParamTypeClasses \ - -XTypeFamilies \ - -XGADTs \ - -XGeneralizedNewtypeDeriving \ - -XFlexibleContexts \ - -XEmptyDataDecls \ -XOverloadedStrings \ - -XRecordWildCards -# -XNoImplicitPrelude + -XQuasiQuotes \ + -XRecordWildCards \ + -XTemplateHaskell \ +# -XNoImplicitPrelude \ +# -XTypeFamilies \ +# -XGADTs \ +# -XGeneralizedNewtypeDeriving \ +# -XFlexibleContexts \ +# -XEmptyDataDecls \ # -XNoMonomorphismRestriction + PREFERMACUSRLIBFLAGS=-L/usr/lib GHCMEMFLAGS= #+RTS -M200m -RTS CABALMACROSFLAGS=-optP-include -optPhledger/dist/build/autogen/cabal_macros.h @@ -171,7 +173,7 @@ auto-%: sp $(AUTOBUILD) $(MAIN) -o bin/hledgerdev $(AUTOBUILDFLAGS) --run $* autoweb: sp link-web-dirs - $(AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $(AUTOBUILDFLAGS) $(WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f test.journal + $(AUTOBUILD) hledger-web/app/main.hs -o bin/hledger-webdev $(AUTOBUILDFLAGS) $(WEBLANGEXTS) --run -B --port 5001 --base-url http://localhost:5001 -f webtest.j link-web-dirs: config messages static templates diff --git a/hledger-lib/Hledger/Read/CsvReader.hs b/hledger-lib/Hledger/Read/CsvReader.hs index a5d6ca0cb..afbe53fec 100644 --- a/hledger-lib/Hledger/Read/CsvReader.hs +++ b/hledger-lib/Hledger/Read/CsvReader.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE ScopedTypeVariables #-} {-| A reader for CSV data, using an extra rules file to help interpret the data. diff --git a/hledger-web/Foundation.hs b/hledger-web/Foundation.hs index e79fcaaf7..0e29b6b09 100644 --- a/hledger-web/Foundation.hs +++ b/hledger-web/Foundation.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} {- Define the web application's foundation, in the usual Yesod style. diff --git a/hledger-web/Hledger/Web/Options.hs b/hledger-web/Hledger/Web/Options.hs index 2682648da..9a34ed16c 100644 --- a/hledger-web/Hledger/Web/Options.hs +++ b/hledger-web/Hledger/Web/Options.hs @@ -1,8 +1,3 @@ -{-# LANGUAGE TemplateHaskell, CPP #-} -{-| - --} - module Hledger.Web.Options where import Prelude diff --git a/hledger-web/hledger-web.cabal b/hledger-web/hledger-web.cabal index f0b4031cc..21b55b63f 100644 --- a/hledger-web/hledger-web.cabal +++ b/hledger-web/hledger-web.cabal @@ -72,19 +72,21 @@ library ghc-options: -Wall -fno-warn-unused-do-bind - extensions: TemplateHaskell - QuasiQuotes - OverloadedStrings - NoImplicitPrelude + extensions: CPP MultiParamTypeClasses - TypeFamilies - GADTs - GeneralizedNewtypeDeriving - FlexibleContexts - EmptyDataDecls - NoMonomorphismRestriction + NoImplicitPrelude + OverloadedStrings + QuasiQuotes RecordWildCards + TemplateHaskell + TypeFamilies + -- seem to not be needed at present: + -- GADTs + -- GeneralizedNewtypeDeriving + -- FlexibleContexts + -- EmptyDataDecls + -- NoMonomorphismRestriction hs-source-dirs: . app exposed-modules: Application @@ -167,15 +169,15 @@ executable hledger-web else ghc-options: -O2 - extensions: TemplateHaskell - QuasiQuotes - OverloadedStrings - NoImplicitPrelude + extensions: CPP - OverloadedStrings MultiParamTypeClasses - TypeFamilies + NoImplicitPrelude + OverloadedStrings + QuasiQuotes RecordWildCards + TemplateHaskell + TypeFamilies hs-source-dirs: . app main-is: main.hs