Open dataO1 opened 4 years ago
Hmm, I believe it should be possible, although I'm not sure the best way to do it. Plus, given haskell's declarative nature, the simple approach used by this plugin (open a new line before the current one and put the variable there) won't probably work (except maybe inside a do
?). Another approach would be to use a where
, although I'm not sure what would happen if you already have a where
in your function (are two where
s syntactically valid?).
Anyway, if there's an approach that you think can work, I'd be happy to add it, but I'm not sure how it would be.
cc @k0001 @gillchristian do you have an opinion on this?
You can always replace an expression x
with another expression let a = b in c
in place, without having to worry about indentation, etc. That's probably the easiest way to support this.
Makes sense. The problem is recognizing the boundaries of c
though. Maybe search backwards for some weird regex like ^\S+\s*=
to get the start of the function, and then adding the let a = b in
after that. Not sure how brittle that would be though.
Hi, is haskell support possible ?