alexmingoia / purescript-pux

Build type-safe web apps with PureScript.
https://www.purescript-pux.org
Other
565 stars 76 forks source link

(#) fixity #60

Closed akegalj closed 8 years ago

akegalj commented 8 years ago

Shouldn't (#) from http://www.alexmingoia.com/purescript-pux/docs/API/Pux/Html.html have right fixity instead of left fixity. To me it makes sense to write something like div # h5 # text "lala" but this doesn't work without parenthesis div # (h5 # text "lala") or with Pux.Html.bind div # do h5 # text "lala"

megamaddu commented 8 years ago

Ah, I should have looked here first.. I was just mentioning this in Gitter.. re-including below:


It seems like !, #, and ## would be much easier to use if ! was infixl 1 and #/## were infixr 0.. Are there any specific reasons I'm not thinking of?

I rebound them in my project and it's been working well. For example:

view =
  spectacle
    ! slideTheme
    ! preload assets
    # deck
      ! progress Bar
      ! transition [ Slide, Slide ]
      ! transitionDuration (Milliseconds 500.0)
      ## slides

and

...
        , layout ##
          [ fill # titleText # text "Michael Trotter"
          , fill # titleText # twitterLink
          , fill # titleText # githubLink ]
...
megamaddu commented 8 years ago

Submitted PR #64 for this plus a new one I've been using a bunch: #> Just a shortcut for # text since I found myself typing it over and over and it rarely had sibling elements.