add tests for pmsort, pmerge and phalve

This commit is contained in:
fanghr 2022-05-14 19:21:33 +08:00
parent 9d34b63309
commit 06d4fcd428
No known key found for this signature in database
GPG key ID: 35CD9A71CD5D5870
3 changed files with 86 additions and 2 deletions

View file

@ -56,6 +56,8 @@ module Agora.Utils (
mustBePJust,
mustBePDJust,
validatorHashToAddress,
pmerge,
phalve,
) where
--------------------------------------------------------------------------------
@ -446,7 +448,7 @@ pmerge = phoistAcyclic $ pfix #$ plam pmerge'
pif
(comp # ah # bh)
(pcons # ah #$ self # comp # at # b)
(pcons # bh #$ self # comp # at # bt)
(pcons # bh #$ self # comp # a # bt)
-- | / O(nlogn) /. Merge sort, bottom-up version.
pmsort :: (PIsListLike l a) => Term s ((a :--> a :--> PBool) :--> l a :--> l a)