Skip to content

ShowX produces invalid Haskell #1782

Description

@martijnbastiaan

This problem is two-fold. On the one hand, showX prints an "X" on undefined errors:

>>> printX @Int undefined
X
>>> printX @Int (errorX "abc")
X
>>> X
<Data constructor not in scope>

But, undefined is clearly not equal to X! So ideally this would look like:

>>> printX @Int undefined
undefined
>>> printX @Int (errorX "abc")
undefined
>>> undefined
<XException>

Like #1776, the Vec instance of ShowX yield invalid Haskell:

>>> printX @(Vec 2 Int) (1 :> 2 :> Nil)
<1,2>

Marked enhancement instead of bug as ShowX is a lawless class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions