jstolarek / slicer

Companion code for paper "Imperative Functional Programs that Explain their Work", Wilmer Ricciotti, Jan Stolarek, Roly Perera and James Cheney, ICFP 2017, Oxford, UK
http://dl.acm.org/citation.cfm?id=3110258
GNU General Public License v3.0
7 stars 0 forks source link

Can a `Roll`/`Unroll` contain `Nothing` as type variable? #16

Closed jstolarek closed 7 years ago

jstolarek commented 7 years ago

Roll and Unroll constructors are declared as:

| Roll (Maybe TyVar) a | Unroll (Maybe TyVar) a

In what situations can the first field become a Nothing? I couldn't locate a single instance of such a case in the source code. It seems to always be a Just.

jamescheney commented 7 years ago

I think this may be a holdover from an early stage when we were writing programs directly in the core language, so that we were able to leave out the type annotations. These seem to always be populated by the desugaring now, so can probably be omitted. Roly may remember more.

rolyp commented 7 years ago

I remember their being populated by the desugaring, although not why they needed to be optional :-/ It sounds like they can made non-optional, anyway.

(When we implement the slicing resugaring "properly", i.e. using the original sugared expression to guide the backwards computation, we presumably won't need these annotations anyway; we'll always be at the right point in the original expression to recover them.)

On 7 February 2017 at 13:58, James Cheney notifications@github.com wrote:

I think this may be a holdover from an early stage when we were writing programs directly in the core language, so that we were able to leave out the type annotations. These seem to always be populated by the desugaring now, so can probably be omitted. Roly may remember more.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jstolarek/slicer/issues/16#issuecomment-278006957, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHY8n2FkObL3v6kZICBywSsZk7JqM5qks5raHh8gaJpZM4L5ePu .

jstolarek commented 7 years ago

Fixed on branch js-resugaring