We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello buddies! Sorry if I stupid and annoying. Consider following code, which works:
I have small helper:
fromNullable :: Nullable a -> a fromNullable (Nullable smth) = smth
Every time before I use it I must be sure if value is not Null. That's not big deal.
Null
snap :: String -> Fay (Nullable Fragment) snap = ffi "Snap(%1);"
When I snaping back a real object but not Null then it is OK to pass the result to fromNullable and unwrap Fragment.
snap
fromNullable
Fragment
Then I wanted to make my code a bit cleaner and finished with this:
type NullFragment = Nullable Fragment snap :: String -> Fay NullFragment
But this time I'm getting a runtime exception unfortunately, because in this case I could not pattern match (Nullable smth) anymore.
(Nullable smth)
Uncaught unhandled case in fromNullable
Is this a bug or just another not implemented feature?
The text was updated successfully, but these errors were encountered:
Resolving type aliases in the FFI hasn't been implemented yet, #185.
On Thu, Jan 9, 2014 at 11:04 PM, Артур Файзрахманов < [email protected]> wrote:
Hello buddies! Sorry if I stupid and annoying. Consider following code, which works: I have small helper: fromNullable :: Nullable a -> a fromNullable (Nullable smth) = smth Every time before I use it I must be sure if value is not Null. That's not big deal. snap :: String -> Fay (Nullable Fragment) snap = ffi "Snap(%1);" When I snaping back a real object but not Null then it is OK to pass the result to fromNullable and unwrap Fragment. Then I wanted to make my code a bit cleaner and finished with this: type NullFragment = Nullable Fragment snap :: String -> Fay NullFragment But this time I'm getting a runtime exception unfortunately, because in this case I could not pattern match (Nullable smth) anymore. Uncaught unhandled case in fromNullable Is this a bug or just another not implemented feature? — Reply to this email directly or view it on GitHubhttps://github.com//issues/380 .
— Reply to this email directly or view it on GitHubhttps://github.com//issues/380 .
Sorry, something went wrong.
I'll close this in favor of that ticket, please subscribe to that one for updates.
No branches or pull requests
Hello buddies! Sorry if I stupid and annoying.
Consider following code, which works:
I have small helper:
Every time before I use it I must be sure if value is not
Null
. That's not big deal.When I
snap
ing back a real object but notNull
then it is OK to pass the result tofromNullable
and unwrapFragment
.Then I wanted to make my code a bit cleaner and finished with this:
But this time I'm getting a runtime exception unfortunately, because in this case I could not pattern match
(Nullable smth)
anymore.Is this a bug or just another not implemented feature?
The text was updated successfully, but these errors were encountered: