You should read up on Agda. Its standard library [0] does all this.<p>[0] <a href="http:&#x2F;&#x2F;wiki.portal.chalmers.se&#x2F;agda&#x2F;pmwiki.php?n=Libraries.StandardLibrary" rel="nofollow">http:&#x2F;&#x2F;wiki.portal.chalmers.se&#x2F;agda&#x2F;pmwiki.php?n=Libraries.S...</a>