Skip to content

diamond: Unspecified behavior on invalid input #626

Closed
@rbasso

Description

@rbasso

The type signature for diamond...

diamond :: Char -> [String]

... demands the user to either:

  • Implement a partial function.
  • Define a behavior when the input isn't in ['A'..'Z'].

It should probably be changed to...

diamond :: Char -> Maybe [String]

... making it total and also signalling invalid input in a more idiomatic way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions