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

Higher kinded Void #9

Closed
ajnsit opened this issue Jun 21, 2015 · 4 comments
Closed

Higher kinded Void #9

ajnsit opened this issue Jun 21, 2015 · 4 comments

Comments

@ajnsit
Copy link

ajnsit commented Jun 21, 2015

I currently have some code for which I require a uninhabitable Functor. I currently just use -

data VoidF a
instance Functor VoidF where
  fmap = undefined

Is it possible to have higher kinded versions of Void to use in this situation with appropriate Functor and other instances? Perhaps even Void1 with kind * -> *, Void2 with kind * -> * -> * etc.

@tomjaguarpaw
Copy link

You could use Const Void, Const (Const Void) etc.. (Const is in Control.Applicative)

@ekmett
Copy link
Owner

ekmett commented Jun 25, 2015

I think Const Void is the best "official" answer for this for now. It should have all the right instances.

@ajnsit
Copy link
Author

ajnsit commented Jun 26, 2015

Yes that's perfect! Thanks! It would be nice to have a blurb about using Const for higher kinded Void so it's easier to find.

@ekmett
Copy link
Owner

ekmett commented Jun 26, 2015

Since Void has moved into base, this package here is more or less just in maintenance mode. I'd take a patch that included a documentation blurb, but I wouldn't expect it to get too well seen out here.

@ekmett ekmett closed this as completed Jun 26, 2015
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

3 participants