argotorg / argotorg/solcore

Problem specialising higher-order functions

Open
#333 0 comments 0 reactions 1 assignee Claimed by @mbenke View on GitHub
Dominant language
Haskell
Stars
113
Forks
9
Avg merge
4d 9h
Merged PRs (30d)
1

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.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.