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

Implement JavaConverter for a rank 2 type #886

Open
jneira opened this issue Sep 28, 2018 · 0 comments
Open

Implement JavaConverter for a rank 2 type #886

jneira opened this issue Sep 28, 2018 · 0 comments

Comments

@jneira
Copy link
Collaborator

jneira commented Sep 28, 2018

Hi, i want to wrap this type (that i cant change):

type Normalizer = forall s. Expr s a -> Maybe (Expr s a)

with this java Function-like:

data JNormalizer s a = JNormalizer (@org.dhall.eta.core.Normalizer s a)
  deriving Class

foreign import java unsafe "apply" applyJNormalizer
  :: (s <: Object, a <: Object, t <: JExpr s a, r <: JExpr s a)
  => (t -> Java (JNormalizer s a) (JOptional r))

given i have instances of JavaConverter for all Dhall.Expr JExpr, (Maybe a) (JOptional ja), etc

Afaik you could not "use" the type s' and you cant add the constraint JavaConverter s js after the rank 2 type Normalizer definition.
Is there any workaround (changing the definition of JNormalizer or JavaConverter f. e.)?

@jneira jneira changed the title Implement JavaConverter for a rank n type Implement JavaConverter for a rank 2 type Sep 28, 2018
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

1 participant