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 ->
> 105:Ju
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 ->
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 with
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 <
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,
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 value
> of test is not defined if b resolves to anything other than String. A
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 v
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 integ
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 ] [] )
, (