paf31 / purescript-derive-lenses

A little utility to derive lenses and prisms for data types in PureScript
MIT License
41 stars 3 forks source link

How about integrating this code genertor with psc-ide? #13

Closed sudhirvkumar closed 7 years ago

sudhirvkumar commented 7 years ago

@paf31 @kRITZCREEK @nwolverson

How about we integrate this generator with psc-ide & editor plugins? so that we can access this functionality from within the editor? without having to jump to the command line?

kritzcreek commented 7 years ago

Since this just amounts to calling a shell script I'd prefer for this to be added to whatever editor plugin you're using instead of psc-ide. With Emacs for example it's trivial to set this up and if I find some time later I could show you how.

sudhirvkumar commented 7 years ago

@kRITZCREEK would love that... thanks a ton!

sudhirvkumar commented 7 years ago

@kRITZCREEK thinking a bit more about it...

If it was part of psc-ide... then we will have access to AST and we will be able to selectively generate lenses for the type under the cursor. Just like we do the apply suggestion... what is your thought on that?

kritzcreek commented 7 years ago

I think that should happen through either Template PureScript https://github.com/purescript/purescript/issues/140

or a plugin system for psc-ide, but I wouldn't want to special case Profunctor Lenses in the compiler repo just for convenience.

sudhirvkumar commented 7 years ago

@kRITZCREEK plugin system for psc-ide sounds great... Is there any plan for a plugin system?

nwolverson commented 7 years ago

I guess any editor should have capability to fire off a command on the current buffer, but maybe there's a place for a standard code generation/preprocess hook somewhere

paf31 commented 7 years ago

I agree that this should be accomplished using editor key bindings, or one day, possibly Template PureScript.

sudhirvkumar commented 7 years ago

@paf31 Template PureScript sounds good... I am not a big fan of Template Haskell mainly because... I am not sure what code will be generated behind the scenes...

What if... we can write Template PureScript and psc-ide generates the code and then comments out the Template PureScript!

I would prefer seeing the code and using Template PureScript as a helper during development!

Thanks for your time.