2022-09-01 08:05:34 +00:00
|
|
|
λ(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
|
|
|
|
then Any/toTypeUnchecked Integer v
|
2022-09-01 14:41:13 +00:00
|
|
|
else Misc/throw Integer "Failed to coerce object into Integer"
|