question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Case splitting inside where block doesn't work properly

See original GitHub issue
data FooType = Foo | Bar Int
newtype Base = Base String

foo :: FooType -> Base -> String
foo a b = undefined
  where
    bar :: FooType -> Base -> String
    bar _ _ = undefined

When case splitting on the implementation line of bar, I end up with:

data FooType = Foo | Bar Int
newtype Base = Base String

foo :: FooType -> Base -> String
foo a b = undefined
  where
    bar :: FooType -> Base -> String
    bar (Bar n) _ = undefined
foo a b = undefined
  where
    bar :: FooType -> Base -> String
    bar Foo _ = undefined

So it correctly splits the cases, but it doesn’t generate the correct code.

Also, I can’t case split when there’s no type annotation for bar. Especially in cases like this I often don’t use explicit type annotations. It would be great to have case splitting there

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rikvdkleijcommented, Sep 26, 2020

Thanks! You’re a great tester 👍

I got a fix which puts the cursor directly after bar :: FooType -> Base -> String Don’t get this better in current implementation. Hopefully you can live with that 😄

1reaction
rikvdkleijcommented, Sep 23, 2020

Thanks for reporting!

Currently only case splitting on top-level is supported. So I have to not show the case split action in this case or make it work in this case. Will take a look soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sealing Split Face Block Doesn't Work - Ask Nagel Realty
Having water issues with your split face block home? Sealing it doesn't work -- but there is a permanent solution requiring relatively minor...
Read more >
Transform.split with depth doesn't work when there ... - Discuss
I am endeavoring to split a block with depth which has a required element in it but get a transaction error. Is this...
Read more >
How to split in a string only when delimiter does not occur in ...
However, there is an error of splitting when there is a --- in a code block. In that case it should not be...
Read more >
Understanding the Split-Merge Block | Troubleshooting & FAQs
Be careful that database transactions do not interfere with each other across parallel jobs. When designing the Automation, assess the number of ...
Read more >
Split a block in different separate shapes - Esri Community
I am trying to precisely control the subdivision of the inside area of a block ... for each of the final base shapes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found