mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-27 13:02:42 +03:00
44 lines
571 B
Elm
44 lines
571 B
Elm
module Code exposing
|
|
( string, maybeString
|
|
, maybeFloat
|
|
, bool
|
|
)
|
|
|
|
{-|
|
|
|
|
@docs string, maybeString
|
|
@docs maybeFloat
|
|
@docs bool
|
|
|
|
-}
|
|
|
|
|
|
{-| -}
|
|
string : String -> String
|
|
string s =
|
|
"\"" ++ s ++ "\""
|
|
|
|
|
|
{-| -}
|
|
maybe : Maybe String -> String
|
|
maybe =
|
|
Maybe.map (\s -> "Just " ++ s) >> Maybe.withDefault "Nothing"
|
|
|
|
|
|
{-| -}
|
|
maybeString : Maybe String -> String
|
|
maybeString =
|
|
maybe << Maybe.map string
|
|
|
|
|
|
{-| -}
|
|
maybeFloat : Maybe Float -> String
|
|
maybeFloat =
|
|
maybe << Maybe.map String.fromFloat
|
|
|
|
|
|
{-| -}
|
|
bool : Bool -> String
|
|
bool =
|
|
Debug.toString
|