Skip to content

hls-eval-plugin should support working with the expression preceding the comment #3436

Open
@BlueNebulaDev

Description

@BlueNebulaDev

Whenever I'm writing a long expression split in multiple logical pieces and spanning over multiple lines, I wish I could see the type of each piece, autogenerated by my IDE.

For instance I may write:

value
  & toSend fn1
  & groupBy fn2
  & sequence
  & ...

And I wish I could see:

value           -- m a
  & toSnd fn1   -- m (a, b)
  & groupBy fn2 -- m [(a, b)]]
  & sequence    -- [m (a, b)]
  & ...         -- ...

I believe that what I'm asking for here, is similar to what #709 is about, but a bit more specific.

A possible solution for my needs, that I believe would be easy to implement, would be extending the ability of hls-eval-plugin to:

  1. support working with the expression that precedes it,
  2. write the result in the same line as the comment.

For instance, for the above case, I could write something similar to:

value           -- !> :t #
  & toSnd fn1   -- !> :t #
  & groupBy fn2 -- !> :t #
  & sequence    -- !> :t #
  & ...         -- !> :t #

where !> tells the hls-eval-plugin to place the result in the same line, and # represents the preceding expression (please come up with a better syntax than what I suggested). And the result would look like:

value           -- !> :t # -- m a
  & toSnd fn1   -- !> :t # -- m (a, b)
  & groupBy fn2 -- !> :t # -- m [(a, b)]
  & sequence    -- !> :t # -- [m (a, b)]
  & ...         -- !> :t # -- ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions