Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LH error message
Code:
{-@ test2 :: [Blob] -> [{v: Blob | xVal v <= 10 && yVal v <= 20}] @-}
test2 = filterQ q2
where
q2 = (VarX `Le` (Const 11)) `And` (VarY `Le` (Const 20))
Error:
58 | test2 = filterQ q2
^^^^^^^^^^
Inferred type
VV : {v : Blob | Query.evalQ q2 v}
not a subtype of Required type
VV : {VV : Blob | Query.xVal VV <= 10
&& Query.yVal VV <= 20}
In Context
q2 : {q2 : Query | (is$Query.Or q2 <=> false)
&& lqdc##select q2 == ?c
&& lqdc##select q2 == ?e
&& lqdc##select q2 == ?c
&& lqdc##select q2 == ?e
&& (is$Query.And q2 <=> true)
&& (is$Query.Le q2 <=> false)
&& q2 == Query.And ?e ?c
&& q2 == Query.And ?e ?c}
?f : {?f : Atom | lqdc##select ?f == ?a
&& lqdc##select ?f == ?a
&& (is$Query.Const ?f <=> true)
&& (is$Query.VarY ?f <=> false)
&& (is$Query.VarX ?f <=> false)
&& ?f == Query.Const ?a
&& ?f == Query.Const ?a}
?c : {?c : Query | (is$Query.Or ?c <=> false)
&& (is$Query.And ?c <=> false)
&& lqdc##select ?c == ?b
&& lqdc##select ?c == Query.VarY
&& lqdc##select ?c == ?b
&& lqdc##select ?c == Query.VarY
&& (is$Query.Le ?c <=> true)
&& ?c == Query.Le Query.VarY ?b
&& ?c == Query.Le Query.VarY ?b}
?e : {?e : Query | (is$Query.Or ?e <=> false)
&& (is$Query.And ?e <=> false)
&& lqdc##select ?e == ?f
&& lqdc##select ?e == Query.VarX
&& lqdc##select ?e == ?f
&& lqdc##select ?e == Query.VarX
&& (is$Query.Le ?e <=> true)
&& ?e == Query.Le Query.VarX ?f
&& ?e == Query.Le Query.VarX ?f}
?b : {?b : Atom | lqdc##select ?b == ?d
&& lqdc##select ?b == ?d
&& (is$Query.Const ?b <=> true)
&& (is$Query.VarY ?b <=> false)
&& (is$Query.VarX ?b <=> false)
&& ?b == Query.Const ?d
&& ?b == Query.Const ?d}
?d : {?d : Int | ?d == (20 : int)}
?a : {?a : Int | ?a == (11 : int)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment