Skip to content

Docs typecheck blocks cannot support elements with same name in one Doc #3140

Open
@rlmark

Description

Docs typecheck blocks containing elements named the same but with different implementations render only first implementation.

This comes up when documenting different examples of how to write a given expression. In one doc element you may reference a term which happens to have the same name across examples.

(example term attached here because transcript parser is struggling with triple backticks).

fundamentals.abilities.exercises.ex1 : Doc
fundamentals.abilities.exercises.ex1 =
  use Map get
  {{
  Given the type signatures below, implement the functions to satisfy the
  compiler using the request operations of the Ability or functions found in
  ''.base''

  @typecheck ```
  getWithAbort : a -> Map a b ->{Abort} b
  g`etWithAbort key map = base.todo "implement me!"
  ```

  @typecheck ```
    getWithAbort : a -> Map a b ->{Abort} b
    getWithAbort key map = toAbort (get key map)
  ```


  @typecheck ```
    getWithAbort : a -> Map a b ->{Abort} b
    getWithAbort key map =
      match get key map with
        Some a -> a
        None   -> abort
  ```
  }}

Here's what it shows up as on the website:
image

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions