Case splitting inside where block doesn't work properly
See original GitHub issuedata 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:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😄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.