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

Change the order of types in show #83

Closed
vrom911 opened this issue Nov 21, 2017 · 1 comment
Closed

Change the order of types in show #83

vrom911 opened this issue Nov 21, 2017 · 1 comment

Comments

@vrom911
Copy link
Contributor

vrom911 commented Nov 21, 2017

For the moment

show :: (Show a, IsString b) => a -> b

It would be better to have on the first position the returned type, rather that received. So you don't need to write something like: show @_ @Text x but just show @Text x.

@chshersh
Copy link
Contributor

@vrom911 I agree! It would be nice to fix this. print function has the same problem:

print :: (X.MonadIO m, PBase.Show a) => a -> m ()

This should be solved using forall keyword to specify explicitly order of arguments, like this:

show :: forall b a . (Show a, IsString b) => a -> b

I wouldn't rely on type variables order of appearance... In such cases it's better to explicitly specify desired order.

chshersh added a commit that referenced this issue Nov 23, 2017
[#83] Change types order in show and print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants