The problem is almost certainly that `Any` is not allowed in
`Ffi-type`. What's the definition of `Ffi-type`, and why does `params`
have a type that involves `Any`?

Sam

On Fri, May 22, 2020 at 5:21 PM Hendrik Boom <hend...@topoi.pooq.com> wrote:
>
> Here's the code it's complaining about.
>
>  `(,@params -> ,rettype)
>
> And here's the message:
>
> Type Checker: Polymorphic function `qq-append' could not be applied to 
> arguments:
> Types: (Listof a) (Listof b) -> (Listof (U a b))
> Arguments: (Listof (List Any ': Any)) (List '-> Ffi-type)
> Expected result: Ffi-type
>  in: (quasiquote ((unquote-splicing params) -> (unquote rettype)))
>
> Now what I'm building is a piece of Racket code that is to be written
> out into a new source-code file.
>
> param is indeed of type (Listof (List Any ': Any)).
> rettype is indeed of type (List '-> Ffi-type)
>
> And or some reason the type-checker isn't able to realise that I can
> really build a valid s-expression out of these components.
>
> Now i could hand-expand the quasiquote in to a lot of cons operations,
> each presummably surrounded by 'inst' becausee cons is polymorphic,
> but this will just make the entire expression unreadable.
>
> I'm almost tempted to write this expression in untyped Racket.
>
> But separating this stuff into another module would significantly
> demodularize the code -- related code will no longer be together.
>
> Racket does have a compact mechanism to embed typed-Racket code in an
> untyped program (it's called with-type)
>
> But there seems to be no similar way to embed an expression of untyped
> code into a typed-racket program.
>
> How to get past this impasse?  The majority of my code needs to be in
> typed Racket to maintain my sanity while debugging, but the quasiquoted
> texts (there are a number of these) need to be readable, for the same
> reason.
>
> -- hendrik
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200522212056.m3x54f6dykgs4qyx%40topoi.pooq.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAK%3DHD%2BZah-zmPNKX%3DyttQoQFs7pY9PHc8hYGzkTeKm35YU3MLg%40mail.gmail.com.

Reply via email to