Comments (5)
I don't see that a syntax like that offers any significant benefits over our current
a => concatPrint(b)
What does Haskell do about operator precedence?
from qtspecs.
actually the =>
observations is pretty relevant, I don't especially use it (as its a tad contrary to my intuition/indoctrination elsewhere).
but lets carry on a tiny bit more (though i suspect you've undermined the motivation enough already)
so you can do this (and use it as a use case)
ghci> pure (+) <*> Just 3 <*> Just 5
Just 8
so here we're taking the normal operator + and then adding 2 maybe int
s
(this sort of thing is only really useful (to me) if its targeted as a specific domain, not as a general style - though others will vehemently disagree)
so in XPath world thats (something like - don't take this too literally)
pure((+)) => maybe:apply(maybe:some(3)) => maybe:apply(maybe:some(5))
ew....though what I'm suggesting isn't much better.
pure((+)) 'maybe:apply' maybe:some(3) 'maybe:apply' maybe:some(5)
backtick operators have fixed precedence and are left associative.
tbh, I don't think my suggestion is really powerful enough to make my expressions 'elegant',
I was wondering if there was an easy preprocessing of the expression that could be done that would introduce user defined expressions into the language without too much cost.
But I'm doubting if there is much benefit.
I'll try using =>
and see how far it gets me.
from qtspecs.
closing, I think this is premature without me trynig out '=>' more
from qtspecs.
I'm not reopening the issue because it's not a serious proposal, but a bit of fun would be to allow all Unicode non-ASCII math symbols such as ≈ to be used as function names and possibly as binary operators, e.g.
declare %precedence(6) function ≈ ($x as xs:numeric, $y as xs:numeric) as xs:boolean {
return abs($x - $y) lt 1e-9
}
from qtspecs.
from qtspecs.
Related Issues (20)
- Names of private functions in XQuery library modules HOT 4
- Specs: new vs. updated features HOT 3
- map:get and array:get HOT 34
- Occurrence indicator meaning "exactly one" HOT 8
- In the EBNF, use explicit separator syntax
- Further improvements to BuiltInKeywords test needed HOT 3
- fn:round: `rounding-mode` → `mode`? HOT 1
- (type)switch: braces after `case` keyword HOT 2
- Unknown option: FORG0013 → XPTY0004 HOT 2
- XQFO: Editorial HOT 1
- Duplicate keys in map constructor HOT 3
- XSLT: names of functions in pattern HOT 3
- Circular dependencies: XQDY0054 vs. XPST0008 vs. optional errors HOT 5
- fn:parse-uri: Observations (cont.) HOT 4
- Missing XSLT error code
- Quantifier expressions: optional positional argument HOT 1
- fn:build-uri: Observations HOT 7
- fn:while-do: Optional error: will not terminate HOT 1
- Annotations: duplicate names HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtspecs.