Skip to content
CCPEDIAby Unity Nodes
App Development

Why isn't Ordering an instance of Show in DAML?

3 posts781 views13 likesLast activity Aug 2020

  1. gyorgybalazsiOP 4

    If I try to use ordering in the DAML REPL, I get the following error message:

    daml> compare (1,2) (1,3)
    File:     Line17.daml
    Hidden:   no
    Range:    9:10-9:38
    Source:   typecheck
    Severity: DsError
    Message: 
      Line17.daml:9:11: error:
      • No instance for (Show Ordering) arising from a use of ‘show’
      • In the first argument of ‘return’, namely
      ‘(show (compare (1, 2) (1, 3)))’
      In the expression: return (show (compare (1, 2) (1, 3)))
      In an equation for ‘expr’:
      expr _ _ _ _ x _ _ parties _ steps _ _ _ _ chain _ _
      = return (show (compare (1, 2) (1, 3)))
    
  2. cocreature 5

    Hi @gyorgybalazsi,
    Good catch! I believe we just missed adding one. I’ve added the instance in Add a Show instance for Ordering by cocreature · Pull Request #7068 · digital-asset/daml · GitHub.

  3. cocreature 4

    The PR has been merged so this will be included in the next snapshot release. Note that this will be a snapshot for 1.5. 1.4 has already been frozen.