[elm-discuss] Re: How to integrate JS library that changes DOM (eg KaTeX)

2017-02-16 Thread vishesh
Nice, this totally works! Is there a way to not have to specify keys for *every* child? Instead only specify keys on the children that need it? Right now I have view : Model -> Html Msg view model = node "div" [] [ ( "textarea", textarea [ onInput Change ] [] ) , (

[elm-discuss] Re: How to integrate JS library that changes DOM (eg KaTeX)

2017-02-16 Thread Maxwell Gurewitz
You're going to want to use http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html-Keyed On Tuesday, February 14, 2017 at 5:41:11 PM UTC-8, vis...@stanford.edu wrote: > > Hi all! > > Just started using Elm and I'm really liking it. > > One question I had is whether it is possible to

[elm-discuss] Re: More type checking conundrums

2017-02-16 Thread 'Rupert Smith' via Elm Discuss
On Thursday, February 16, 2017 at 2:59:41 PM UTC, Rupert Smith wrote: > > On Thursday, February 16, 2017 at 2:50:10 PM UTC, Martin Cerny wrote: >> >> I would say not type checking your example is correct behavior. Since all >> occurrences of a type parameter have to resolve to the same type, the

[elm-discuss] Re: More type checking conundrums

2017-02-16 Thread Martin Cerny
I would say not type checking your example is correct behavior. Since all occurrences of a type parameter have to resolve to the same type, the value of test is not defined if b resolves to anything other than String. And thus the compiler expects you to say it is a string. To be more specific,

Re: [elm-discuss] Is type inference in Elm fully decideable?

2017-02-16 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, February 15, 2017 at 8:49:13 PM UTC, Rupert Smith wrote: > > What I don't understand is why this fails to type check: > > mapWhenWithPosition : (WithPosition b -> a) -> State -> Maybe a > mapWhenWithPosition func state = > case state of > Aware rect -> > Just

Re: [elm-discuss] Is type inference in Elm fully decideable?

2017-02-16 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, February 15, 2017 at 10:19:34 PM UTC, Max Goldstein wrote: > > I think this code would be simpler, and no less expressive, if the > function argument was Rectangle -> a. The fact that it's wrapped with some > arbitrary fields is mixing concerns. > Yes, I did in fact start out

[elm-discuss] More type checking conundrums

2017-02-16 Thread 'Rupert Smith' via Elm Discuss
Related to what I looked into with extensible records, I was also curious as to how strict the typing of case statements is. So I tried this: type Val a b = General (a -> b) | Specific (a -> String) test : Val a b -> (a -> b) test val = case val of General func ->