Helpers to convert common types into a String.
Convert a Time.Weekday to a String matching its constructor.
Convert a Dict to a String using nested conversions.
import Dict
fromDict String.fromInt String.fromFloat (Dict.fromList [(1, 1.5)])
--> "Dict.fromList [(1,1.5)]"Convert an Http.Error to a String.
Convert an Http.Response String to a String.
Convert a List to a string using a nested conversion.
fromList String.fromInt [1, 2, 3]
--> "[1,2,3]"Convert a Maybe to a String using a nested conversion.
fromMaybe String.fromInt (Just 1)
--> "Just 1"Convert a Time.Month to a String matching its constructor.
Build a record string for debugging and logging with pairs of keys and string conversion functions, meant to be paired with accessors
fromRecord [ ("hello", .hello >> String.fromInt ) ] { hello = 1 }
--> "{ hello = 1 }"Convert a Set to a string using a nested conversion.
import Set
fromSet String.fromInt (Set.fromList [1, 2])
--> "Set.fromList [1,2]"Convert a String to a debugging version of that String.
fromString "hello \"world\""
--> "\"hello \\\"world\\\"\""Convert a 2-tuple to a string using nested conversions.
fromTuple2 String.fromInt String.fromFloat ( 1, 1.5 )
--> "(1,1.5)"Convert a 3-tuple to a string using nested conversions.
fromTuple3 String.fromInt String.fromFloat String.fromInt ( 1, 1.5, 2 )
--> "(1,1.5,2)"Convert a Json.Decode.Value to a JSON String.
Nest some arguments under a tag, including parentheses when needed. Helpful for printing union type values.
withUnionConstructor "Ok" [ String.fromInt 1 ]
--> "Ok 1"
Convert a Bool to a String matching its constructor.