Skip to content

Commit

Permalink
[ doc, upstream ] Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
buzden committed Jul 26, 2023
1 parent abd542a commit 174aada
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ genMoreStrings : Gen NonEmpty String
genMoreStrings = oneOf [genSomeStrings, elements ["more", "even more"]]
```

> [!NOTE]
>
> [!NOTE]\
> All generators listed in `oneOf` are meant to be distributed uniformly between each other as a whole thing.
> That is, in `genMoreStrings` values `"one"`, `"two"` and `"three"` have the same probability to be generated
> and this probability is `2/3` of probability for `"more"` or `"even more"` to appear.
Expand All @@ -69,8 +68,7 @@ genMoreStrings'' : Gen NonEmpty String
genMoreStrings'' = oneOf $ alternativesOf genMoreStrings ++ alternativesOf (elements ["more", "even more"])
```

> [!NOTE]
>
> [!NOTE]\
> There are also functions based on the `alternativesOf`, allowing to map values from all alternatives in a single expression
> named `mapAlternativesOf` and `mapAlternativesWith`.
Expand All @@ -89,8 +87,7 @@ genListsN genA (S n) = oneOf $ [| [] |]
Distribution of lengths of lists produced by this generator is uniform,
thanks to `alternativesOf` function.

> [!NOTE]
>
> [!NOTE]\
> If we were not using `alternativesOf` at all (say, with expression `[| genA :: genListsN genA n |]`),
> probability of getting a list of length `n+1` would be 2 times *less* than getting a list of length `n`.
Expand All @@ -103,8 +100,7 @@ genStrPairs : Gen NonEmpty X
genStrPairs = [| MkX genSomeStrings genMoreStrings |]
```

> [!NOTE]
>
> [!NOTE]\
> The number of alternatives acquired by `alternativesOf` function of an applicative combination
> of two generators is a product of numbers of alternatives of those generators.
Expand Down Expand Up @@ -194,8 +190,7 @@ main_genAnyFin''_alternatives_count_corr : IO ()
main_genAnyFin''_alternatives_count_corr = putStrLn $ show $ length (alternativesOf $ genAnyFin'' @{elements [1, 2]}) == 1
-->

> [!NOTE]
>
> [!NOTE]\
> Search for alternatives through the series of monadic binds can go to the first generator that
> is produced with no alternatives.
>
Expand Down Expand Up @@ -258,8 +253,7 @@ namespace ForgetStructureNote
main_forgetAlternatives_note_ex3_alternatives_sq_count_corr = putStrLn $ show $ 3 == length (deepAlternativesOf 2 g3)
-->

> [!NOTE]
>
> [!NOTE]\
> Please notice that `deepAlternativesOf` can "see" through `forgetAlternatives`, so count of deep alternatives of depth `2`
> for the third case would still be `3`.
> If you really need to hide the full structure even from the `deepAlternativesOf`, you can be much stronger version called
Expand Down Expand Up @@ -343,8 +337,7 @@ For example, for now, we do not support type-polymorphic types and
GADTs which have function calls in type indices of their constructors.
However, we are constantly working for widening supported types.

> [!NOTE]
>
> [!NOTE]\
> For now, derivation is supported only for `MaybeEmpty` generators.
<!-- Example of non-trivial derivation should go here -->
Expand All @@ -355,8 +348,7 @@ More on design of derivator can be found in [documentation](https://deptycheck.r

For building and testing we use [`pack`](https://github.com/stefan-hoeck/idris2-pack/) package manager.

> [!NOTE]
>
> [!NOTE]\
> Notice, that we've gone mad as far as possible, so even calling for makefile of Sphinx for building documentation
> is done through `pack` and `prebuild` action inside an appropriate `ipkg` file.
>
Expand Down

0 comments on commit 174aada

Please sign in to comment.