diff options
author | Profpatsch <mail@profpatsch.de> | 2023-08-06T10·46+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-08-06T11·17+0000 |
commit | 1fd59f51580244bac8e75b4c08f103daa20674d9 (patch) | |
tree | 701df9da2d8ff52f7c881e221b416472b0988be3 /users/Profpatsch/mailbox-org/src/AesonQQ.hs | |
parent | ce4acc08a53fca8bc00282ca0eb4ca5fc048a222 (diff) |
chore(users/Profpatsch): clean up haskell libs a little r/6464
Change-Id: Ia9a6c5a754ca8f2912308feb5a26f5276a08d24c Reviewed-on: https://cl.tvl.fyi/c/depot/+/9011 Reviewed-by: Profpatsch <mail@profpatsch.de> Autosubmit: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r-- | users/Profpatsch/mailbox-org/src/AesonQQ.hs (renamed from users/Profpatsch/mailbox-org/AesonQQ.hs) | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/users/Profpatsch/mailbox-org/AesonQQ.hs b/users/Profpatsch/mailbox-org/src/AesonQQ.hs index f12afdf515..2ac3d533ae 100644 --- a/users/Profpatsch/mailbox-org/AesonQQ.hs +++ b/users/Profpatsch/mailbox-org/src/AesonQQ.hs @@ -3,20 +3,21 @@ module AesonQQ where import Data.Aeson qualified as Json -import Data.Either qualified as Either +import Language.Haskell.TH.Quote (QuasiQuoter) import PossehlAnalyticsPrelude import PyF qualified import PyF.Internal.QQ qualified as PyFConf +aesonQQ :: QuasiQuoter aesonQQ = PyF.mkFormatter "aesonQQ" PyF.defaultConfig { PyFConf.delimiters = Just ('|', '|'), - PyFConf.postProcess = \exp -> do + PyFConf.postProcess = \exp_ -> do -- TODO: this does not throw an error at compilation time if the json does not parse [| - case Json.eitherDecodeStrict' @Json.Value $ textToBytesUtf8 $ stringToText $(exp) of + case Json.eitherDecodeStrict' @Json.Value $ textToBytesUtf8 $ stringToText $(exp_) of Left err -> error err Right a -> a |] |