reasonml / reasonml/reason

[LOWPRI] Unify class "instance types" with anonymous object types.

Open
#42 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

KIND: FEATURE REQUEST Parser
Dominant language
OCaml
Stars
10.3k
Forks
438
PR merge metrics
No merged PRs in 30d

Description

There is a totally different syntax for anonymous object types and class instance types:
(Ptyp_object and Pcty_sig respectively). One is used to define types of object without knowing their classes, and the other is to define the return value of a constructor ("instance types"). They are unified by the type system seamlessly, but their type definitions use a different syntax.
I'm in the middle of sending out a parser update that improves them independently but they are not unified yet. There's no reason why they can't be unified, as the Ptyp_object syntactically only includes methods, whereas Pcty_sig includes that and much more. Just one more thing that unnecessarily gives objects a bad reputation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the parser update mentioned in the issue and the definitions of Ptyp_object and Pcty_sig. Determine how their syntax can be unified while preserving anonymous object types and constructor instance types; done means both use the unified syntax and the type system continues to handle them seamlessly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.