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

Add examples to documentation #18

Closed
wants to merge 1 commit into from

Conversation

ExcaliburZero
Copy link
Contributor

Add some examples of common uses of the library to the documentation.

@mrkkrp
Copy link
Owner

mrkkrp commented Jun 7, 2016

Thanks for caring. A few points here:

  • The example in the header is not valid Haskell. zipPath <- parseRelFile … cannot appear “naked” on the top level. You probably indented this to be executed in GHCi, but then you need to use different markup in Haddocks. I think it's better to write proper Haskell functions instead as it's made in other libraries worknig with Zip archives.
  • The second addition is redundant. Since ZipArchive is a monad, it sure can be combined with (>>). I think trying to repeat basics of Haskell in docs of every package is a futile effort.

You can amend your commit and fix it according to my feedback, or I can change it myself later today.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 85.414% when pulling c3078b4 on ExcaliburZero:doc into 87c16b3 on mrkkrp:master.

@ExcaliburZero
Copy link
Contributor Author

Thanks for the feedback!

I'll change the example to use a function rather than ghci input, and remove the information on combining ZipArchive actions.

When I was first trying to work with this library, the matter of combining multiple actions into a single action was fairly confusing, as I am not very familiar with Haskell. Perhaps it may be a good idea to include an example of working with multiple actions just to make the process more clear.

@mrkkrp
Copy link
Owner

mrkkrp commented Jun 7, 2016

Well, comining monadic actions is a very common thing in Haskell. I think it's safe to assume that users of the library know how to do it. You can pick a book on Haskell that explains that. It's always better to start with a book than exploring things on your own.

@ExcaliburZero
Copy link
Contributor Author

Okay, I've made the changes you mentioned. Let me know if any other changes are needed.

Add some examples of common uses of the library to the documentation.
@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 85.414% when pulling 32d38a0 on ExcaliburZero:doc into 87c16b3 on mrkkrp:master.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 85.414% when pulling 32d38a0 on ExcaliburZero:doc into 87c16b3 on mrkkrp:master.

@mrkkrp
Copy link
Owner

mrkkrp commented Jun 7, 2016

Applied as 692079a. Your Haskell doesn't look idiomatic yet, so went ahead and added some examples of my own. I hope this decision is understandable. Thanks.

@mrkkrp mrkkrp closed this Jun 7, 2016
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

Successfully merging this pull request may close these issues.

None yet

3 participants