Ticket #1777 (closed task: fixed)

Opened 6 years ago

Last modified 4 months ago

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 Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

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

Changed 6 years ago by igloo

  • milestone set to 6.10 branch

Changed 5 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))

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by igloo

  • milestone changed from 6.10 branch to 6.12 branch

Changed 3 years ago by igloo

  • milestone changed from 6.12 branch to 6.12.3

Changed 3 years ago by igloo

  • priority changed from normal to low
  • milestone changed from 6.12.3 to 6.14.1

Changed 2 years ago by igloo

  • milestone changed from 7.0.1 to 7.0.2

Changed 2 years ago by igloo

  • milestone changed from 7.0.2 to 7.2.1

Changed 20 months ago by igloo

  • milestone changed from 7.2.1 to 7.4.1

Changed 16 months ago by igloo

  • priority changed from low to lowest
  • milestone changed from 7.4.1 to 7.6.1

Changed 8 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

Changed 4 months ago by morabbin

  • failure set to None/Unknown

Bump; still relevant?

Changed 4 months ago by simonpj

  • status changed from new to closed
  • resolution set to fixed

Actually refactoring has been done.

Note: See TracTickets for help on using tickets.