CCA 0.1.5.2 → 0.1.5.3
raw patch · 4 files changed
+84/−6 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CCA.cabal +1/−1
- Changelog +49/−0
- preprocessor/State.hs +12/−2
- src/Language/Haskell/TH/Instances.hs +22/−3
CCA.cabal view
@@ -1,5 +1,5 @@ Name: CCA-Version: 0.1.5.2+Version: 0.1.5.3 Cabal-Version: >= 1.6 Build-Type: Simple License: BSD3
Changelog view
@@ -1,3 +1,52 @@+commit fa6eeb086fb5330fed17d5d87626bb5f3ab5c0d8+Author: Paul H. Liu <paul@thev.net>+Date: Thu May 7 20:05:34 2015 -0700++ Bump version to 0.1.5.3++commit 4c2a396a4f7e1589c37049e03bedc414ce7a745c+Merge: 31801f2 633e991+Author: Paul H. Liu <paul@thev.net>+Date: Mon May 4 11:42:41 2015 -0700++ Merge branch 'alex-segura-master'++commit 633e99109df45083de835a2a95bff9f64b50b600+Author: Paul H. Liu <paul@thev.net>+Date: Mon May 4 11:42:19 2015 -0700++ Import Control.Applicative just in case++commit 11d39c28d510b7385c08f260da9dc0c5e0199ef4+Author: Alex Segura <alex.segura@droitfintech.com>+Date: Sun May 3 13:37:58 2015 -0400++ Conditionals for TH version 2.10.0.0 compatibility++commit fd94207ca583d5dc0cbc34ebd71d6a24525660c6+Author: Alex Segura <alex.segura@droitfintech.com>+Date: Sun May 3 13:37:39 2015 -0400++ Functor and applicative instances for State++commit 31801f274b1ad1d568ff6d0c6c3f31bd38e4210d+Author: Paul H. Liu <paul@thev.net>+Date: Sat Jan 31 20:54:45 2015 -0800++ Bump version to 0.1.5.2 to repack for hackage++commit be97a355398da2972d48e35a58277b7bc2e81ad3+Author: Paul H. Liu <paul@thev.net>+Date: Wed Jan 14 14:30:00 2015 -0800++ Bump version to 0.1.5.1++commit 1f378c1bedb1775e68a150e0e8eea54ef24a1a4d+Author: Paul H. Liu <paul@thev.net>+Date: Wed Jan 14 14:29:28 2015 -0800++ Add happy in build-tools+ commit 720b4d1c753837d30c968e4ae885905da4ebc702 Author: Paul H. Liu <paul@thev.net> Date: Tue Sep 16 21:06:35 2014 -0700
preprocessor/State.hs view
@@ -2,11 +2,21 @@ module State(State, runState, get, put) where +import Control.Applicative+import Control.Monad (ap, liftM)+ newtype State s a = State { runState :: s -> (a, s) } +instance Functor (State s) where+ fmap = liftM++instance Applicative (State s) where+ pure = return+ (<*>) = ap+ instance Monad (State s) where- return x = State (\n -> (x, n))- State v >>= f = State (\n -> let (x, n') = v n in runState (f x) n')+ return x = State (\n -> (x, n))+ State v >>= f = State (\n -> let (x, n') = v n in runState (f x) n') get :: State s s get = State (\s -> (s, s))
src/Language/Haskell/TH/Instances.hs view
@@ -7,7 +7,7 @@ import Language.Haskell.TH.Syntax instance Lift a => Lift (Q a) where- lift x = x >>= \x -> [| return x |] + lift x = x >>= \x -> [| return x |] instance Lift Exp where lift (VarE name) = [|VarE name|]@@ -44,10 +44,14 @@ instance Lift PkgName where lift = lift . pkgString +#if ! MIN_VERSION_template_haskell(2,10,0)+ instance Lift Pred where lift (ClassP n ts) = [|ClassP n ts|] lift (EqualP t t2) = [|EqualP t t2|] +#endif+ #if MIN_VERSION_template_haskell(2,8,0) instance Lift Kind where@@ -74,13 +78,26 @@ #endif +#if MIN_VERSION_template_haskell(2,10,0)+ instance Lift NameFlavour where lift NameS = [|NameS|] lift (NameQ n) = [|NameQ n|]+ lift (NameU i) = [|NameU (fromInt i)|]+ lift (NameL i) = [|NameL (fromInt i)|]+ lift (NameG n p m) = [|NameG n p m|]++#else++instance Lift NameFlavour where+ lift NameS = [|NameS|]+ lift (NameQ n) = [|NameQ n|] lift (NameU i) = let i' = I# i in [|NameU (fromInt i')|] lift (NameL i) = let i' = I# i in [|NameL (fromInt i')|] lift (NameG n p m) = [|NameG n p m|] +#endif+ instance Lift Range where lift (FromR e) = [|FromR e|] lift (FromThenR e1 e2) = [|FromThenR e1 e2|]@@ -187,12 +204,14 @@ lift (CCall) = [|CCall|] lift (StdCall) = [|StdCall|] +#if ! MIN_VERSION_template_haskell(2,10,0)+ instance Lift Rational where lift r = let n = numerator r d = denominator r in [|n % d|] instance Lift Double where- lift d = [| D# $(return (LitE (DoublePrimL (toRational d)))) |] + lift d = [| D# $(return (LitE (DoublePrimL (toRational d)))) |] - +#endif