the-sett / elm-syntax-dsl

A DSL for creating Elm syntax trees and pretty printing Elm source code.
BSD 3-Clause "New" or "Revised" License
20 stars 4 forks source link

`remOp`, `modulo`, `equals` and `notEqal` `BinOp`s #35

Open lue-bird opened 3 years ago

lue-bird commented 3 years ago

The following four infix operators seem fishy:

notEqual =
    BinOp "1/" infixLeft 4

equals =
    BinOp "==" infixLeft 4

↑ These are

  1. not infixLeft, but non-associative operators and
  2. 1/ should be /=
    
    remOp =
    BinOp "rem" infixLeft 7

modulo = BinOp "%" infixLeft 7

↑ These don't exist.

While we're at it: There's a small mistake in the `binOp` doc:
```diff
{-| Creates a binary operator in its prefix form, as a bracketed expression.
    binOp equals
Yields:
-    (=)
+    (==)
 -}
binOp : BinOp -> Expression