disco icon indicating copy to clipboard operation
disco copied to clipboard

Make min/max prefix, and add infix operators like `↓` and `↑`

Open byorgey opened this issue 3 years ago • 3 comments

Infix max, min are weird and nonstandard.

byorgey avatar Apr 30 '21 18:04 byorgey

While we're at it, could max and min just be standard library functions?

byorgey avatar May 25 '21 18:05 byorgey

To define min and max as standard library functions depends on #179. For example:

min : a * a -> a [comparable a]
min(x,y) = {? x if x <= y, y otherwise ?}

Once we have #136 we could also define infix synonyms. I'm actually partial to Dijkstra's notation and and for min and max, respectively.

byorgey avatar Jun 28 '21 23:06 byorgey

We shouldn't wait for #179; we should go ahead and make min and max prefix.

  • A first pass would be to just remove them from Syntax.Operators and add them as prims.
  • Or, instead of removing them, we could change the syntax in Syntax.Operators to and . The tricky thing is that we need some ASCII syntax for them as well...

byorgey avatar May 19 '22 16:05 byorgey