Issue #38 is addressed by means of contextual typing.
If a contextual type is present it is used to cast e1 and e2. The casting happens only in the raw level.
So the original becomes:
e ? <T> e1 : <T> e2
In Liquid it is assumed that the base types for e1 and e2 are the same and so we can use a "modified" version of function call to a function with signature:
condExpr :: forall C A . (c: C, x: A, y: A) => { v: A | if Prop(c) then v ~~ x else x ~~ y }
The modified version makes sure that the arguments e1 and e2 are compiled under the guards: True(c) and False(c) respectively.
Issue #38 is addressed by means of contextual typing.
If a contextual type is present it is used to cast e1 and e2. The casting happens only in the raw level.
So the original becomes:
In Liquid it is assumed that the base types for
e1
ande2
are the same and so we can use a "modified" version of function call to a function with signature:The modified version makes sure that the arguments
e1
ande2
are compiled under the guards:True(c)
andFalse(c)
respectively.