Skip to content

Syntax Widget: Content Overview #162

Open
@ryyppy

Description

@ryyppy

Last update: June 14th, 2024

We've got the Syntax Lookup Widget skeleton (#114 ) in place now, so we need content writers to cover quick glance overviews over each topic.

This issue is here to collect a list of language constructs we should definitely cover. Feel free to propose more topics if something is missing. I will continuously update this issue for completeness reasons.

How to work on this?

  • Check the list below (we regularly update it as soon as features get added) and pick some features you want to document
  • Check out the misc_data/syntax directory for structure and inspiration
  • Open a PR in draft mode (target master) as soon as possible, so other contributors see what's currently being worked on

Content Overview

Decorators:

  • @val
  • @module
  • @obj
  • @scope
  • @get
  • @get_index
  • @set
  • @set_index
  • @uncurry
  • @send
  • @string
  • @int
  • @unwrap
  • @new
  • @deriving
  • @as
  • @variadic
  • @inline
  • @meth
  • @return
  • @unboxed
  • @this
  • @@warning
  • @send.pipe (deprecated)
  • @genType
  • @react.component
  • @deprecated
  • @ignore
  • @tag

Operators:

  • ->
  • |>
  • ++
  • +, +.
  • -, -.
  • /, /.
  • *, *.
  • mod
  • := (ref value assignment)
  • :> (type coercion)
  • || boolean OR
  • && boolean AND
  • ! boolean NOT

Language Constructs:

  • _ (placeholder, all scenarios like pipe, ignore value)
  • type
  • let (let binding)
  • let \"\" (let binding with invalid identifier name) (Apparently not part of the language, although I strongly disagree not including it, because it's user-facing... see Document %external(\"SomeValue") #351)
  • if / else
  • external
  • () => {} (function)
  • (.) => {} (curried function)
  • open (also open!)
  • include (+ include module type of ...)
  • module
  • [ #value ] (polyvar definition)
  • switch (pattern matching: exceptions, values, variants, when clause..)
  • 'a (generic placeholder)
  • +'a (placeholder for covariance)
  • (Item: Comparable) => {} (module functor)
  • <MyComponent> (JSX)
  • "" (string)
  • j`` (implicit string interpolation) (deprecated)
  • `` (explicit string interpolation)
  • ' ' (single quote = char)
  • for loop
  • while loop
  • ~ labelled arguments
  • | or patterns
  • ?: ternary
  • ... (spread, all scenarios like array, list, record, polymorphic variant)

Type Specifics:

  • {.} (empty object type)
  • { "key": "value" } (Object type)
  • {..} (including type obj<'a> = {.. "a": string } as 'a) aka Open object type
  • ref (mutable type)
  • exception (exn)
  • module type
  • module type of (see playground link)

Builtin Functions:

  • ignore

Extension Points:

  • %%raw
  • %raw
  • %identity
  • %debugger
  • %re

Build System Specials:

  • __POS_OF__(string)
  • __LINE__
  • __LOC__
  • __FILE__
  • __LOC_OF__
  • __MODULE__
  • __LINE_OF__

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions