- Overview
- Types And Modules
- Helpers
- Discriminated Union Identity Values
- Exception-free Processing
- Issues, Questions, and Suggestions
- Dependencies
- Usage
This QuickData.Core.FSharp package contains the QuickData.FSharp namespace for F# developers
which provides some types and their related functions, and also some helper functions.
IMPORTANT: There's not a lot that you can do with this package by itself and it is recommended that you install one or more of the other QuickData.FSharp packages instead which will install this package. However, to get the best from the other
QuickData.FSharppackages you should understand the types and modules implemented here as they are used extensively in those other packages.
For more information about the types, modules, and functions provided, links are provided below.
Note: You can use IntelliSense in your code editor to get more information about each type and function.
The types provided, with associated modules, are (in alphabetical order):
| Type/Module | Defines/Specifies |
|---|---|
| DenormalisationRange | A range used to convert Normals to floats |
| Digit *1 | Integer values (DU cases) between zero and nine (inclusive) |
| ExpansionRange | A range used to convert Variances to floats |
| Normal | Values between 0.0 and +1.0 (inclusive) |
| NormalisationRange | A range used to convert floats to Normals |
| Variance | Values between -1.0 and +1.0 (inclusive) |
- *1 : Used primarily by the
QuickData.Digits.FSharppackage.
Some modules exist which provide some helper functions which might be useful, and these are (in alphabetical order):
| Module | Useful When Using |
|---|---|
| Array2DHelpers | 2D Arrays |
| CharHelpers | Characters |
| ListHelpers | Lists |
| MathHelpers | Numbers |
| RandomHelpers | Random Numbers |
| SeqHelpers | Sequences |
| StringHelpers | Strings |
In all of the QuickData.FSharp packages, where a discriminated union exists to specify a parameter for a function,
there often will be two functions related to that discriminated union which return an integer identity value from the union
case - toInt - or return a union case from an integer identity value - fromInt.
These can be useful if you need to store a value in a data structure which does not cater for discriminated unions, e.g. in a file, in JSON, etc.
The toInt function will always return a valid identity value.
Notes:
Where a
fromIntfunction exists there often will be exception-free versions available.All valid identity values are in the range 100 to 999 (inclusive). Any value which has fewer, or more, than three digits can be immediately identified as being invalid, but not all three-digit values are valid.
While identity values are unique within a discriminated union, some identity values may be shared by cases in different discriminated unions but no functional equality or relationship between the two should be inferred. Identity values will not change unless specifically mentioned in the release notes.
The defaultCase value (where available) contains the default case for the discriminated union.
The allCases value (where available) contains a list of all of the cases for the discriminated union.
In all of the QuickData.FSharp packages, some functions will raise an exception if the internal processing fails for some reason or if the input was not as expected.
Many of this type of function will also have alternative exception-free versions which do not raise an exception.
These alternative functions are:
<module-name>.FailSafe.<function-name>: Returns a default value, instead of raising an exception;<module-name>.Option.<function-name>: ReturnsNoneinstead of raising an exception, otherwiseSome value;<module-name>.Result.<function-name>: ReturnsError <error-type>instead of raising an exception, otherwiseOk value.
In general, but not always (as documented elsewhere), if there is no exception-free version of a function then it can be assumed that the function will not raise an exception.
You can visit the QuickData.FSharp GitHub repository to report issues, ask questions, or make suggestions. You can also read about the changes across different versions in the release notes there.
This package has no dependencies other than FSharp.Core which you will be using anyway.
Note: This package will normally be automatically installed if you install any other QuickData.FSharp package, so you normally don't need to manually install this package yourself.
The types and functions in this package have been designed to be used only with F#.
However, they may also be usable with C# but this has not been tested, so use them with C# at your own risk.