2025-04-02 11:22:53 -07:00
|
|
|
import {plain} from './helpers.js'
|
2025-04-10 13:57:05 -07:00
|
|
|
import {BooleanT} from '#boolean/BooleanT.js'
|
|
|
|
|
import {Returns} from '#core/Type.js'
|
|
|
|
|
import {NumberT} from '#number/NumberT.js'
|
2025-03-29 17:12:35 -07:00
|
|
|
|
2025-04-12 07:46:15 -07:00
|
|
|
const num = f => Returns(NumberT, f)
|
|
|
|
|
|
2025-03-30 20:00:07 -07:00
|
|
|
export const number = plain(a => a)
|
2025-04-12 07:46:15 -07:00
|
|
|
number.also(
|
|
|
|
|
BooleanT, num(a => a ? 1 : 0),
|
|
|
|
|
[], num(() => 0)
|
|
|
|
|
)
|