dhall-nix-lib/Misc/warn.dhall

18 lines
475 B
Text

λ(nix : ../NixPrelude.dhall) →
let Any/toAny = ../Any/toAny.dhall nix
let Any/toTypeUnchecked = ../Any/toTypeUnchecked.dhall nix
let warn
: Text → ∀(a : Type) → a → a
= λ(text : Text) →
λ(a : Type) →
λ(v : a) →
Any/toTypeUnchecked
a
( nix.builtins.trace
(Any/toAny Text "\u001B[1;31mwarning: ${text}\u001B[0m")
(Any/toAny a v)
)
in warn