Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
chombier
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
chombier
4y ago
A monad is for composing effectful computations. Effects are encoded using a polymorphic type with a `map` operation (called a functor), and effectful computations are functions `a -> E b` for some types `a, b` and effect `E`. A monad is
62.
▲
by
chombier
4y ago
Can one really escape clone hell afterwards, though?
63.
▲
by
chombier
4y ago
I think this refers to a system of types in which for any two types there is also an union type and an intersection type in the lattice.
64.
▲
by
chombier
4y ago
> Scala has a very different solution to this problem, called covariant and contravariant traits. I thought Scala had an even stricter value restriction than ML, where only function/methods may get a polymorphic type?
65.
▲
by
chombier
4y ago
If you're going to introduce a generic functor fixpoint then you'll probably want to define type Tree a = Fix (TreeF a) so that `toTreeF` is just `unfix` (and is effectively free, as I mentioned above)
66.
▲
by
chombier
4y ago
I also remember struggling with this paper quite a bit at first. This is how I would explain catamorphisms to past me: Suppose you have a recursive `tree` data structure, and another one `tree' x` where `tree' x` is just like `tre
67.
▲
by
chombier
4y ago
> not actual runtime variables/parameters/return types/struct fields. Is it possible to church-encode these with Go generics?
68.
▲
by
chombier
4y ago
Thinking about it, my guess is that properly scoping the variable does not really prevent the user from leaking the value anyway: with context() as foo: leak = foo This is unlike list comprehensions, where it is syntactica
69.
▲
by
chombier
4y ago
I always wondered why does this variable leak outside the `with` scope, because this is really the one place where it should not. IIRC python3 fixed scope leaks in list comprehensions, does anyone know why they didn't fix this one as
70.
▲
by
chombier
4y ago
I generally force it on a per-file basis by adding # mypy: disallow-untyped-defs on top of new python files.
71.
▲
by
chombier
4y ago
I found this nice accessible proof for the interested: https://planetmath.org/slnrisconnected
72.
▲
by
chombier
4y ago
Yes, SLERP is commutative along one-parameter subgroups by definition. The problem arises as soon as more than two quaternions are to be averaged using the above procedure. Again, using 3 quaternions and uniform weights with the above algor
73.
▲
by
chombier
4y ago
This wikipedia page has some, e.g. https://en.wikipedia.org/wiki/Comparison_of_vector_algebra_a...
74.
▲
by
chombier
4y ago
> As far as I can tell he just takes weighted averages, which is a commutative operation. It works when doing LERPs (linear interpolations) but the algorithm above uses SLERPs (spherical interpolations) which can be expressed with quater
75.
▲
by
chombier
4y ago
Except the quaternion product is non-commutative, so the result of your algorithm will depend on the ordering of your `quaternions` array (which may be acceptable in practice), whereas Karcher mean does not.
76.
▲
by
chombier
4y ago
> Quite bluntly, this all sounds like an attempt to reinvent euclidean geometry following a convoluted way I think that's the idea. > I mean, what does all this buy you that applying a subset of affine transformations (scaling, t
77.
▲
by
chombier
4y ago
Thanks, I just realized I was also assuming exp to be surjective as well, I stand corrected. The Wikipedia page[1] mentions the issue briefly but I was curious of the counter-examples. IIUC, matrices in SL(2) with trace < -2 have two dis
78.
▲
by
chombier
4y ago
What made the Lie exponential click for me is the definition of exp as a limit: exp(x) = (I + x / n)^n when n goes to infinity. A tangent vector x at the identity is split in n chunks, each chunk is added to the identity to get a matri
79.
▲
by
chombier
5y ago
> so you can stop collecting the unnecessary data I think that's the key, thanks. But still, if some inputs are redundant shouldn't this be somehow apparent in the eigen-vectors/values of the covariance matrix (making PCA
80.
▲
by
chombier
5y ago
Maybe the addition of generics could enable Concurrent ML-style composable channels? This wouldn't solve the performance issue, but at least it would provide a nice abstraction for protocols.
81.
▲
by
chombier
5y ago
Because of lifetime of captured variables in closures, mostly. You can't really pass around functions freely like you would in Haskell/ML unless you start Box-ing/Rc-ing everything. But then it's not really idiomatic Rus
82.
▲
by
chombier
5y ago
> strcpy in C is Turing complete I was curious too, but my google-fu did not succeed. The closest I found is about printf being Turing-complete [1], which is also new to me. [1] https://www.ioccc.org/2020/carlini
83.
▲
by
chombier
5y ago
"Geometric Algebra is just a Clifford algebra over an Euclidean space, what's the problem?"
84.
▲
by
chombier
5y ago
Exactly, in fact I'm always surprised so many people still claim GA is better for practical implementations after all these years. My impression is that if you want something compact that you'll need to either give up on performan
85.
▲
by
chombier
5y ago
> It's a real shame that people continue to focus so much on quaternions in this day and age. No really, unit quaternions are nice because it's pretty clear they belong to a sphere, therefore you can fairly easily extend geomet
86.
▲
by
chombier
5y ago
See "A General Construction Scheme for Unit Quaternion Curves with Simple High Order Derivatives" (Kim, 1995) for a simple extension of Hermite splines to Lie groups, including unit quaternions.
87.
▲
by
chombier
5y ago
It may not be exactly what you're looking for, but "The History of Standard ML" published last year has a nice section on ML modules with design considerations.
88.
▲
by
chombier
5y ago
I really want to like Meson, but with the lack of user-defined functions [0, 1] (even restricted) it seems difficult to use for larger projects. How do people handle repetitive patterns in practice? By extending Meson itself? [0]: https:&#
89.
▲
by
chombier
5y ago
Hey :) I remember thinking at the time this could be used to implement typestate in c++ in order to get a rust-like ownership system. Do you (or anyone else) know if this has been done so far?
90.
▲
by
chombier
5y ago
I believe this trick (auto constexpr definition using friend injection) was first described in this post https://b.atch.se/posts/non-constant-constant-expressions/
More ›