'flip arguments to Elm function call
I am trying to modify the Elm example that shows a single spacer so that it renders multiple spacers of different colors:
import Color exposing (red, blue, yellow)
import Graphics.Element exposing (Element, color, spacer, flow, right)
colors = [ yellow, red, blue ]
presentColors : List Element
presentColors = List.map (color ??? (spacer 30 30)) colors
main : Element
main =
flow right presentColors
However as you can see the function color takes the color argument first and so I cannot create a partially applied version of it for List.map to use.
So how can I flip the arguments to color so that it can be partially applied?
Solution 1:[1]
Flip was removed from elm/core in 0.19. You could try:
pilatch/flip package instead.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Memke |
