importHtmlexposing(br,div,text)typealiasStringablea={stringable:a->String}-- Basics.toString going to Debug.toString in Elm 0.19 right?toString:Stringablea->a->StringtoString{stringable}x=stringablex-- Primitive Types (The basic types built-into Elm: Int, Char, Float, ...):int:StringableIntint={- Obviously this will be changed with Int.toString in 0.19 -}{stringable=\x->Basics.toStringx}char:StringableCharchar={- Obviously this will be changed with Char.toString in 0.19 -}{stringable=\x->Basics.toStringx}float:StringableFloatfloat={- Obviously this will be changed with Float.toString in 0.19 -}{stringable=\x->Basics.toStringx}-- Composite Types: (List, Array, ... but also custom made like Tree)list:Stringablea->Stringable(Lista)listnestedStringable={stringable=\xs->letstr=xs|>List.map(toStringnestedStringable)|>List.reverse|>List.foldl(\ab->a++", "++b)""|>String.dropRight2in"[ "++str++" ]"}-- Custom types built with primitive (core Elm) typestypealiasFooBar={foo:Int,bar:Char}typeBazQux=BazQuxIntfoobar:StringableFooBarfoobar={stringable=\{foo,bar}->"FooBar { "++"foo: "++toStringintfoo++", bar: "++toStringcharbar++" }"}bazqux:StringableBazQuxbazqux={stringable=\(BazQuxx)->"BazQux "++toStringintx}-- Usage:example00=letstr=[42.0,43.0,44.0]|>toString(listfloat)in"-- List of Floats: "++strexample01=letstr=toStringfoobar(FooBar42'c')in"-- Custom (product) type: "++strexample02=letstr=toStringbazqux(BazQux42)in"-- Custom (sum) type: "++strmain=div[][textexample00,br[][],textexample01,br[][],textexample02,br[][]]