Skip to content

First class handlers from handing functions #331

@ppolesiuk

Description

@ppolesiuk

It would be nice to allow defining first class handlers by providing handling function. We agreed (more-less) on the following syntax:

handlerfn
  <def₁> ... <defₙ>
  in
  <expr_cap>
  return <pat_r> => <expr_r>
  finally <pat_f> => <expr_f>
end

The return and finally clauses are optional. The meaning of such a code is a first class handler that realizes the following handling function:

fn run =>
  let <pat_f> =
    <def₁> ... <defₙ>
    let <pat_r> = run <expr_cap>
    in
    <expr_r>
  in
  <expr_f>

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. parsingThings related to lexer and parser1. type inferenceType inference and the Unif language2. effect inferenceEffect inference and the ConE language

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions