Opened 8 years ago

Closed 3 years ago

#1777 closed task (fixed)

Refactor the implementation of arrow notation

Reported by: simonpj Owned by: ross
Priority: lowest Milestone: 7.6.2
Component: Compiler Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

The implementation of arrow notation is not really satisfactory. See #1662 for some background.

To fix it properly we need to re-factor the way that arrows are typechecked. Ross and I discussed this. Our preliminary plan is this.

  • Instead of re-using HsExpr for commands, make a new data type. (C.f. the comments in HsExpr line 540 or so.)
  • That will allow the renamer to decorate the (now command-specific) tree with what variables are in scope where, and that in turn will greatly simplify the desugarer. (The desugarer is currently duplicating much of what the renamer does.)
  • We'll need think about constraint gathering for "holes in the scope". cf #1662

Change History (14)

comment:1 Changed 8 years ago by igloo

  • Milestone set to 6.10 branch

comment:2 Changed 8 years ago by clanehin

I believe that this is an example of the problem:

arrowAddInt :: (Arrow a) => a Integer (forall n. (Num n) => n -> n)
arrowAddInt = proc n -> returnA -< (+ fromInteger n)

    Cannot match a monotype with `forall n. (Num n) => n -> n'
      Expected type: a b (forall n. (Num n) => n -> n)
      Inferred type: a b b
    In the expression: proc n -> returnA -< (+ (fromInteger n))
    In the definition of `arrowAddInt':
        arrowAddInt = proc n -> returnA -< (+ (fromInteger n))

comment:3 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by igloo

  • Milestone changed from 6.10 branch to 6.12 branch

comment:6 Changed 5 years ago by igloo

  • Milestone changed from 6.12 branch to 6.12.3

comment:7 Changed 5 years ago by igloo

  • Milestone changed from 6.12.3 to 6.14.1
  • Priority changed from normal to low

comment:8 Changed 5 years ago by igloo

  • Milestone changed from 7.0.1 to 7.0.2

comment:9 Changed 4 years ago by igloo

  • Milestone changed from 7.0.2 to 7.2.1

comment:10 Changed 4 years ago by igloo

  • Milestone changed from 7.2.1 to 7.4.1

comment:11 Changed 4 years ago by igloo

  • Milestone changed from 7.4.1 to 7.6.1
  • Priority changed from low to lowest

comment:12 Changed 3 years ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:13 Changed 3 years ago by morabbin

  • Type of failure set to None/Unknown

Bump; still relevant?

comment:14 Changed 3 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed

Actually refactoring has been done.

Note: See TracTickets for help on using tickets.