[elm-discuss] Re: Unexpected compiler behaviour and message "pattern is redundant".

2017-07-10 Thread jadski
Thanks. I wasn't aware of that - makes sense. -- 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

[elm-discuss] Re: Unexpected compiler behaviour and message "pattern is redundant".

2017-07-09 Thread jadski
With manual formatting *Code* type Message = Good | Bad | ManyOthers type alias Node = { message : Message } trymatch : Node -> Message -> Bool trymatch node messageParam = case node.message of messageParam -> True _ -> False evalTrue = trymatch {

[elm-discuss] Unexpected compiler behaviour and message "pattern is redundant".

2017-07-09 Thread jadski
Hi, I am getting a compiler error that does not make sense to me - can anyone help to explain why this fails to compile? The following code: type Message = Good | Bad | ManyOthers type alias Node = { message : Message } trymatch : Node -> Message -> Bool trymatch node messageParam = case

[elm-discuss] How to generate an html select using Dict.foldl

2017-03-26 Thread jadski
I'm trying to render an html select from a Dict in Elm 0.18, and the compiler complains because Html Msg is not appendable: 12| html ++ ( option [ value ( toString key ) ] [ text val ] ^^ (++) is expecting the right side to be a: appendable But the

Re: [elm-discuss] Re: How to pattern match nested types?

2017-01-30 Thread jadski
t pattern match on things using this syntactic sugar. > > It is still possible to pattern match on a record, you can see how to do > that here: http://elm-lang.org/docs/syntax#records > > On Sun, Jan 29, 2017 at 3:58 PM, jadski <jad...@gmail.com > > wrote: > >> That su

Re: [elm-discuss] Re: How to pattern match nested types?

2017-01-29 Thread jadski
g fields, i.e. as "Foo x y...". But I guess > you're not allowed to pattern match with it? > > On Sun, Jan 29, 2017 at 3:08 PM, jadski <jad...@gmail.com > > wrote: > >> Though I still don't understand why the compiler says Http does not >> expose Respons

[elm-discuss] Re: How to pattern match nested types?

2017-01-29 Thread jadski
Fixed - the correct solution is: import Http exposing ( .. ) httpErrorString : Http.Error -> String httpErrorString error = case error of Http.BadStatus ( response ) -> "bad status [" ++ response.body ++ "]" For anyone else confused, the problem is a misunderstanding of

[elm-discuss] How to pattern match nested types?

2017-01-29 Thread jadski
I'm using Elm 0.18 and trying to convert http errors into strings. The simple module below: import Http exposing ( .. ) httpErrorString : Http.Error -> String httpErrorString error = case error of Http.BadStatus ( Response response ) -> "bad status [" ++ response ++ "]"