Commit 383e7eab authored by Petr Pudlak's avatar Petr Pudlak

THH: Add a helper for computing ssconf constructor names

Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent b3a4bb9a
......@@ -73,6 +73,7 @@ module Ganeti.THH ( declareSADT
, buildParam
, genException
, excErrMsg
, ssconfConstructorName
) where
import Control.Arrow ((&&&), second)
......@@ -1547,3 +1548,7 @@ genLoadExc tname sname opdefs = do
let clause2 = Clause [VarP arg_else] (NormalB fail_type) []
sigt <- [t| JSON.JSValue -> JSON.Result $(conT tname) |]
return $ (SigD fname sigt, FunD fname [clause1, clause2])
-- | Compute the ssconf constructor name from its file name.
ssconfConstructorName :: String -> String
ssconfConstructorName = camelCase . ("s_s_" ++)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment