FStarLang / FStarLang/pulse

Type-class implicits are not eager enough

Open
#183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
36
Forks
11
PR merge metrics
No merged PRs in 30d

Description

When a function has a final type-class argument, then F* will apply it (and solve it via type-class search), but Pulse will not:
 
```fstar
module TCArg
open Pulse
#lang-pulse

class droppable (p: slprop) = {
drop_: stt unit p (fun _ -> emp)
}

let drop (p: slprop) {| droppable p |} = drop_ #p

instance droppable_emp : droppable emp = { drop_ = return_stt_noeq _ _ }

let foo_in_fstar = drop emp // works

fn foo_in_pulse () requires emp ensures emp {
(*
Expected type unit
but drop emp
has type {| _: droppable emp |} -> stt unit emp (fun _ -> emp)
*)
drop emp; // doesn't work
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the TCArg reproducer in the issue, comparing foo_in_fstar with foo_in_pulse and the final type-class argument to drop. Trace the Pulse handling of implicit type-class arguments and verify that the Pulse call resolves droppable emp and produces the expected unit result.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.