-
Notifications
You must be signed in to change notification settings - Fork 7
Problem specialising higher-order functions #333
Copy link
Copy link
Open
Description
The following example
forall abs rep . class abs:Typedef(rep) {
function abs(x:rep) -> abs;
function rep(x:abs) -> rep;
}
forall t.
/* default */ instance t:Typedef(t) {
function abs(x:t) -> t { return x; }
function rep(x:t) -> t { return x; }
}
forall abs rep res. abs:Typedef(rep) =>
function lift1ac(f:(rep) -> res, x:abs) -> res { f(Typedef.rep(x)) }
forall a. function id(x:a) -> a {x}
contract TD {
function main() -> word { lift1ac(id, 42) }
}
fails with
Error: function lift1ac cannot be specialised because it has an ambiguous type:
forall $v_1 rep res abs . $v_1 : invokable (rep, res), abs : Typedef (rep) => $v_1 -> abs -> res
variables: [rep]
do not occur in the argument/result types.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels