Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

RFC: Nested record definitions

$
0
0

Would it be possible to have indexed access types to alias nested types directly? They are well proved on typescript nested record access

type options = {
  startFrom: float,
  persist?: {
    fileName: string,
    path?: string,
    fileConfig?: {
      extension?: string
    }
  }
}

// alias for \"options.persist\"
type persistAlias = options["persist"]

// alias for \"options.persist.fileConfig\"
type fileConfigAlias = options["persist"]["fileConfig"]


Viewing all articles
Browse latest Browse all 2592

Trending Articles