intellij-haskell
intellij-haskell copied to clipboard
Nested case splitting doesn't work
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) = ""
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.
But that is probably not the only criterion, right?
For instance, I can't seem to trigger the case split intention for
bla :: Maybe Int -> IO ()
bla m = undefined
either.
@mbwgh Thanks for reporting!
That should work. Have to fix that.
@mbwgh Should be fixed in next release.
@mbwgh Fixed in beta84 which is uploaded to alpha plugin repo.
That's great news!
I wanted to try it out right away actually, but unfortunately it did not seem to work. It appears that the alpha repo now has beta83 as latest version.
Jetbrains first has to approve this version before it’s available. You can also download the plugin from Releases, https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta84
I was able to try it out and found two issues.
- Type synonyms are not resolved. For instance, there is no option to case-split on
String
, but it works on[Char]
. - You can now case-split on
Char
andInt
and so on. Maybe this makes sense when the constructors are actually available, but probably not in general.
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.