Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • LIGO LIGO
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 172
    • Issues 172
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ligolang
  • LIGOLIGO
  • Merge requests
  • !1489

Use `ppx_woo` with `ppx_import 1.9.0`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged E. Rivas requested to merge er433/ppx/woo2 into dev Jan 14, 2022
  • Overview 0
  • Commits 50
  • Pipelines 23
  • Changes 48

This MR introduces the usage of ppx_woo in combinators for the different ASTs we have.

ppx_woo is a deriving ppx by GA (used in GAML) which generate get/is/constructors/etc. for types we write.

Generally, we adapt it to our types as follows:

type expression_content = [%import: Types.expression_content]
[@@deriving ez {
      prefixes = [
        ("make_e" , fun ?(location = Location.generated) expression_content type_expression ->
                  ({ expression_content ; location ; type_expression } : expression)) ;
        ("get" , fun x -> x.expression_content) ;
        ("get_type" , fun x -> x.type_expression) ;
      ] ;
      wrap_constructor = ("expression_content" , make_e) ;
      wrap_get = ("expression_content" , get) ;
    } ]

This will provide us of things such as get_e_application_opt, get_e_application_exn, is_e_application, e_application, etc. to manipulate terms of type expression.

After applying this, a "major" combinator change is done:

(get_)t_function is removed. Instead, we use the derived (get_)t_arrow.

  • has a changelog entry
Edited Jan 20, 2022 by E. Rivas
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: er433/ppx/woo2