opaque distribution type
This commit is contained in:
parent
feb7627ad0
commit
347c85324b
|
@ -6,7 +6,6 @@ type genericDist =
|
|||
|
||||
type asAlgebraicCombinationStrategy = AsDefault | AsSymbolic | AsMonteCarlo | AsConvolution
|
||||
|
||||
@genType
|
||||
type error =
|
||||
| NotYetImplemented
|
||||
| Unreachable
|
||||
|
@ -27,7 +26,6 @@ module Error = {
|
|||
|
||||
let fromString = (s: string): t => OtherError(s)
|
||||
|
||||
@genType
|
||||
let toString = (err: error): string =>
|
||||
switch err {
|
||||
| NotYetImplemented => "Function not yet implemented"
|
||||
|
|
|
@ -18,10 +18,14 @@ type squiggleValue_Declaration = ReducerInterface_InternalExpressionValue.lambda
|
|||
|
||||
@genType.opaque type reducerProject = ReducerProject_T.t
|
||||
|
||||
/* Distribution related */
|
||||
@genType type environment = GenericDist.env
|
||||
@genType.opaque
|
||||
type distributionError = DistributionTypes.error
|
||||
|
||||
// From now on one should introduce any new types as opaque types.
|
||||
// Exception: The intended type is really a JavaScript type or record. Not by coincidence
|
||||
// Already existing open types we cannot dive in now
|
||||
@genType type environment = GenericDist.env
|
||||
@genType type squiggleValue_Distribution = DistributionTypes.genericDist
|
||||
|
||||
//TODO: index.ts should use types from here or vice versa
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
open ForTS__Types
|
||||
/*
|
||||
Global variables, functions, helpers, etc.
|
||||
*/
|
||||
|
||||
@genType
|
||||
let defaultEnvironment: environment = DistributionOperation.defaultEnv
|
|
@ -0,0 +1,4 @@
|
|||
open ForTS__Types
|
||||
|
||||
@genType
|
||||
let toString = (e: distributionError) => DistributionTypes.Error.toString(e)
|
|
@ -20,9 +20,6 @@ type sampleSetDist = SampleSetDist.t
|
|||
@genType
|
||||
type symbolicDist = SymbolicDistTypes.symbolicDist
|
||||
|
||||
@genType
|
||||
type distributionError = DistributionTypes.error
|
||||
|
||||
@genType
|
||||
type resultDist = result_<genericDist, distributionError>
|
||||
|
||||
|
@ -58,8 +55,9 @@ type discreteShape = PointSetTypes.discreteShape
|
|||
@genType
|
||||
type continuousShape = PointSetTypes.continuousShape
|
||||
|
||||
@genType
|
||||
let distributionErrorToString = DistributionTypes.Error.toString
|
||||
// ForTS_Distributions_Error.toString
|
||||
// @genType
|
||||
// let distributionErrorToString = DistributionTypes.Error.toString
|
||||
|
||||
@genType
|
||||
let defaultSamplingEnv = DistributionOperation.defaultEnv
|
||||
|
|
Loading…
Reference in New Issue
Block a user