question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optimizing type checks for point free compositions.

See original GitHub issue

In light of fantasy land’s move to prefixing, we’ll probably find ourselves using pipe more frequently.

S.pipe gives us a lot of information about types and code paths quite early. In #383 I’m positing that we may be able to get type errors before applying the value. Here I’d like to discuss potentially skipping type checks for all but the first sub-function application in a pipeline when a value is applied.

If we can assume the behaviour described in #383 is implemented, then we could theoretically assume that if an exception hasn’t thrown yet, that the pipeline is valid, and the only invalid case remaining is invalid input.

Again, this may not be feasible, but seems like a huge win for performance if it is possible. A lot of us will be composing point free S functions in pipelines, it is the common case. So optimising that case seems valuable to me. Also both suggestions shouldn’t require any changes to sanctuary-def itself. It’s simply a sanctuary implementation concern.

I’d appreciate any critiques / thoughts / suggestions. 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
davidchamberscommented, Apr 18, 2017

This is an interesting proposal. There are many Sanctuary-related tasks and features which I consider more important, though, so realistically any such change will need to come from another contributor. I’m happy to provide guidance and feedback to anyone interested in exploring these ideas.

0reactions
davidchamberscommented, May 28, 2018

I’m going to close this issue as it is not actionable, but you are all welcome to post additional comments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Type Checking (Guide) - Real Python
In this guide, you'll look at Python type checking. Traditionally, types have been handled by the Python interpreter in a flexible but implicit...
Read more >
GHC optimization and fusion - Posts
Like other pragmas, the RULES pragmas are always checked for scope errors, and are typechecked. Typechecking means that the LHS and RHS of...
Read more >
How point-free composition will make you a better functional ...
"Point-free style — aims to reduce some of the visual clutter by removing unnecessary parameter-argument mapping.
Read more >
Verified Optimizations for Functional Languages
CertiCoq's middle-end pipeline performs crucial optimizations for functional languages including closure conversion, uncurrying, shrink-reductions and inlining.
Read more >
GHC optimization and fusion - Stack Builders
Like other pragmas, RULE pragmas are always checked for scope errors, and are typechecked. Typechecking means that the LHS and RHS of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found