Skip to content

Conversation

@nwokafor-choongsaeng
Copy link
Contributor

Terms

THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE TERMS OF THE CCLA DATED 2017-11-07 WITH FINOS/LINUX FOUNDATION (FORMERLY THE SYMPHONY SOFTWARE FOUNDATION CCLA).

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

@AttilaMihaly AttilaMihaly requested a review from Copilot July 24, 2025 17:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR provides a comprehensive specification for the TypeScript backend, establishing detailed guidelines for translating Elm types and constructs to TypeScript. The changes expand the documentation to include complete type mapping specifications and rename sections for better clarity.

  • Restructures documentation with clearer section headings (Type Definitions vs Types, etc.)
  • Adds comprehensive type expression mappings for variables, references, tuples, records, functions, and intrinsic types
  • Provides detailed mapping table for Morphir SDK types to TypeScript equivalents

return { name, age }
}
// an additional function matching the name of the type
function Foo(a: string, b: number): Foo = {a, b}
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TypeScript function syntax is incorrect. It should use arrow function syntax => {a, b} or traditional function syntax with return {a, b}.

Suggested change
function Foo(a: string, b: number): Foo = {a, b}
function Foo(a: string, b: number): Foo {
return { a, b };
}

Copilot uses AI. Check for mistakes.
### Extensible records
Extensible records are records that specify known fields with the ability of have other undeclared fields in them.
The most appropraite translation of an extensible record is an intersection of record types, and this is how we map them.
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: 'appropraite' should be 'appropriate'.

Suggested change
The most appropraite translation of an extensible record is an intersection of record types, and this is how we map them.
The most appropriate translation of an extensible record is an intersection of record types, and this is how we map them.

Copilot uses AI. Check for mistakes.
```
Basic types should be mapped to their corresponding types in typescript
### Instrinsic Types
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: 'Instrinsic' should be 'Intrinsic'.

Suggested change
### Instrinsic Types
### Intrinsic Types

Copilot uses AI. Check for mistakes.
can be conveniently translated to
```typescript
type alias Foo<A> = ...
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TypeScript doesn't use the 'alias' keyword for type definitions. This should be 'type Foo = ...'.

Suggested change
type alias Foo<A> = ...
type Foo<A> = ...

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant