Skip to content

Various documentation improvements#82

Merged
chessai merged 1 commit intohaskell-streaming:masterfrom
jhrcek:haddockFixes
Jul 23, 2019
Merged

Various documentation improvements#82
chessai merged 1 commit intohaskell-streaming:masterfrom
jhrcek:haddockFixes

Conversation

@jhrcek
Copy link
Copy Markdown
Contributor

@jhrcek jhrcek commented Jun 4, 2019

Kudos! The haddocks for this library are superior to what's commonly available on hackage.
While reading the docs and playing with the examples I found various minor mistakes that I'm fixing in this PR. I'll probably submit more fixes in the future if you like it.

Comment thread src/Streaming.hs
> intercalates :: Stream f m () -> Stream (Stream f m) m r -> Stream f m r
> unzips :: Stream (Compose f g) m r -> Stream f (Stream g m) r
> separate :: Stream (Sum f g) m r -> Stream f (Stream g) m r -- cp. partitionEithers
> separate :: Stream (Sum f g) m r -> Stream f (Stream g m) r -- cp. partitionEithers
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misplaced paren. Stream takes 3 type params, not 4..

Comment thread src/Streaming/Internal.hs
> mapsPost id = id
> mapsPost f . mapsPost g = mapsPost (f . g)
> mapsPost f = mapsPost f
> mapsPost f = maps f
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This identity was useless. The original intention was probably this, right?

Comment thread src/Streaming/Prelude.hs

Note that it also has the effect of 'Data.Maybe.catMaybes', 'Data.Either.rights'
'map snd' and such-like operations.
@map snd@ and such-like operations.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haddock can't link expressions like this, so using inline code block instead.

Comment thread src/Streaming/Prelude.hs

-}

data Maybe' a = Just' a | Nothing'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move this below the definition of scanned, otherwise haddock doesn't associate the documentation with the scanned function.

Comment thread src/Streaming/Prelude.hs
{-# INLINABLE scanned #-}


{-| Streams the number of seconds from the beginning of action
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like doc comment for a function that has been removed some time ago. I deleted it because it gets merged with the documentation of the following function and is very confusing.

Comment thread src/Streaming/Prelude.hs
"wit" :> ()

>>> S.stdoutLn $ S.take 3 $ S.readFile "stream.hs"
>>> S.readFile "stream.hs" (S.stdoutLn . S.take 3)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed broken example

Comment thread src/Streaming/Prelude.hs
constant factor that will be completely dwarfed when any IO is at issue.

But 'store' / 'copy' is /much/ more powerful, as you can see by reflecting on
But 'store' \/ 'copy' is /much/ more powerful, as you can see by reflecting on
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to escape the slash to avoid interaction with the "italics" markup on the same line.

@jhrcek
Copy link
Copy Markdown
Contributor Author

jhrcek commented Jul 23, 2019

Hello @chessai @treeowl
Not sure who's the right person to ask, but could you please check and possibly merge this PR? I just don't like keeping too many PRs opened :) Thanks!

@chessai
Copy link
Copy Markdown
Member

chessai commented Jul 23, 2019

Sorry. This all looks great! Thanks.

@chessai chessai merged commit 9c11638 into haskell-streaming:master Jul 23, 2019
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.

2 participants