« Previous | Next » 

Revision 79a04823


Added by Iustin Pop about 12 years ago

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 <>
Reviewed-by: Michael Hanselmann <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences