You are asking about rewriting the first line, correct?

Flip works on functions that take two arguments. What you are doing is
different... you are piping the output of one function to another.

List.map (tagEncoder >> match) model

On Mon, Jul 4, 2016 at 9:59 AM, Matic Zavadlal <[email protected]>
wrote:

> How can I write this code better?
>
> List.map (\a -> match (tagEncoder a)) model
>
>
> -- additional information
> tagEncoder : Tag -> Value
> tagEncoder tag =
>     Encoder.object [ (tag.field => Encoder.string tag.value) ]
>
> match : Value -> Value
> match value =
>     object [ ("match" => value) ]
>
> type alias Tag =
>     { field : String
>     , value : String
>     }
>
>
> I have tried with with 'flip', but wasn't working...
>
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to