What does Haskell mean?

I am trying to understand an example from plotlyhs :

plotly "div6"
    [points (aes & x .~ sepalLength 
                 & y .~ sepalWidth
                 & color ?~ (fromEnum . irisClass)) iris]
    & layout . margin ?~ thinMargins
    & layout . height ?~ 300

But I do not know what it means &. Also I can’t say that this is Google.

I do not know what .~or means ?~, but, I think, I ask other questions for them.

+4
source share
1 answer

Most likely you are using the inverse function application operator defined as

(&) :: a -> (a -> b) -> b
a & f = f a

This is just an upside down version ($), often used in GUI libraries and other things where it makes sense to “apply” functions and modifiers to existing values.

textbox & onClick foo & enabled

looks better and often easier than

enabled . onClick foo $ textbox

who reads backwards in a way. To find out what you are talking about, you need to start on the right side.

+5
source

Source: https://habr.com/ru/post/1692167/


All Articles