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

Use cases for Hawk #59

Open
melrief opened this issue Aug 21, 2013 · 1 comment
Open

Use cases for Hawk #59

melrief opened this issue Aug 21, 2013 · 1 comment

Comments

@melrief
Copy link
Collaborator

melrief commented Aug 21, 2013

I propose to use this issue to put all the interesting problems that can be solved with Hawk that we have in mind and then select the most interesting to show in the readme.
I start with some use cases:

  • convert a unix timestamp from/to a readable date: a simple function in Prelude.hs should do the magic
  • convert an integer representing bytes into a readable value, like 28461575 -> 28M: a simple function in Prelude.hs should do the magic
  • highlight some text using a regexp to select it: we need the library to color the output, then it's easy
  • print a range of lines, like from the 3rd to the 11th lines: take (11-3) . drop 3
  • translate based on a dictionary: this is more difficult because we need to load the dictionary...maybe we should add the possibility to take in input more than one file and/or stream and then find a way to work on both of them. This is difficult IMHO...
@gelisam
Copy link
Collaborator

gelisam commented Aug 21, 2013

In the readme, I would prefer to focus on uses which don't require a fancy prelude. This way, readers can easily recognize that the expression is ordinary haskell code, which they could write themselves, and then decide that they would indeed like to write haskell from the command-line.

With a complicated prelude, we can make much more impressive demonstrations, but it would demonstrates the flexibility of haskell, not that of hawk. We should, of course, include at least one complicated example in order to demonstrate that a complicated prelude can allow you to add support for anything, but I don't think we should focus on that.

One way in which the prelude could be sensibly demonstrated while focussing on hawk's strengths is by structuring the readme around the various input and output formats supported by hawk. Somebody opened an issue about adding yaml support; after sections titled "list of lines" and"tab-separated tables", we could have a section titled "and every other formats" demonstrating that custom formats such as yaml can easily be added by writing a short snipped it the prelude.

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