mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 06:05:31 +03:00
Add Validation.value helper to get maybe parsed value.
This commit is contained in:
parent
1a588ed576
commit
4771b9f476
@ -1,9 +1,14 @@
|
||||
module Form.Validation exposing (Validation, andMap, andThen, fail, fromMaybe, fromResult, map, map2, parseWithError, succeed, withError, withErrorIf, withFallback)
|
||||
module Form.Validation exposing
|
||||
( Validation, andMap, andThen, fail, fromMaybe, fromResult, map, map2, parseWithError, succeed, withError, withErrorIf, withFallback
|
||||
, value
|
||||
)
|
||||
|
||||
{-|
|
||||
|
||||
@docs Validation, andMap, andThen, fail, fromMaybe, fromResult, map, map2, parseWithError, succeed, withError, withErrorIf, withFallback
|
||||
|
||||
@docs value
|
||||
|
||||
-}
|
||||
|
||||
import Dict exposing (Dict)
|
||||
@ -33,6 +38,12 @@ withFallback parsed (Validation name ( maybeParsed, errors )) =
|
||||
)
|
||||
|
||||
|
||||
{-| -}
|
||||
value : Validation error parsed named -> Maybe parsed
|
||||
value (Validation _ ( maybeParsed, _ )) =
|
||||
maybeParsed
|
||||
|
||||
|
||||
{-| -}
|
||||
parseWithError : parsed -> ( String, error ) -> Validation error parsed Never
|
||||
parseWithError parsed ( key, error ) =
|
||||
|
Loading…
Reference in New Issue
Block a user