This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Infix functions for tupling
version 1.1.1
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.1.1
Committed At 2017-12-04 03:43:12 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

Tuple-Infix (&, :=)

In nearly all of my Elm projects, I use these two infix functions: & and :=. They both tuple, but I use them differently. & is used just to tuple two random things, like at the end of an update function.

  Noop ->
    model & Cmd.none

:= I use whenever the tuple is being used to "define" the left value as the right, as I do in inline styles and json encoding ("left" = "16px" or "type" := Encode.string type_)

  div
    [ style [ "left" := "40px" ] ]
    []

packJsMsg : String -> Encode.Value -> Encode.Value
packJsMsg type_ payload =
  [ "type" := Encode.string type_
  , "payload" := payload
  ]
    |> Encode.object