Skip to content

Pattern match(es) are non-exhaustive In a lambda abstraction #10

@smaccoun

Description

@smaccoun

I'm getting the following warning when [-Wincomplete-uni-patterns] is turned on for the following function:

usernameRegex :: String -> Maybe ()
usernameRegex = [rex|^([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)$|]

The actual error is:

Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns not matched:
            []
            [_]
            [_, _]
            (_:_:_:_:_)

I'm not really sure how to go about accounting for those patterns. Any suggestions?

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