Add Form.Value module.

This commit is contained in:
Dillon Kearns 2022-01-16 14:31:19 -08:00
parent d5478db009
commit 43a227d22c

View File

@ -0,0 +1,39 @@
module Form.Value exposing (Value, toString)
import Date exposing (Date)
type Value dataType
= Value String
toString : Value dataType -> String
toString (Value rawValue) =
rawValue
date : Date -> Value Date
date date_ =
date_
|> Date.toIsoString
|> Value
float : Float -> Value Float
float float_ =
float_
|> String.fromFloat
|> Value
int : Int -> Value Int
int int_ =
int_
|> String.fromInt
|> Value
string : String -> Value String
string string_ =
string_
|> Value