Skip to content

Irrelevant instance predicate NonNull for List, Vec, ... #2092

Closed
@jamesmckinna

Description

@jamesmckinna

Proposal: we already have in Data.List.Base

null : List A  Bool
null [] = true
null _ = false

so is it time to add (cf. #1538 etc.)

NonNull : List A  Set _
NonNull = T ∘ not ∘ null

etc.
with eg

instance
  nonNull⇒nonZero[length] : {{ _ : NonNull xs }}  NonZero (length xs)
  nonNull⇒nonZero[length] {xs = _ ∷ _} = _

etc.
together with some structure proxying for the type class for having a null method and a NonNull predicate... etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions