Skip to content

[Thinking] Possible Improper code #11

Description

@Sorrow-Scarlet

The Example 1 for F# has a small problem:

CODE:

let GiveMeTheLength(input) =
    // this is a 1-line comment
    let result = input.Length
    (* this is a multi-line comment *)
    result

While F# do provide you with type inference, .Length method is not available for non-restrain generic type input

Proper one:

let GiveMeTheLength(input:string) =
    // this is a 1-line comment
    let result = input.Length
    (* this is a multi-line comment *)
    result

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions