question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Too many error messages

See original GitHub issue

Code:

prim I
prim left
prim right
struct Path (A : I -> Type) (a : A left) (b : A right) : Type
  | at (i : I) : A i {
    | left => a
    | right => b
  }
def path {A : I -> Type} (p : Pi (i : I) -> A i)
  => new Path A (p left) (p right) { | at i => p i }
def `=` Eq {A : Type} (a b : A) : Type => Path (\ i => A) a b
bind = looser application

def psqueeze {A : Type} {a a' : A} (p : a = a') (i : I) : a = p.at i => path (\j => p.at (I.squeeze i j))

Error:

In file test.aya:14:90 ->

  12 | bind = looser application
  13 | 
  14 | def psqueeze {A : Type} {a a' : A} (p : a = a') (i : I) : a = p.at i => path (\j => p.at (I.squeeze i j))
                                                                                                 ^^

Error: Expected type: Type
       Normalized: Type
       Want: struct type
       Because we want to type a term such as: I
In file test.aya:14:90 ->

  12 | bind = looser application
  13 | 
  14 | def psqueeze {A : Type} {a a' : A} (p : a = a') (i : I) : a = p.at i => path (\j => p.at (I.squeeze i j))
                                                                                                 ^---------^

Error: Expected type: Type
       Normalized: Type
       Want: pi type
       Because we want to type a term such as: I.squeeze i
In file test.aya:14:90 ->

  12 | bind = looser application
  13 | 
  14 | def psqueeze {A : Type} {a a' : A} (p : a = a') (i : I) : a = p.at i => path (\j => p.at (I.squeeze i j))
                                                                                                 ^-----------^

Error: Expected type: Type
       Normalized: Type
       Want: pi type
       Because we want to type a term such as: I.squeeze i j
In file test.aya:14:72 ->

  12 | bind = looser application
  13 | 
  14 | def psqueeze {A : Type} {a a' : A} (p : a = a') (i : I) : a = p.at i => path (\j => p.at (I.squeeze i j))
                                                                               ^------------------------------^

Error: Expected type: Eq {A} a (p.at i)
       Normalized: Path (λ i ⇒ A) a (p.at i)
       Actual type: Path (λ _9 ⇒ A _9) (p.at <I.squeeze i j>) (p.at <I.squeeze i
       j>)
       Normalized: Path (λ _9 ⇒ A) (p.at <I.squeeze i j>) (p.at <I.squeeze i j>)
       They don't match, sorry
🔨

Probably we only want the first error to appear.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
re-xyrcommented, Sep 9, 2021

Here are my ideas for what error messages can be like:

Cannot check the expression 
  p left
of type
  P true
  (Normalized: Top)
against type
  P false
  (Normalized: Bottom)

Cannot apply this expression as a function
  tt
because its type is not a Pi type, but instead:
  Top

Cannot access field `squeeze` of the expression
  I
because its type is not a struct type, but instead:
  Type
1reaction
re-xyrcommented, Sep 10, 2021

Imo only the “I is not a struct type” error makes sense

I think she is referring to the error messages I gave

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Messages: Examples, Best Practices & Common Mistakes
Designing error messages is all about limiting the frustration users feel with your form. If they're too stressed—too much cortisol builds up— ...
Read more >
OpenGL “too many errors” Meaning - NVIDIA
Too many errors occurred indicating a serious problem from which the driver cannot recover. The application must close. What does it mean? If ......
Read more >
Hostile Patterns in Error Messages - Nielsen Norman Group
Premature error messages are error messages that are presented by the system too early — before the user has reached a fair and...
Read more >
How to Fix 429 Too Many Requests Error - Kinsta
The HTTP 429 error is returned when a user has sent too many requests within a short period of time. The 429 status...
Read more >
Tired of Error Messages? You Shouldn't Be — And Here's Why
Learning to code can be a frustrating endeavor because you are destined to encounter many red errors along the way.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found