2015-02-22 21:25:57 +00:00
|
|
|
From b22a4d77c1262f77ce4298b53ca90a138a14ceb7 Mon Sep 17 00:00:00 2001
|
2015-02-22 19:22:24 +00:00
|
|
|
From: Joey Hess <joeyh@joeyh.name>
|
|
|
|
Date: Sun, 22 Feb 2015 15:21:19 -0400
|
|
|
|
Subject: [PATCH] stub out TH
|
2013-09-22 05:27:15 +00:00
|
|
|
|
2015-02-22 19:22:24 +00:00
|
|
|
this method avoids needing to delete the entire file contents, so patch is
|
|
|
|
kept minimal
|
2013-09-22 05:27:15 +00:00
|
|
|
---
|
2015-02-22 21:25:57 +00:00
|
|
|
Database/Persist/TH.hs | 1 +
|
|
|
|
persistent-template.cabal | 1 +
|
|
|
|
stub/Database/Persist/TH.hs | 21 +++++++++++++++++++++
|
|
|
|
3 files changed, 23 insertions(+)
|
2015-02-22 19:22:24 +00:00
|
|
|
create mode 100644 stub/Database/Persist/TH.hs
|
2013-09-22 05:27:15 +00:00
|
|
|
|
2015-02-22 21:25:57 +00:00
|
|
|
diff --git a/Database/Persist/TH.hs b/Database/Persist/TH.hs
|
|
|
|
index 43eb3ee..2172b77 100644
|
|
|
|
--- a/Database/Persist/TH.hs
|
|
|
|
+++ b/Database/Persist/TH.hs
|
|
|
|
@@ -35,6 +35,7 @@ module Database.Persist.TH
|
|
|
|
-- * Internal
|
|
|
|
, packPTH
|
|
|
|
, lensPTH
|
|
|
|
+ , plusPlus
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Prelude hiding ((++), take, concat, splitAt)
|
2013-09-22 05:27:15 +00:00
|
|
|
diff --git a/persistent-template.cabal b/persistent-template.cabal
|
2015-02-22 19:22:24 +00:00
|
|
|
index 59b4149..4705d97 100644
|
2013-09-22 05:27:15 +00:00
|
|
|
--- a/persistent-template.cabal
|
|
|
|
+++ b/persistent-template.cabal
|
2015-02-22 19:22:24 +00:00
|
|
|
@@ -30,6 +30,7 @@ library
|
2013-09-22 05:27:15 +00:00
|
|
|
ghc-options: -Wall
|
|
|
|
if impl(ghc >= 7.4)
|
|
|
|
cpp-options: -DGHC_7_4
|
2015-02-22 19:22:24 +00:00
|
|
|
+ hs-source-dirs: stub
|
|
|
|
|
|
|
|
test-suite test
|
|
|
|
type: exitcode-stdio-1.0
|
|
|
|
diff --git a/stub/Database/Persist/TH.hs b/stub/Database/Persist/TH.hs
|
|
|
|
new file mode 100644
|
2015-02-22 21:25:57 +00:00
|
|
|
index 0000000..dfbb874
|
2015-02-22 19:22:24 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/stub/Database/Persist/TH.hs
|
2015-02-22 21:25:57 +00:00
|
|
|
@@ -0,0 +1,21 @@
|
2015-02-22 19:22:24 +00:00
|
|
|
+{-# LANGUAGE RecordWildCards #-}
|
|
|
|
+{-# LANGUAGE CPP #-}
|
|
|
|
+{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
+{-# LANGUAGE RankNTypes #-}
|
|
|
|
+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-missing-fields #-}
|
|
|
|
+-- | This module provides utilities for creating backends. Regular users do not
|
|
|
|
+-- need to use this module.
|
|
|
|
+module Database.Persist.TH where
|
2015-02-22 21:25:57 +00:00
|
|
|
+
|
|
|
|
+import Data.Text
|
|
|
|
+
|
|
|
|
+type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t
|
|
|
|
+
|
|
|
|
+lensPTH :: (s -> a) -> (s -> b -> t) -> Lens s t a b
|
|
|
|
+lensPTH sa sbt afb s = fmap (sbt s) (afb $ sa s)
|
|
|
|
+
|
|
|
|
+packPTH :: String -> Text
|
|
|
|
+packPTH = pack
|
|
|
|
+#if !MIN_VERSION_text(0, 11, 2)
|
|
|
|
+{-# NOINLINE packPTH #-}
|
|
|
|
+#endif
|
2013-09-22 05:27:15 +00:00
|
|
|
--
|
2015-02-22 19:22:24 +00:00
|
|
|
2.1.4
|
2013-09-22 05:27:15 +00:00
|
|
|
|