[m-users.] Announcement: mercury-rmath library

Mark Clements (gmail) samuel.legotus at gmail.com
Mon Aug 23 16:44:53 AEST 2021


A first implementation of the mercury-rmath library is available on 
GitHub (https://github.com/mclements/mercury-rmath). This provides an 
interface to the standalone R math library, which provides some 
mathematical and statistical functions. In keeping with R's licence, I 
have used a GPL licence.

The random number functions are marked as being impure. Note that the 
random seed is managed opaquely from C. I have tried -- unsuccessfully 
-- to wrap these functions using IO state:

:- pred wrapped_runif(float::in, float::in, float::out, io::di, io::uo).
wrapped_runif(Lower, Upper, U, !IO) :- U = runif(Lower,Upper).

Do I also need to make a promise?

This is my first Mercury library, so I would expect some rough edges:). 
Comments on the package are welcome.

-- Mark



More information about the users mailing list