[Ur] need help with unification and field name disjointness proof failures

Benjamin Barenblat bbaren at mit.edu
Thu Apr 6 16:52:19 EDT 2017


Your code assumes `oneOrNoRows` returns an `option {Username : string,
PasswordHash : string, Salt : option string}`. In actuality, you can
use `oneOrNoRows` to query multiple databases simultaneously, so it
puts results from each database into a record field. In this
particular example, it returns `option {User : {Username : string,
PasswordHash : string, Salt : option string}}` (because `User` is the
name of the database that you’re querying, transformed to be a field
name). If you are just querying one database, consider using
`oneOrNoRows1`, which returns the type that you want.

In addition, on your first TODO (‘use better crypto functions’), you
may be interested in my cryptographic random¹ and hash² libraries. I’d
be thrilled to incorporate patches for the latter if you want to add
more OpenSSL hash functions (PBKDF2 in particular would be extremely
welcome and probably quite applicable to your current work).

¹ https://benjamin.barenblat.name/git/urweb-crypto-random-openssl.git
² https://benjamin.barenblat.name/git/urweb-crypto-hash-openssl.git



More information about the Ur mailing list