-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feedback #1
Comments
Interesting. Ok, so I agree on |
Well it is unsafe to use the type
|
So, yes its unsafe. But doesn't |
You don't need to use vendor = context >>= getVendor
where
getVendor ctx = do
nav <- ctx ! "navigator"
vdr <- nav ! "vendor"
readString vdr My point is just that it is unsafe, so I think it should be marked that way, either by name or by type. |
I agree with your point. What is the |
It really depends how safe you want to me. Another option is to just give it the type Ideally in that case, the user wouldn't use window :: Eff ... { navigator :: { vendor :: String } }
window = unsafeContext A third and better option (in my opinion) is to use a foreign type: foreign import data Context :: * The user can then choose to coerce it if they want to. |
Ok I had this purescript-context/src/Context.purs Line 3 in 3531306
But I got rid of it because I couldn't get it to unify for a record type. How would it be coerced? |
Sorry I missed your IRC message.
I like this idea. Here is some feedback:
context
a foreign type, or even useData.Foreign.Foreign
.Eff
, sincewindow
is mutable.The text was updated successfully, but these errors were encountered: