Skip to content

Instantly share code, notes, and snippets.

@bbarker
Last active July 2, 2019 17:24
Show Gist options
  • Save bbarker/1a4a41f35a70eca30784b781d5d9037a to your computer and use it in GitHub Desktop.
Save bbarker/1a4a41f35a70eca30784b781d5d9037a to your computer and use it in GitHub Desktop.
Notes on PureScript scripting

Shell Scripting

Snail

Sort of like Ammonite: https://github.com/Thimoteus/purescript-snail

Comments from Justin Woo (PureScript Sunde)

i made a mini library to wrap the parts of node process hell i dont want to deal with and then i mostly use node fs aff for dealing with files https://github.com/justinwoo/purescript-Sunde#example . for parsing args i hate all solutions, so i bring in process.argv as Array String and convert it to List via List.fromFoldable . note that any reasonably executed node file will always be at least length 2 argv: [ "/path/to/node", "/path/to/your/script.js" ]

Did you try purescript-optparse? What's wrong about it?

mostly less things going wrong, no more IDE signatures saying interface{}, etc. i've only used haskell optparse-applicative, and i mostly just don't like sitting there juggling all of the setup and getting some autogenerated bash completion that isnt very useful. but im just some random mastro lindo on the internet

Packaging and Bundling

pkg (packages with nodejs executable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment