Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nemetroid
on Aug 20, 2020
|
parent
|
context
|
favorite
| on:
Math.min(Math.max(num, min), max)
In Haskell, functions often take their arguments in the order that makes the most sense to partially apply. In this case, that would probably be clamp(min, max, val): supplying the first two arguments results in a reusable clamping function.
ric2b
on Aug 22, 2020
[–]
It would be nice if partial application worked with keyword arguments. Actually it would be great if Haskell natively supported keyword arguments.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: