Opened 11 years ago

Closed 9 years ago

Last modified 8 years ago

#7 closed defect (fixed)

Merge projection dictionaries from different modules.

Reported by: benl Owned by: erikd
Priority: blocker Milestone:
Component: Source Desugarer Version: 0.1.2
Keywords: Cc:


Projection dictionaries are open, so we should be able to give instance functions in multiple modules.

Change History (9)

comment:1 Changed 11 years ago by benl

  • Milestone changed from _|_ to 0.1.4

comment:2 Changed 11 years ago by benl

Test is T7-MergeProjDictionaries


module Main where
import Foo

project List where 
	rrev xx = reverse xx

main ()
 = do	putStr $ show $ [1, 2, 3] .rrev
	putStr $ show $ [1, 2, 3] .count
module Foo where

project List where
	count = length

we get

ddc: ERROR
     Redefined value variable 'Foo.project_List_x'
      first defined at: ./library/Data/List.di:65:15

     Redefined value variable 'Foo.project_List_xs'
      first defined at: ./library/Data/List.di:71:15


Compiler tries to generate new default projections in the Foo module, which conflict with the original ones in Data.List. We should only generate the default projections in the module that defines the data type, not the projection dictionary.

comment:3 Changed 10 years ago by erikd

  • Owner set to erikd
  • Status changed from new to assigned

comment:4 Changed 10 years ago by benl

The symtoms for this test have changed slightly due to recent changes in the renamer.

In Foo.di we have

foreign import project_List_x
        :: forall Data.List.t0 %r0
        .  Data.List.List %r0 Data.List.t0 -(!e0)> Data.List.t0
        :- !e0        = Base.!Read %r0
        :$ Base.Data -> Base.Obj;

Note that Data.List.t0 is fully qualified, which causes a parse error. It's been fully qualified by the exporter because the function was defined in the Data.List module instead of the Foo module. Although the test dies due to the parse error, the real problem is that Foo.di should not re-export functions that were defined in Data.List.

If, in Foo.ds we add projections to the List type, then only the sigs for these new projections should appear in Foo.di, not all the others from Data/List.ds as well.

comment:5 Changed 10 years ago by erikd

This ticket can't be fixed until #168 is fixed.

comment:6 Changed 10 years ago by erikd

  • Milestone changed from 0.1.4 to 0.1.3

comment:7 Changed 10 years ago by erikd

  • Priority changed from normal to blocker

comment:8 Changed 9 years ago by erikd

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

Ben fixed this some time ago when he was working on the module exporter.

Closing it.

comment:9 Changed 8 years ago by benl

  • Milestone 0.1.3 deleted

Milestone 0.1.3 deleted

Note: See TracTickets for help on using tickets.