Skip to content

Split into modules - #96

Closed
curiousleo wants to merge 3 commits into
interface-to-performancefrom
modules
Closed

curiousleo wants to merge 3 commits into
interface-to-performancefrom
modules

Conversation

@curiousleo

@curiousleo curiousleo commented Apr 16, 2020 •

Copy link
Copy Markdown
Collaborator

Addresses these follow-up items:

(from #83 (comment))


Goals

  • No breakage: System.Random exports everything it used to export in v1.1
  • MonadRandom not to be exported from System.Random because that leads to name clashes
  • Give access to internals from System.Random.Internal

Changes

  • Move all the code from System.Random to System.Random.Internal
  • System.Random.Internal exports everything it contains. To keep the Haddocks clean, we use the "hide" option.
  • System.Random exports only what it used to export in v1.1.
  • System.Random.Monad exports everything that System.Random before this PR exported, that is, everything that System.Random will export plus MonadRandom, monadic adapters, and functions with a MonadRandom constraint.

As a result, code that imports System.Random will continue to work; new code can import System.Random.Monad and everything works (no need to also import System.Random).

Haddocks

The source links in the preview don't work, I don't know why. They do work locally, so I think this is an issue with the GitHub HTML preview.

@curiousleo
curiousleo marked this pull request as ready for review April 16, 2020 11:32
@curiousleo curiousleo changed the title Add System.Random.Internal [WIP] Split into modules Apr 17, 2020
@curiousleo
curiousleo marked this pull request as draft April 17, 2020 07:26
- System.Random.Internal contains all code
- System.Random exports just the subset of the library that was present
  in v1.1, for backwards-compatibility
- System.Random.Monad exports everything present in System.Random, plus
  MonadRandom, the new monadic adapters and all MonadRandom-related
  functions

Haddocks are structured as follows:
- System.Random.Internal is hidden
- System.Random contains a notice that it exists for backwards
  compatibility, and a link to System.Random.Monad for the full
  documentation
- System.Random.Monad contains the full, structured Haddocks
@curiousleo curiousleo changed the title [WIP] Split into modules Split into modules Apr 17, 2020
@curiousleo
curiousleo marked this pull request as ready for review April 17, 2020 09:19
@curiousleo

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #101.

@curiousleo curiousleo closed this Apr 21, 2020
@curiousleo
curiousleo deleted the modules branch May 7, 2020 12:26
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.

1 participant