Implement reverse mapping of values to names
This adds a bit of dumb mapping of values to names, while trying to be safe. This is the best we can do without resorting to parsing or interpreting ASTs. The difference in the output is: -- | Converted from Python list or set ADMINST_ALL adminstAll :: [String] -adminstAll = ["down", "offline", "up"] +adminstAll = [adminstDown, adminstOffline, adminstUp] Since for most such values we use strings, we don't gain in type safety on the Haskell side. But it makes the output more readable and it might open up other opportunities later. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Please register or sign in to comment