-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
[#54] Improve documentation #57
Conversation
src/Relude/Exception.hs
Outdated
@@ -53,6 +54,7 @@ bug e = impureThrow (Bug (E.toException e) callStack) | |||
writing something like this: | |||
|
|||
@ | |||
isNonCriticalExc :: Exception e => e -> Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, shit, it should have SomeException -> Bool
type
README.md
Outdated
@@ -208,7 +208,11 @@ We also have `data Undefined = Undefined` (which, too, comes with warnings). | |||
|
|||
### Exceptions | |||
|
|||
TODO: write about reexports, `Bug` and `Exc` pattern. | |||
`relude` reexports `Exception` type from `base` package and introduces `bug` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add the
before base
and bug
README.md
Outdated
@@ -208,7 +208,11 @@ We also have `data Undefined = Undefined` (which, too, comes with warnings). | |||
|
|||
### Exceptions | |||
|
|||
TODO: write about reexports, `Bug` and `Exc` pattern. | |||
`relude` reexports `Exception` type from `base` package and introduces `bug` | |||
function as an alternative to `error`. There's also very convenient `Exc` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a very
src/Relude/Base.hs
Outdated
import GHC.Enum (Bounded (..), Enum (..), boundedEnumFrom, boundedEnumFromThen) | ||
import GHC.Float (Double (..), Float (..), Floating (acos, acosh, asin, asinh, atan, atanh, cos, cosh, exp, logBase, pi, sin, sinh, sqrt, tan, tanh, (**))) | ||
import GHC.Generics (Generic) | ||
import GHC.Num (Integer, Num (..), subtract) | ||
import GHC.Real hiding (showSigned, (%)) | ||
import GHC.Real (Fractional (..), Integral (..), Ratio, Rational, Real (..), RealFrac (..), even, | ||
fromIntegral, gcd, lcm, odd, realToFrac, (^), (^^)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about denominator
and numerator
?
src/Relude/Extra/Enum.hs
Outdated
@@ -26,7 +35,12 @@ import qualified Data.Map.Strict as M | |||
universe :: (Bounded a, Enum a) => [a] | |||
universe = [minBound .. maxBound] | |||
|
|||
{- | Creates a function that is the inverse of a given function @f@. | |||
{- | @inverseMap f@ creates a function that is the inverse of a given function | |||
@f@. It does so by constructing 'M.Map' for every value @f a@. Implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation
src/Relude/Extra/Map.hs
Outdated
License: MIT | ||
Maintainer: Kowainik <xrom.xkov@gmail.com> | ||
|
||
Polymorphic grouping functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant.
src/Relude.hs
Outdated
meaning or __theme__. Name of the module should give you hints regarding what | ||
this module contains. Some /themes/ contain a great amount of both reexported | ||
meaning or __category__. Name of the module should give you hints regarding what | ||
this module contains. Some /categories/ contain a great amount of both reexported | ||
functions and functions of our own. To make it easier to understand these huge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huge -> enormous
src/Relude.hs
Outdated
meaning or __theme__. Name of the module should give you hints regarding what | ||
this module contains. Some /themes/ contain a great amount of both reexported | ||
meaning or __category__. Name of the module should give you hints regarding what | ||
this module contains. Some /categories/ contain a great amount of both reexported | ||
functions and functions of our own. To make it easier to understand these huge | ||
chunks of functions, all reexported stuff is moved into separate module with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the separate
src/Relude/Bool/Guard.hs
Outdated
|
||
-- | This module contains monadic predicates. | ||
This module contains monadic boolean combinators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just "Monadic boolean combinators"
src/Relude/Debug.hs
Outdated
-- | Functions for debugging. If you left these functions in your code | ||
-- then warning is generated to remind you about left usages. Also some | ||
-- functions (and data types) are convenient for prototyping. | ||
Functions for debugging. If you left these functions in your code then warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a warning
src/Relude/Extra/CallStack.hs
Outdated
_ -> "<unknown>" | ||
|
||
{- | This function returns the name of its caller of the caller function, but it | ||
requires that the caller function and caller of the caller function has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has -> have
src/Relude/List/Reexport.hs
Outdated
@@ -7,7 +7,7 @@ Copyright: (c) 2016 Stephen Diehl | |||
License: MIT | |||
Maintainer: Kowainik <xrom.xkov@gmail.com> | |||
|
|||
This module reexports functinons to work with list and 'NonEmpty'. | |||
Reexports most of the "Data.List" and "Data.List.NonEmpty". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these "" are intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrom911 yes, they give links to modules. In Haddock we need to use single quotes to link to function or types and double quotes to link to modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a huge work!
Resolves #54
See
CHANGELOG.md
for list of changes. Some of them are breaking. But that's okay, since we're going to release new major version anyways.