squiggle/packages/squiggle-lang/src/rescript/Utility/Declaration.res

25 lines
486 B
Plaintext
Raw Normal View History

2022-05-24 21:02:27 +00:00
@genType
type arg = Float({min: float, max: float}) | Date({min: Js.Date.t, max: Js.Date.t})
2022-05-24 21:02:27 +00:00
@genType
type declaration<'a> = {
fn: 'a,
args: array<arg>,
}
2022-05-24 21:02:27 +00:00
module ContinuousFloatArg = {
let make = (min: float, max: float): arg => {
2022-05-24 21:02:27 +00:00
Float({min: min, max: max})
}
}
module ContinuousTimeArg = {
let make = (min: Js.Date.t, max: Js.Date.t): arg => {
Date({min: min, max: max})
2022-05-24 21:02:27 +00:00
}
}
let make = (fn: 'a, args: array<arg>): declaration<'a> => {
{fn: fn, args: args}
2022-05-24 21:02:27 +00:00
}