Skip to content
  • Iustin Pop's avatar
    Implement reverse mapping of values to names · 79a04823
    Iustin Pop authored
    
    
    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>
    79a04823