Skip to content
Snippets Groups Projects
Commit 79a04823 authored by Iustin Pop's avatar Iustin Pop
Browse files

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: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 09dc9a02
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment