(
)
where
+import Control.Applicative hiding (empty)
import Data.Ascii (Ascii)
import qualified Data.Ascii as A
import Data.ByteString (ByteString)
import Prelude.Unicode
instance Lift ByteString where
- lift bs = [| Strict.pack $(litE $ stringL $ Strict.unpack bs) |]
+ lift bs = [| Strict.pack $(litE ∘ stringL $ Strict.unpack bs) |]
instance Lift Lazy.ByteString where
lift = Lazy.foldrChunks f [| Lazy.Empty |]
lift s = [| CI.mk $(lift $ CI.original s) |]
instance Lift Text where
- lift t = [| T.pack $(litE $ stringL $ T.unpack t) |]
+ lift t = [| T.pack $(litE ∘ stringL $ T.unpack t) |]
instance (Lift k, Lift v, Collection c (k, v)) ⇒ Lift c where
lift c
| null c = [| empty |]
| otherwise = [| fromList $(liftPairs (fromFoldable c)) |]
where
- liftPairs = listE ∘ map liftPair
+ liftPairs = listE ∘ (liftPair <$>)
liftPair (k, v) = tupE [lift k, lift v]
instance Lift UTCTime where
lift dt = [| fromRational ($n % $d) ∷ DiffTime |]
where
n, d ∷ Q Exp
- n = lift $ numerator $ toRational dt
- d = lift $ denominator $ toRational dt
+ n = lift ∘ numerator $ toRational dt
+ d = lift ∘ denominator $ toRational dt