Open jllang opened 3 years ago
Wow that’s odd! What happens if you also add a plain GHC signature
seed :: [a]
It seems that I get the same error even if I add that Haskell type signature.
Hmm definitely something odd going on -- I believe it works if you make seed
a top-level definition though?
Yes, I can confirm that defining seed
on top-level works.
Adding seed :: [a]
does make the error go away for me, provided that I also:
{-# LANGUAGE ScopedTypeVariables #-}
at the top of the fileforall
to the type signature of reverse
(to turn lexical scoping of type variables on).I also noticed that you don't even need to use abstract refinements to get the bug.
i.e. if I remove all references to UList
and just use plain [a]
, the bug still arises.
However, if I remove the owl braces {-@
@-}
(so that the signature is no longer liquid), the bug goes away (although seed :: [a]
is quite misleading, since it re-binds a)
I suspect that the bug comes from the built-in refinement of [a]
.
If I port Blank3
to a custom list type (which doesn't bind an abstract refinement), the bug goes away, even when the type annotation is liquid.
Very interesting!! Thank you!!
On Thu, Jul 15, 2021 at 6:23 AM yanhasu @.***> wrote:
I suspect that the bug comes from the built-in refinement of [a].
If I port Blank3 http://goto.ucsd.edu:8090/index.html#?demo=permalink%2F1626354457_37152.hs to a custom list type (which doesn't bind an abstract refinement), the bug goes away http://goto.ucsd.edu:8090/index.html#?demo=permalink%2F1626355208_37166.hs, even when the type annotation is liquid.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ucsd-2Dprogsys_liquidhaskell-2Dtutorial_issues_111-23issuecomment-2D880691077&d=DwMCaQ&c=-35OiAkTchMrZOngvJPOeA&r=r3JfTqNkpwIJ1InE9-ChC2ld7xwATxgUx5XHAdA0UnA&m=nAgVjgQAD497YoCCdjbykUkIbEwJzMSomVsl2RY5A6c&s=cY2AlBeAGysBK4V_BXeUDLe-ggkOnIcD4WpzuJV8RlM&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAMS4OFSOEQ4ASQORVM55ATTX3OL5ANCNFSM5AK2QVMQ&d=DwMCaQ&c=-35OiAkTchMrZOngvJPOeA&r=r3JfTqNkpwIJ1InE9-ChC2ld7xwATxgUx5XHAdA0UnA&m=nAgVjgQAD497YoCCdjbykUkIbEwJzMSomVsl2RY5A6c&s=UsVgxNrCB0K0hDB1o5MaRTmAC3bR3fP5HmuOhBJ1I1M&e= .
For reference, here's the template given in the material:
The empty list given to
go
has (vacuously) only unique values, hasn't it? I tried to bind it in a variable and declare it as unique as follows:This led into a weird error:
I wonder what's the issue here.