Noogλe
search input
Function of the day
Specialized
assertMsgfor checking ifvalis one of the elements of the listxs. Useful for checking enums.Inputs
name-
The name of the variable the user entered
valinto, for inclusion in the error message val-
The value of what the user provided, to be compared against the values in
xs xs-
The list of valid values
Type
assertOneOf :: String -> ComparableVal -> List ComparableVal -> BoolExamples
lib.asserts.assertOneOfusage examplelet sslLibrary = "libressl"; in assertOneOf "sslLibrary" sslLibrary [ "openssl" "bearssl" ] stderr> error: sslLibrary must be one of [ stderr> "openssl" stderr> "bearssl" stderr> ], but is: "libressl"