Currently definitions are produced in a sort arbitrary (or sorted) order. There seems to be a potential approach already implemented in https://github.com/input-output-hk/cuddle/blob/8c66e35ded04866ad477af0474a79d67392e74d6/example/Monad.hs#L17 We need to evaluate and see if this is the most ergonomic way to deal with this problem of defining custom order for definitions. If there is no better alternative way, then we can close this ticket and start switching to this approach in ledger