Revision 25d7b289 autotools/convert-constants

b/autotools/convert-constants
182 182

  
183 183
  # finally generate the output
184 184
  kv_pairs = ["(%s, %s)" % (k, v) for k, v in zip(key_v, val_v)]
185
  return ["-- | Converted from Python dictionary %s" % py_name,
185
  return ["-- | Converted from Python dictionary @%s@" % py_name,
186 186
          "%s :: [(%s, %s)]" % (hs_name, key_type, val_type),
187 187
          "%s = [%s]" % (hs_name, ", ".join(kv_pairs)),
188 188
          ]
......
220 220
  elif hs_typeval is not None:
221 221
    # this is a simple value
222 222
    (hs_type, hs_val) = hs_typeval
223
    lines.append("-- | Converted from Python constant %s" % fqn)
223
    lines.append("-- | Converted from Python constant @%s@" % fqn)
224 224
    lines.append("%s :: %s" % (hs_name, hs_type))
225 225
    lines.append("%s = %s" % (hs_name, hs_val))
226 226
  elif isinstance(value, dict):
......
245 245
    if compat.all(e is not None for e in tvs):
246 246
      ttypes = ", ".join(e[0] for e in tvs)
247 247
      tvals = FormatListElems(all_items, pfx_name, value, [e[1] for e in tvs])
248
      lines.append("-- | Converted from Python tuple %s" % fqn)
248
      lines.append("-- | Converted from Python tuple @%s@" % fqn)
249 249
      lines.append("%s :: (%s)" % (hs_name, ttypes))
250 250
      lines.append("%s = (%s)" % (hs_name, tvals))
251 251
    else:
......
264 264
      uniq_types = set(ttypes)
265 265
      if len(uniq_types) == 1:
266 266
        values = FormatListElems(all_items, pfx_name, value, tvals)
267
        lines.append("-- | Converted from Python list or set %s" % fqn)
267
        lines.append("-- | Converted from Python list or set @%s@" % fqn)
268 268
        lines.append("%s :: [%s]" % (hs_name, uniq_types.pop()))
269 269
        lines.append("%s = [%s]" % (hs_name, values))
270 270
      else:
......
274 274
  elif isinstance(value, RE_TYPE):
275 275
    tvs = HaskellTypeVal(value.pattern)
276 276
    assert tvs is not None
277
    lines.append("-- | Converted from Python RE object %s" % fqn)
277
    lines.append("-- | Converted from Python RE object @%s@" % fqn)
278 278
    lines.append("%s :: %s" % (hs_name, tvs[0]))
279 279
    lines.append("%s = %s" % (hs_name, tvs[1]))
280 280
  else:

Also available in: Unified diff