-
Notifications
You must be signed in to change notification settings - Fork 89
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
Qualified types in FFI declarations do not resolve (was: Text and Automatic, don't understand how come I get undefined) #349
Comments
Text decoding is supported, the reason Text was added was that it is represented as JS strings so transcoding is the identity. I have an inkling that you may need an unqualified import here. I completely forgot about the FFI when adding qualified imports! So please try edit Yes, |
I already have Thanks for the answer about the Fay monad! |
I went back and forth with this one, it is a bug with qualified imports after all,
And yes, I meant Fay.Text of course :) I'll update the comment in case someone else reads this ticket after having the problem. |
ah yes sorry when I said it didn't help, i changed the import but did not remove the "T." in the definition... It simply didn't come to my mind that this could have any influence :-/ |
By the way |
This may be my misunderstanding of the library, but I don't understand how come after "test2" i get "undefined" as the value.
Maybe it's not supported to decode to Text and I should have the record type in "Type" to be String instead of Text?
Otherwise apologies for the contrived test code, this is extracted from my larger source.
I compile this with:
fay --package fay-text --html-wrapper FayTest2.hs
.(as an aside I had assumed so far that if I call "ffi" then the return type must be in the Fay monad, turns out that not necessarily... So I guess it's the common sense of the author to decide to put the result in the Fay monad or not... Like if it will touch anything besides the parameters (DOM and so on) then put Fay, if it only reads the parameters without side-effects then no Fay..?)
The text was updated successfully, but these errors were encountered: