Are you as convinced as you were of the semantics of pattern synonyms?  I can 
see they are the right semantics given a run-time implementation but the 
alternative compile-time implementation has a lot to recommend it.

What exactly is "the alternative compile-time implementation"?

Remember, although pattern synonyms are set up to call a matching function, 
that matching function is often inlined, which reduces the overhead to zero.

I say "often" inlined.  An INLINE pragma for pattern synonyms would be a good 
feature.

Widening to ghc-devs.

Simon


From: Matthew Roberts <matthew.robe...@mq.edu.au>
Sent: 11 February 2019 00:10
To: matthew.picker...@cs.ox.ac.uk; ge...@erdi.hu; Simon Peyton Jones 
<simo...@microsoft.com>; r...@cs.brynmawr.edu
Subject: Performance of pattern synonyms

Hi all,

I am working with someone on a compile-time pattern matching extension and the 
most important prior work is pattern synonyms in Haskell.  I hope you might 
indulge a couple of questions I have not been able to answer myself from the 
literature:

  * [In my 
testing](http://pattern-benchmarks.herokuapp.com/posts/2019-02-09-peano.html<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpattern-benchmarks.herokuapp.com%2Fposts%2F2019-02-09-peano.html&data=02%7C01%7Csimonpj%40microsoft.com%7Cf4d58b9dd66c476d591a08d68fb549cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636854406149018023&sdata=uehvVhVMCpNiYWp7Lr2pRLGqVSqt3gQTACl2kvS9crg%3D&reserved=0>),
 pattern synonyms have remarkable performance, has anyone ever benchmarked them 
before?
  * Do you have - on hand - the hackage data you used in investigating uses of 
pattern synonyms?  I am looking for real-world usage of pattern matching 
extensions.
  * Are you as convinced as you were of the semantics of pattern synonyms?  I 
can see they are the right semantics given a run-time implementation but the 
alternative compile-time implementation has a lot to recommend it.

Thanks for your time,

Matt Roberts
Department of Computing, Macquarie University


_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to