-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing Haskell macros in Hakaru language #96
Comments
The simplest way to deal with this is to inline the definition of each function in each file where it's needed. That would probably get tedious very quickly, so I agree we need something better. One solution is the Another possible solution is to expose already-typed terms (i.e. those in internal syntax, defined in Haskell) to the typechecker. A very basic implementation is here: a4c6c54, 271fc8f. Although, I'm not sure how useful this is in general. It also creates programs that don't look very nice:
|
I think if we want the other definitions, we should make an import
mechanism. @ccshan has some concerns about it being hygenic, so anybody
that wants to try it should talk to him first.
…On Fri, Jul 7, 2017 at 11:33 AM, yuriy0 ***@***.***> wrote:
The simplest way to deal with this is to inline the definition of each
function in each file where it's needed. That would probably get tedious
very quickly, so I agree we need something better.
One solution is the import mechanism, which has existed for a while, but
has never (?) been used. There was a discussion a while back where it was
concluded that the easiest to implement import mechanism is cpp, but for
testing purposes that requires calling cpp from Haskell, which doesn't
seem too nice to me. To this end, I've (re?)enabled the import mechanism,
as well as made it look in the same directory as the source file for the
imports (f313a8a
<f313a8a>).
Maybe if people use it, it will have cause to become more
elaborate/functional!
Another possible solution is to expose already-typed terms (i.e. those in
internal syntax, defined in Haskell) to the typechecker. A very basic
implementation is here: a4c6c54
<a4c6c54>,
271fc8f
<271fc8f>.
Although, I'm not sure how useful this is in general. It also creates
programs that don't look very nice:
$ echo "weibull(1,2)" | pretty -
(fn x2 prob:
fn x1 prob:
x0 <~ gamma(1/1, 1/1)
return x2 * x0 ** prob2real(1/ x1))
(nat2prob(1), nat2prob(2))
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAhUYtLfiL7rq13tzAK-VFLa-Ci1oUwks5sLk_egaJpZM4OP43w>
.
|
There are some distributions (e.g. Cauchy, Weibull, ...) that exist in the Haskell files, but are not part of the exposed Hakaru syntax. Could these be added so that they can be accessed in Hakaru concrete syntax programs?
The text was updated successfully, but these errors were encountered: