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
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 {
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
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
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
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
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
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 ++ "]"