cursorless
cursorless copied to clipboard
Add `"constructor"` scope type
Add a scope type to target data constructors, such as:
compare :: Int -> Int -> Ordering
compare x y
| x < y = LT
-- ^^ constructor
| x == y = EQ
-- ^^ constructor
| x > y = GT
-- ^^ constructor
either :: (a -> c) -> (b -> c) -> Either a b -> c
either f g (Left l) = f l
-- ^^^^ constructor
either f g (Right r) = g r
-- ^^^^^ constructor
ifThenElse :: Bool -> a -> a -> a
ifThenElse True t _ = t
-- ^^^^ constructor
ifThenElse False _ f = f
-- ^^^^^ constructor
Could be addressed by #557 even if placing them under function doesn't quite make sense.
Could this be "callee"? What's the domain for these? Ie for the Left example should the domain be the surrounding parens?
Could this be "callee"? What's the domain for these? Ie for the
Leftexample should the domain be the surrounding parens?
It'd be good to be able to say something like "change constructor first argument every branch".
Having them be "callee" is possible, but mentally strange.
that should work out of the box with "callee" if everything is implemented correctly
I guess that leaves the question: are you comfortable with True and False being addressed as "callee"?
I think that makes sense when one bends one's mind to the Haskell way of thinking, no?