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.

Nested case splitting doesn't work

See original GitHub issue

image

I was hoping for the case split to work on the Bool inside the newtype resulting in

foo :: Bar -> String
foo (Bar True) = ""
foo (Bar False) = ""

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
rikvdkleijcommented, Sep 23, 2020

Thanks for reporting!

Because the Bool is not explicitly defined in type signature of foo the current implementation does not work for this case. Will take a look how to fix this soon.

0reactions
rikvdkleijcommented, Nov 3, 2020

Thanks for your feedback!

Type synonyms are not resolved. For instance, there is no option to case-split on String, but it works on [Char].

Yes, type synonyms are not resolved. I wonder if I should put effort into that.

Maybe this makes sense when the constructors are actually available, but probably not in general.

Yeah okay but it doesn’t hurt 😄 Otherwise I have to make an exception.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to do nested case statement logic in SQL Server
Show activity on this post. You could try some sort of COALESCE trick, eg: SELECT COALESCE( CASE WHEN condition1 THEN calculation1 ELSE NULL ......
Read more >
Split=false doesn't work on nested list #36798 - GitHub
Split line separator show if I don't specify split=false on the parent List respectively. Environment, Info. antd, 4.22.2. React, 18.2.0. System ...
Read more >
Nested case statements vs multiple criteria case statements
SET STATISTICS IO, TIME ON; Select case when a=1 and b=0 THEN 'True' when a=1 and b=1 then 'Trueish' when a=0 and b=0...
Read more >
CASE statement Error in Beeline HIVE - Cloudera Community
sample nested case which can be used in hive. Select case when hour(split(split(hbid,"#")[1],"_")[1])== 0 then ... This should work. case when ...
Read more >
Optimize SQL Queries with CASE Expressions in Unexpected ...
Open in app ... I don't use overly complex terms or examples. ... With Nested CASE, you can split the data into subgroups...
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