diff options
author | Joris | 2018-11-01 13:14:25 +0100 |
---|---|---|
committer | Joris | 2019-08-04 21:14:32 +0200 |
commit | 2741f47ef7b87255203bc2f7f7b2b9140c70b8f0 (patch) | |
tree | ea5f685cdf8f3de2efa1113325d45faaa90c977e /common/src/Common/Util | |
parent | 86957359ecf54c205aee1c09e151172c327e987a (diff) |
Implementing client side validation
Diffstat (limited to 'common/src/Common/Util')
-rw-r--r-- | common/src/Common/Util/Validation.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/src/Common/Util/Validation.hs b/common/src/Common/Util/Validation.hs new file mode 100644 index 0000000..f195d95 --- /dev/null +++ b/common/src/Common/Util/Validation.hs @@ -0,0 +1,13 @@ +module Common.Util.Validation + ( isSuccess + , isFailure + ) where + +import Data.Validation (Validation (Failure, Success)) + +isSuccess :: forall a b. Validation a b -> Bool +isSuccess (Failure _) = False +isSuccess (Success _) = True + +isFailure :: forall a b. Validation a b -> Bool +isFailure = not . isSuccess |