fram-lang / fram-lang/dbl

Other kinds of abstract definitions

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
0. parsing 1. type inference
Dominant language
OCaml
Stars
45
Forks
28
PR merge metrics
No merged PRs in 30d

Description

The `abstr` visibility mode for types means that the type is public, but constructors (values) are not. The `abstr` with the same semantics would be useful for other kinds of definitions. A motivating example is to create a global handler with public effect, but private capability that is used for defining other useful function. For instance, consider the following implementation of logging, assuming that `hState` is a library defined handler for state (btw, we have not such handler yet).
```fram
abstr handle logger / Log with hState

pub let log msg =
logger := msg :: logger.get ()

...
```
Here, the `Log` effect should be public, but the capability `logger` should be private.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.