Skip to content

Conversation

@paluh
Copy link

@paluh paluh commented Dec 3, 2018

No description provided.

@paluh
Copy link
Author

paluh commented Dec 3, 2018

@Thimoteus I'm not sure if I'm able to preserve instance for identity. I mean this:

instance coercibleId :: Coercible a a where
  coerce = identity

because with this I think we are not able to provide any other instance.

@Thimoteus
Copy link
Owner

What happens if you put it last in the instance chain? Can you show that it'll never get picked?

@paluh
Copy link
Author

paluh commented Dec 3, 2018

This is not really the problem. The problem is that it seems to overlap with any external instance...

@Thimoteus
Copy link
Owner

Hmm, that's a good point...

@paluh
Copy link
Author

paluh commented Dec 3, 2018

I'm migrating purescript-snail currently and I have another problem with overlapping instances for Optional and Maybe:

instance coercibleMaybeOptional :: Coercible (Maybe a) (Optional a) where

To be honest my focus is to migrate purescript-snail and literate-purescript at the moment, so I'm going to use... Newtype there :-P

@Thimoteus
Copy link
Owner

Yeah, I think those are old enough to have been written before Newtype made it into PS, but I'm not sure.

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.

2 participants