The basic binary operations.
This commit is contained in:
@@ -7,6 +7,9 @@ module Gen(
|
||||
blank,
|
||||
out,
|
||||
wrapIndent,
|
||||
implFor,
|
||||
implFor',
|
||||
implFor'',
|
||||
)
|
||||
where
|
||||
|
||||
@@ -70,4 +73,16 @@ wrapIndent val middle =
|
||||
res <- indent middle
|
||||
tell (replicate (fromIntegral (indentAmount gs)) ' ')
|
||||
tell "}\n"
|
||||
return res
|
||||
return res
|
||||
|
||||
implFor :: String -> String -> Gen a -> Gen a
|
||||
implFor trait name middle =
|
||||
wrapIndent ("impl " ++ trait ++ " for " ++ name) middle
|
||||
|
||||
implFor' :: String -> String -> Gen a -> Gen a
|
||||
implFor' trait name middle =
|
||||
wrapIndent ("impl<'a> " ++ trait ++ " for " ++ name) middle
|
||||
|
||||
implFor'' :: String -> String -> Gen a -> Gen a
|
||||
implFor'' trait name middle =
|
||||
wrapIndent ("impl<'a,'b> " ++ trait ++ " for " ++ name) middle
|
||||
Reference in New Issue
Block a user