Bluefin represents effects at the value level. Should I call these value level parameters “handles” (their current name) or “capabilities” (a name for a similar concept used elsewhere in programming laguage design)?
My effect system Bluefin works by passing the ability to perform effects at the value level rather than at the type level (via constraints) which is the more common pattern. For example, to run IO actions in a Bluefin operation you use IOE and pass it into your operation like this
-- Bluefin
fooBf :: e <: es => IOE e -> Eff es r
This contrasts with effectful and mtl style, where you would use a constraint:
-- effectful
fooEf :: IOE :> es => Eff es r
-- mtl
fooMt :: MonadIO m => m r
On the other hand, passing state at the value level already has prior art in Haskell: ST:
-- ST
stateSt :: STRef Int s -> ST s r
-- Bluefin
stateBf :: e <: es => State Int e -> Eff es r
-- effectful
stateEf :: State Int :> es => Eff es r
-- mtl
stateMt :: MonadState Int m => m r
Since the concept of passing these things at value level is essential to Bluefin I’d like to use the clearest name. Currently I call them handles because that is the name used for “file handles” and in “the handle pattern”. But that name is pretty generic and perhaps it doesn’t communicate precisely enough. There is another name for this concept, “capability”. I believe it is generally used in a security context, as in “capability-based security”, but the concept itself is broader.
Does anyone have any opinions on whether “handle” or “capability” communicates this concept more clearly? If “capability” has strong support then I’ll change the nomenclature in Bluefin.