elm-lang/svg does not provide any strong typing for its functions; it's a 
direct exposure of SVG's API, and all of its functions take strings as 
arguments. An incorrectly-formatted string will not break your application 
but will fail to render as you might expect. It looks like this library is 
trying to be more prescriptive about the data types you can use to 
construct SVGs. For example, "viewBox" takes four numbers as opposed to a 
string with four space-separated values. With elm-lang/svg, providing "0 0 
0 foo" will compile but fail to render properly; with this library, it 
won't compile.

This also means you don't need to manually coerce numbers to strings any 
more when working with coordinates in your model that are stored as numbers!

Duane, I've been waiting for something like this for a while. Thanks for 
undertaking the tedium of translating the entire SVG spec and giving it a 
nice, typed interface. Will take a closer look when I get a chance.

On Friday, March 31, 2017 at 7:09:17 AM UTC-4, Rupert Smith wrote:
>
> On Thursday, March 30, 2017 at 4:35:32 PM UTC+1, Duane Johnson wrote:
>>
>> Hi all,
>>
>> I've been working on a TypedSvg package here:
>>
>> http://package.elm-lang.org/packages/canadaduane/typed-svg/2.0.1
>>
>> Its intent is to replace `elm-lang/svg` with a fully typed and documented 
>> SVG package. There's still a lot of work to do (the SVG spec is huge) but 
>> I'm pretty happy with the progress that's been made. I'm announcing this 
>> now so that if others are interested in a similar package, we can 
>> consolidate effort and help one another rather than duplicate effort.
>>
>
> Sound interesting and good timing for me as my next project will involve 
> lots of diagrams and SVG seems the most likely way to render them. Can you 
> explain what the deficiencies of elm-lang/svg are that you are aiming to 
> improve on?
>

-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to