Skip to content

sortNub could be lazier Β #426

@treeowl

Description

@treeowl

Most other nubbing functions are as lazy as possible, but sortNub takes O(n log n) time to produce the first element when it can be done in O(n). I'd expect there to be a version that's lazier.

lazySortNub xs = [x | x : _ <- group (sort xs)]

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