From 18b03245781c19ce2f29e2f416c89ae28f9062ee Mon Sep 17 00:00:00 2001 From: Patrycja Balik Date: Thu, 12 Dec 2024 16:54:08 +0100 Subject: [PATCH] Use new comment syntax in Assert --- lib/Base/Assert.fram | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/Base/Assert.fram b/lib/Base/Assert.fram index e2ce2ca..938b25e 100644 --- a/lib/Base/Assert.fram +++ b/lib/Base/Assert.fram @@ -1,19 +1,21 @@ -(* This file is part of DBL, released under MIT license. - * See LICENSE for details. - *) +{# This file is part of DBL, released under MIT license. + # See LICENSE for details. + #} import open Types -(** Abort the program with given message. +{## Abort the program with given message. Note that this function is pure. In correct programs, this function should - be never called at runtime, but it can be used to appease the type-checker. + never be called at runtime, but it can be used to appease the type-checker. Use this function only in impossible match clauses or in case of gross - violation of function preconditions (e.g., division by zero). *) + violation of function preconditions (e.g., division by zero). + #} pub let runtimeError {type T} = (extern dbl_runtimeError : String ->[] T) -(** Explicitly assert, that this case is impossible *) +{## Explicitly assert that this case is impossible. + #} pub let impossible {?msg : String} () = runtimeError match msg with @@ -21,7 +23,8 @@ pub let impossible {?msg : String} () = | Some msg => msg end -(** Assert, that given condition should always hold. *) +{## Assert that given condition should always hold. + #} pub let assert {?msg} b = if b then () else