stoeffel / elm-verify / Dict.Verify

Functions to verify properties of a Dict.

notEmpty : error -> Dict a b -> Result ( error, List error ) (Dict a b)

Fails if a Dict is empty.

import Dict

notEmpty "error" <| Dict.empty
--> Err ( "error" , [])

notEmpty "error" <| Dict.fromList [ (1, 1) ]
--> Ok <| Dict.fromList [ (1, 1) ]