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

'External content' widget #50

Closed
BartAdv opened this issue Aug 4, 2014 · 2 comments
Closed

'External content' widget #50

BartAdv opened this issue Aug 4, 2014 · 2 comments

Comments

@BartAdv
Copy link
Contributor

BartAdv commented Aug 4, 2014

Would it be doable to implement widget which renders the raw content (html), and then hooks to some URL, and when request arrives there it process it, generate some value and pass this value down the flow?

This could allow to 'escape' the nice-but-often-restricting applicative/monadic land in favour of traditional approach.

Pseudocode:

external uri = do
  sendResponse "<input type='button' onclick="this.form.submit()">foo</input"
  resp <- waitForResponse uri
  x <- processResponse resp (to produce meaningful value from raw HTTP request)
  return x -- could even loop here again to 'external'

test = page $ do
  i <- getInt Nothing
  e <- external "/baz" -- this won't pass further unless there will be request ready at the specified URI
  -- ...
@agocorona
Copy link
Owner

Look at "retuning". It may be related with what you menripn
El 04/08/2014 11:02, "Bartosz" notifications@github.com escribió:

Would it be doable to implement widget which renders the raw content
(html), and then hooks to some URL, and when request arrives there it
process it, generate some value and pass this value down the flow?

This could allow to 'escape' the nice-but-often-restricting
applicative/monadic land in favour of traditional approach.

Pseudocode:

external uri = do
sendResponse "foo</input"
resp <- waitForResponse uri
x <- processResponse resp (to produce meaningful value from raw HTTP request)
return x -- could even loop here again to 'external'
test = page $ do
i <- getInt Nothing
e <- external "/baz" -- this won't pass further unless there will be request ready at the specified URI
-- ...


Reply to this email directly or view it on GitHub
#50.

@BartAdv
Copy link
Contributor Author

BartAdv commented Aug 4, 2014

Hah! This looks waay simplier than what I've envisioned, and should just do the trick - thanks.

@BartAdv BartAdv closed this as completed Aug 4, 2014
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

No branches or pull requests

2 participants