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

Thoughts on replacing Proxy with VTA? #85

Open
pete-murphy opened this issue Jan 5, 2024 · 3 comments · May be fixed by #86
Open

Thoughts on replacing Proxy with VTA? #85

pete-murphy opened this issue Jan 5, 2024 · 3 comments · May be fixed by #86

Comments

@pete-murphy
Copy link

Is there any interest in (or objection to) updating this library to use Visible Type Application syntax in place of Proxy?

@pete-murphy
Copy link
Author

pete-murphy commented Jan 5, 2024

Hm, maybe Builder would still need Proxy unless I'm not seeing how to make this testBuilder compile

  let
    testBuilder =
      ( Builder.build
          :: forall r
           . Builder { | r } { x :: String, y :: String | r }
          -> { | r }
          -> { x :: String, y :: String | r }
      )
        ( Builder.insert @"x" 42
            >>> Builder.merge { y: true, z: "testing" }
            >>> Builder.delete @"y"
            >>> Builder.modify @"x" show
            >>> Builder.rename @"z" @"y"
        )
        {}

I thought adding the type annotation to build might be the best I could do to help infer the right constraints, but I get the following error on the call to Builder.insert @"x"

  An expression of polymorphic type
  with the invisible type variable l:

    forall l a r1 r2. Cons l a r1 r2 => Lacks l r1 => IsSymbol l => a -> Builder (Record r1) (Record r2)

  cannot be applied to:

    "x"

@pete-murphy
Copy link
Author

pete-murphy commented Jan 5, 2024

Hm, maybe Builder would still need Proxy unless I'm not seeing how to make this testBuilder compile

Oops, nevermind, I had forgot to make some of the type variables visible with @ (which is what the error is saying).

@garyb
Copy link
Member

garyb commented Jan 5, 2024

There's a current/active thread on the forum discussing the guidelines we're going to use for updating libraries with VTAs, might be worth chiming in there too: https://discourse.purescript.org/t/proposal-guidelines-for-vtas/3866

@pete-murphy pete-murphy linked a pull request Jan 21, 2024 that will close this issue
4 tasks
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