diff options
author | Joris | 2019-08-07 21:27:59 +0200 |
---|---|---|
committer | Joris | 2019-08-07 21:27:59 +0200 |
commit | fc8be14dd0089eb12b78af7aaaecd8ed57896677 (patch) | |
tree | 22bcd64c7ef3f21aa067ca81824f0e0a2ce6b631 /client/src/Util | |
parent | bc81084933f8ec1bfe6c2834defd12243117fdd9 (diff) |
Update category according to payment in add overlay
Diffstat (limited to 'client/src/Util')
-rw-r--r-- | client/src/Util/Validation.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/Util/Validation.hs b/client/src/Util/Validation.hs index e2a3dcb..fc13f36 100644 --- a/client/src/Util/Validation.hs +++ b/client/src/Util/Validation.hs @@ -1,7 +1,8 @@ module Util.Validation - ( fireValidation + ( nelError + , toMaybe + , fireValidation , fireMaybe - , nelError ) where import Control.Monad (join) @@ -16,6 +17,10 @@ import qualified Reflex.Dom as R nelError :: Validation a b -> Validation (NonEmpty a) b nelError = Validation.validation (Failure . NEL.fromList . (:[])) Success +toMaybe :: Validation a b -> Maybe b +toMaybe (Success s) = Just s +toMaybe (Failure _) = Nothing + fireValidation :: forall t a b c. Reflex t => Dynamic t (Maybe (Validation a b)) |