Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Feature Request: Collapsing Indirection #1062

Open
@anchpop

Description

@anchpop

"Collapsing indirection" is a feature which I suspect is difficult to implement. I expect most people here are familiar with it from that one talk, but just in case I'll recap it here.

Imagine this is your project:

-- some distant file
addone x = x + 1
-- file you're working on now
addonethendouble x = (addone x) * 2

You're looking at addonethendouble and wondering what exactly addone x is doing. You right-click addone and select collapse indirection in your IDE. Suddenly, that line changes to look like this:

addonethendouble x = (x + 1) * 2

The x+1 section probably should not be editable, but that seems like an issue for the IDE and not for HIE.

In theory, you should be able to use "collapse indirection" repeatedly, drilling down as far as you need to in order to understand the code.

This raises design questions. How to handle pointfree style vs pointful functions, functions defined as lambdas, functions using where, functions using pattern matching, functions not passed to all their arguments, occasions when it's not obvious which function to collapse to (e.g. pure 3) due to typeclasses, and I'm sure many others. It's not obvious to me how to address these.

I'm not very experienced with HIE, but I would be more than happy to help to contribute this feature, since I think it would be massively helpful to understanding a codebase and for beginners to familiarize themselves with common functions. But, I would probably need some guidance or a nudge in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions