Why isn't Ordering an instance of Show in DAML?
App Development3 posts768 views13 likesLast activity Aug 2020
GY
gyorgybalazsiOP
Aug 2020If 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)))
CO
cocreature
Aug 2020Hi @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.
CO
cocreature
Aug 2020The 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.