From 8d70d18f4d64f3b82f148dbd54ac5bd2b1cf0c06 Mon Sep 17 00:00:00 2001 From: demo Date: Tue, 2 Jun 2026 13:57:30 -0400 Subject: feat: simplify API to avoid double negatives --- hamlet.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hamlet.go b/hamlet.go index 76cc3b6..de71aca 100644 --- a/hamlet.go +++ b/hamlet.go @@ -10,18 +10,10 @@ func (a Assertion) Assert() bool { return a.truth } -func (a Assertion) Deny() bool { - return !a.truth -} - -func Present(v any) Assertion { +func New(v any) Assertion { return Assertion{!reflect.ValueOf(v).IsZero()} } -func Absent(v any) Assertion { - return Assertion{reflect.ValueOf(v).IsZero()} -} - // Not computes ~a, given assertion a. func Not(a Assertion) Assertion { negation := !a.truth -- cgit v1.2.3