Languages should express our intent, and giving type and instance declarations the ability to be localised will enable them to serve as better vehicles of expression. That said, Imants Cekusins <imantc@gmail.com> writes:
local types and instances
is this not an attempt to move module functionality inside function?
Same counter-argument can be applied to local functions.
would this not encourage larger functions? are larger functions a good thing?
Same as above.
could this not be better addressed by allowing explicit export / hiding of instances in a module?
If I interpret the intent correctly, this is specifically about finer granularity than module level.
does not type declaration inside function come at a performance cost?
Generally speaking, and whether this suggested cost is real, Haskell programmers are more or less used to pay the cost of abstraction. -- с уважениeм / respectfully, Косырев Сергей