query
On this page

isConvertibleWithToString

lib.strings.isConvertibleWithToString

Docs pulled from | This Revision | 10 minutes ago


Check whether a list or other value x can be passed to toString.

Many types of value are coercible to string this way, including int, float, null, bool, list of similarly coercible values.

Inputs

val
1. Function argument

Type

isConvertibleWithToString :: a -> bool

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

isConvertibleWithToString =
    let
      types = [
        "null"
        "int"
        "float"
        "bool"
      ];
    in
    x: isStringLike x || elem (typeOf x) types || (isList x && lib.all isConvertibleWithToString x);