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

Pass the length of arguments in as a function argument. #1384

Closed
wants to merge 2 commits into from

Conversation

nicodelpiano
Copy link
Contributor

This solves the issue #1380.

Now the error (head empty list) doesn't appear:

module Main where

import Prelude
import Data.Generic

data Void
derive instance genericVoid :: Generic Void

and this example works fine.

@paf31
Copy link
Contributor

paf31 commented Aug 14, 2015

Could you please add that example in core-tests/tests/generic-deriving?

checkExpr c@(Case _ cas) = checkExhaustive env mn cas >> return c
checkExpr c@(Case _ cas) = checkExhaustive env mn na cas >> return c
where
na = length . caseAlternativeBinders . head $ cas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this solves the issue. You're still calling head on cas.

@nicodelpiano nicodelpiano force-pushed the derivevoid branch 2 times, most recently from e983335 to c01040b Compare August 17, 2015 16:21
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

Successfully merging this pull request may close these issues.

None yet

2 participants