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

is rhsOf an effect or a query? #1

Open
andygill opened this issue May 27, 2015 · 2 comments
Open

is rhsOf an effect or a query? #1

andygill opened this issue May 27, 2015 · 2 comments

Comments

@andygill
Copy link
Member

Translating

rhs-of 'binder

we can have two alternatives

rhsOf 'binder :: Effect () -- goto the right hand side of binder

or

rhsOf 'binder :: Effect LocalPath -- return the path to the right hand side of binder

The second one is cleaner, more modular, but more of a hassle to use; for example:

goto =<< rhsOf' binder
@andygill andygill changed the title is rhsOf an effect or a query? is rhsOf an effect or a query? May 27, 2015
@xich
Copy link
Member

xich commented May 28, 2015

In the current shell we overload it so it is both. That is, you can:

focus (rhs-of 'foo) (some rewrite)
rhs-of 'foo -- go to foo

It has a type like the second alternative you listed. Top-level queries
that return paths are just interpreted specially as 'goto's
On May 28, 2015 12:15 PM, "Andy Gill" [email protected] wrote:

Translating

rhs-of 'binder

we can have two alternatives

rhsOf 'binder :: Effect () -- goto the right hand side of binder

or

rhsOf 'binder :: Effect LocalPath -- return the path to the right hand side of binder

The second one is cleaner, more modular, but more of a hassle to use; for
example:

goto =<< rhsOf' binder


Reply to this email directly or view it on GitHub
https://github.com/ku-fpg/hermit-ghci/issues/1.[image: Web Bug from
https://github.com/notifications/beacon/AABNAGOjFgCOT8XLWVMgT1bu0QRXLyHwks5oNkhvgaJpZM4EsouY.gif]

@andygill
Copy link
Member Author

So its not so much overloading (both rhs-of uses have the same type) but a property of the top-level shell. So we will need to support rhsOf :: Shell Path

But in the Black shell, you could want to examine the path, using

path <- send (rhsOf "foo") 

What is the semantics of rhs-of 'foo >> rhs-of 'bar. If its a top-level special effect, then you go to bar, otherwise you goto foo (perhaps passing a bar), then bar.

I think if we support the ::Shell Path we need to either

  • Add a setPath/goto primitive; or
  • Add a new type of send (again reusing goto).
goto :: Shell Path -> IO ()

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