11 lines
367 B
Text
11 lines
367 B
Text
λ(nix : ../NixPrelude.dhall) →
|
|
let Any = ../Any/Type.dhall
|
|
|
|
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
|
|
|
|
let Misc/throw = ../Misc/throw.dhall nix
|
|
|
|
in λ(v : Any) →
|
|
if nix.builtins.isInt v || nix.builtins.isFloat v
|
|
then Any/toTypeUnchecked Double v
|
|
else Misc/throw Double "Failed to coerce object into Double"
|