Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettier type printing #1181

Open
alex-s168 opened this issue Jan 27, 2025 · 1 comment
Open

prettier type printing #1181

alex-s168 opened this issue Jan 27, 2025 · 1 comment
Assignees

Comments

@alex-s168
Copy link
Contributor

This is extremly unreadable:

Cons<Cons<Cons<SmartString+LMStruct+GlobalVariable+Sized+Tag::SmartString+Field::4<Array<U8,?>>+Field::3<Array<U8,?>>+Field::2<Array<U8,?>>+Field::1<Array<U8,?>>+CaseNumber<0>+Tag::SmartString+Tag::SmartString,Constant+Literal+U8+LMStruct+I64+I32+I16+U64+U32+U16+Sized>,Arrow<Nil,SmartString>>,Arrow<Cons<Array<Umbra,?>,t>,Umbra>+Arrow<Cons<t,Array<Umbra,?>>,Umbra>+Arrow<Cons<Array<base-type,?>,I64>,Array<base-type,?>>+Blob+Arrow<Cons<Array<base-type,?>,U64>,Array<base-type,?>>+Blob+Arrow<Cons<Vector<t>,Vector<t>>,t>+Arrow<Cons<List<x>,List<x>>,List<x>>+Arrow<Cons<S,S>,S>+Arrow<Cons<SmartString,U8>,SmartString>+Arrow<Cons<SmartString,SmartString>,SmartString>+Arrow<Cons<String,String>,String>+Arrow<Cons<F64,F64>,F64>+Blob+Arrow<Cons<I64,I64>,I64>+Blob+Arrow<Cons<U64,U64>,U64>+Blob+Arrow<Cons<I32,I32>,I32>+Blob+Arrow<Cons<U32,U32>,U32>+Blob+Arrow<Cons<I16,I16>,I16>+Blob+Arrow<Cons<U16,U16>,U16>+Blob+Arrow<Cons<I8,I8>,I8>+Blob+Arrow<Cons<U8,U8>,U8>+Blob+Arrow<Cons<L,L>,L>+Blob>
@andrew-johnson-4
Copy link
Owner

andrew-johnson-4 commented Jan 27, 2025

Some possible improvements

  • put this into normal form before printing (can be done right now)
    • this is actually a bug that just needs to be fixed
  • pretty print form for arrows, tuples, and cons (can be done right now)
  • pretty print plural arrows (can be done right now)
  • error message specialization (a little harder to do)

The first one is the biggest issue, because in normal form this becomes

Cons<Cons<Cons<SmartString,U8>,Arrow<Nil,SmartString>>,Arrow<Cons<Array<Umbra,?>,t>,Umbra>,Arrow<Cons<Array<base-type,?>,I64>,Array<base-type,?>>

@andrew-johnson-4 andrew-johnson-4 self-assigned this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants