polarity-lang / polarity

A Language with Dependent Data and Codata Types
https://polarity-lang.github.io
Apache License 2.0
57 stars 2 forks source link

Factor out logic for printing dotcalls #337

Closed BinderDavid closed 1 month ago

BinderDavid commented 1 month ago

In order to make this work I had to unfold the let while loop once. (Because the calling site removes the surrounding Exp::DotCall constructor)

BinderDavid commented 1 month ago

We should maybe also think about combining this with the prettyprinting logic for case, to generate code like this:

foo(a,b,c).bar(...)
                 .baz(...)
                 .case { Foo(x,y) => z }
                 .bizz(..)

I don't think that is supported yet.