Skip to content

Strange :help output for newtypes and enums #1605

@RyanGlScott

Description

@RyanGlScott

Given this Cryptol file:

newtype T a = { unT : a }

If you type :help T at the REPL, you'll get:

Main> :help T

newtype T a
    T : {a} {unT : a} -> T a
            ---------
Name defined in module Main

This is unsatisfactory for a couple of reasons:

  1. The :help output doesn't state the kind of T. This is inconsistent with how :help displays other type constructors, e.g.,

    Main> :help Z
    
    primitive type Z : # -> *
    
  2. The pretty-printed definition of T "re-quantifies" a, as it displays both newtype T a and T : {a} {unT : a} -> T a. Really, the a in newtype T a ought to scope over the type of T so that it is displayed like this:

    newtype T a =
      T { unT : a}
    

The same issues apply to enums (#1602) as well.

Metadata

Metadata

Assignees

Labels

bugSomething not working correctlycommand-line-replRelated to Cryptol's text-based UIenumsIssues related to enums

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions