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

Explain why type-level reification defines forall separately #157

Open
JordanMartinez opened this issue Nov 27, 2018 · 2 comments
Open

Explain why type-level reification defines forall separately #157

JordanMartinez opened this issue Nov 27, 2018 · 2 comments
Labels
bug Something isn't working Syntax Something related to the syntax part of this repo

Comments

@JordanMartinez
Copy link
Owner

See why does type-level reification define forall separately from the reifying function.

I've looked into this more and my response does not compile.

@JordanMartinez JordanMartinez added bug Something isn't working Syntax Something related to the syntax part of this repo labels Nov 27, 2018
@JordanMartinez
Copy link
Owner Author

Reminder: This is what forall means in this context

-- Here, the second forall means the same function
-- can work for different types. In this case, it
-- works for both the `a` type and `b` type.
f :: forall a b. a -> b -> (forall c. c -> String) -> String
f a b function = (function a) <> (function b)

-- where toString is an example of such a function
toString :: forall a. a -> String
toString _ = "some value"

-- this should compile
(f "hello" 4 toString) == "some valuesome value"

@JordanMartinez
Copy link
Owner Author

So, I think the reifies stuff has some relation to this paper: https://okmij.org/ftp/Haskell/tr-15-04.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Syntax Something related to the syntax part of this repo
Projects
None yet
Development

No branches or pull requests

1 participant