This PR contains a few things, but the major goal is documentation improvements raised in #161
NOTE - It is ready to be merged (modulo the commit squashing), but it is WIP because I'd like to get some feedback on it.
There is a live version of the hadock generated from this PR, which is available here: https://lehins.net/rio/
Few things happed in this PR:
Addition of two public modules:
RIO.Prelude
RIO.Prelude.Types
Inclusion of few functions and types, see ChangeLog for those changes
Rearrangement of RIO module to make it clearer.
One of the biggest issues I have with current RIO module and in fact even with usual Prelude is that those pages are huge. They take very long time to load and it takes ages to scroll through to find anything on them. All this is due to type classes and the list of all instances for each type. It looks like the situation might get improved with future haddock version: haskell/haddock#1007 but as of now that feature is not yet available. Even with all collapsed instances by default, it will still take forever to load a page with that amount of instances on it. For RIO it is especially a problem, since it brings quite a few libraries together, it makes such common classes as Eq, Show, etc. contain a list of instances that are pages and pages long.
The very nice solution IMHO to the above problem is to keep all of the types and type classes on their own page, while separating all of the functions in their own module. Even the functions that are part of the classes (eg. fmap in Functor) will not be exported together with the class itself. See this solution in action:
One other important (possibly breaking) change included in this PR is the MonadFail export. Namely the fail method from Control.Monad.Monad is no longer exported. According to the original proposal, that method will be removed in the next major version of GHC-8.6, so I though it be a good time to prepare RIO for that change.
This PR contains a few things, but the major goal is documentation improvements raised in #161
NOTE - It is ready to be merged (modulo the commit squashing), but it is WIP because I'd like to get some feedback on it.
There is a live version of the hadock generated from this PR, which is available here: https://lehins.net/rio/
Few things happed in this PR:
RIO.Prelude
RIO.Prelude.Types
RIO
module to make it clearer.One of the biggest issues I have with current
RIO
module and in fact even with usualPrelude
is that those pages are huge. They take very long time to load and it takes ages to scroll through to find anything on them. All this is due to type classes and the list of all instances for each type. It looks like the situation might get improved with future haddock version: haskell/haddock#1007 but as of now that feature is not yet available. Even with all collapsed instances by default, it will still take forever to load a page with that amount of instances on it. For RIO it is especially a problem, since it brings quite a few libraries together, it makes such common classes asEq
,Show
, etc. contain a list of instances that are pages and pages long.The very nice solution IMHO to the above problem is to keep all of the types and type classes on their own page, while separating all of the functions in their own module. Even the functions that are part of the classes (eg.
fmap
inFunctor
) will not be exported together with the class itself. See this solution in action:RIO.Prelude
RIO.Prelude.Types
One other important (possibly breaking) change included in this PR is the
MonadFail
export. Namely thefail
method fromControl.Monad.Monad
is no longer exported. According to the original proposal, that method will be removed in the next major version of GHC-8.6, so I though it be a good time to prepare RIO for that change.