Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern match(es) are non-exhaustive #16

Closed
supermario opened this issue Nov 1, 2016 · 1 comment
Closed

Pattern match(es) are non-exhaustive #16

supermario opened this issue Nov 1, 2016 · 1 comment

Comments

@supermario
Copy link

supermario commented Nov 1, 2016

I was getting a runtime (!) exception with the following;

myApp: src/Elm/Record.hs:(12,1)-(67,23): Non-exhaustive patterns in function render

Pulling down the elm-export source and building;

$ stack build --pedantic

elm-export/src/Elm/Encoder.hs:13:1: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘render’:
        Patterns not matched:
            (TopLevel (TopLevel _))
            (TopLevel (Record _ _))
            (TopLevel (Constructor _ _))
            (TopLevel (Selector _ _))
            ...

elm-export/src/Elm/Record.hs:12:1: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘render’:
        Patterns not matched:
            (TopLevel (TopLevel _))
            (TopLevel (DataType _ (TopLevel _)))
            (TopLevel (DataType _ (DataType _ _)))
            (TopLevel (DataType _ (Constructor _ _)))
            ...

I tried fixing it but couldn't quite grok things.

Adding render _ = return "" to both Encoder and Record files "did the trick" in terms of the runtime exception in my dependant app, but I doubt that's the Right™ fix.

Would be happy to submit a PR with some direction 😄

@krisajenkins
Copy link
Owner

Thanks for this - there's been a big overhaul of the core datastructures that deals with this. Last night we finally finished polishing it up and got it released, so if you try 0.5.0.1 you should be good. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants