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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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