Versionbump: Type of ConP changed
This commit is contained in:
parent
5fce01ef40
commit
df89d4a379
@ -111,6 +111,9 @@ afterN n = do
|
|||||||
deriveShowWith :: (String -> String) -> Name -> Q [Dec]
|
deriveShowWith :: (String -> String) -> Name -> Q [Dec]
|
||||||
deriveShowWith = deriveSimpleWith ''Show 'show
|
deriveShowWith = deriveSimpleWith ''Show 'show
|
||||||
|
|
||||||
|
unitTypeOut :: () -> ()
|
||||||
|
unitTypeOut = id
|
||||||
|
|
||||||
deriveSimpleWith :: Name -> Name -> (String -> String) -> Name -> Q [Dec]
|
deriveSimpleWith :: Name -> Name -> (String -> String) -> Name -> Q [Dec]
|
||||||
deriveSimpleWith cls fun strOp ty = do
|
deriveSimpleWith cls fun strOp ty = do
|
||||||
(TyConI tyCon) <- reify ty
|
(TyConI tyCon) <- reify ty
|
||||||
@ -125,7 +128,7 @@ deriveSimpleWith cls fun strOp ty = do
|
|||||||
|
|
||||||
genClause :: Con -> Q Clause
|
genClause :: Con -> Q Clause
|
||||||
genClause (NormalC name []) =
|
genClause (NormalC name []) =
|
||||||
let pats = [ConP name []]
|
let pats = [ConP name [] []]
|
||||||
body = NormalB $ LitE $ StringL $ strOp $ nameBase name
|
body = NormalB $ LitE $ StringL $ strOp $ nameBase name
|
||||||
in return $ Clause pats body []
|
in return $ Clause pats body []
|
||||||
genClause _ = fail "deriveShowTheme: constructors not allowed to have arguments"
|
genClause _ = fail "deriveShowTheme: constructors not allowed to have arguments"
|
||||||
|
|||||||
Reference in New Issue
Block a user