Create a String representation of a Maybe instance.
A Just instance will be Just(<representation of the value>),
where the representation of the value is simply the value's own toString
representation. For example:
call
output
toString(Maybe.of(42))
Just(42)
toString(Maybe.of([1, 2, 3]))
Just(1,2,3)
toString(Maybe.of({ an: 'object' }))
Just([object Object])
toString(Maybe.nothing())
Nothing
Type Parameters
T
The type of the wrapped value; its own .toString will be used
to print the interior contents of the Just variant.
Create a
String
representation of aMaybe
instance.A
Just
instance will beJust(<representation of the value>)
, where the representation of the value is simply the value's owntoString
representation. For example:toString(Maybe.of(42))
Just(42)
toString(Maybe.of([1, 2, 3]))
Just(1,2,3)
toString(Maybe.of({ an: 'object' }))
Just([object Object])
toString(Maybe.nothing())
Nothing