On Tue, Oct 11, 2016 at 7:36 AM, Ethan Martin <[email protected]>
wrote:

> How does one check against a List containing a certain type? For instance,
> I only want to map all elements of a string through the toString function
> if that list does not already contain strings. The end result would be a
> string resulting from a join.


toString is a bit magical in Elm, and can convert any type to a string. So
you can write your function this way:

import String

anyListToString list = List.map toString list |> String.join ""

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to