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

Add IdentityT #120

Closed
JordanMartinez opened this issue Mar 17, 2020 · 9 comments · Fixed by #121
Closed

Add IdentityT #120

JordanMartinez opened this issue Mar 17, 2020 · 9 comments · Fixed by #121

Comments

@JordanMartinez
Copy link
Contributor

For context, this is included in the Haskell 'transformers' library

@hdgarrood
Copy link
Contributor

I'd prefer to wait until we have a concrete use case for it, personally.

@JordanMartinez
Copy link
Contributor Author

JordanMartinez commented Apr 5, 2020 via email

@hdgarrood
Copy link
Contributor

Ah okay, I reckon that probably counts. Can you describe how it's useful for your hedgehog port?

@JordanMartinez
Copy link
Contributor Author

It is used to create 3 different type class instances and I'm guessing that TreeT is somehow affected by it:

@hdgarrood
Copy link
Contributor

Instance definitions don't really justify the existence of IdentityT though, I think the part that's more relevant here is places where those instances would be used. I think perhaps similarly to how identity is useful for functions which take functions as arguments, IdentityT could be useful for types which take monad transformers as arguments. Does hedgehog have any of those?

@JordanMartinez
Copy link
Contributor Author

IdentityT could be useful for types which take monad transformers as arguments.

Yeah, that would make sense. Similar to how Identity acts like a placeholder monad argument.

After looking around a bit more, seems like distributeT from MonadTransDistributive has a MFunctor constraint that takes a monad transformer as an argument. However, the purescript port of mmorph's MFunctor doesn't have an instance for IdentityT. I imagine it's because IdentityT isn't included in this library. Does that concrete example suffice?

@hdgarrood
Copy link
Contributor

Yep, that works for me.

@JordanMartinez
Copy link
Contributor Author

I can submit a PR for this. However, what should the file's module name be? Control.Monad.Identity.Trans?

@hdgarrood
Copy link
Contributor

Yep, that conforms to the convention we're using in this library.

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 a pull request may close this issue.

2 participants