Dependent type people, in a language of your choice, how would you write a type signature that captures the semantics of this bit of Python: https://librosa.github.io/librosa/generated/librosa.decompose.hpss.html#librosa.decompose.hpss …
For this function alone, if I understand correctly, one could write a type level function that calculates a type based on 'margin'. However, one can't really look at a function in isolation. If you start with dependent types, you'd likely design the entire API differently.
-
-
I think you understand correctly, and that helps quite a lot, thanks! In terms of the API though, one of the reasons why I thought this would be a good candidate is that librosa has a surprisingly functional interface (unlike a lot of python libraries).
-
I might be misunderstanding what you mean by API though.
- 2 more replies
New conversation -
-
-
Here's my stab at writing down what I think an interface could look like: https://gist.github.com/AdamHarries/5855609482b862911443cc6ff756dc9c … My biggest problem is "merging" decompTy/whichTy and decomp_impl/decompose. I feel like I shouldn't need all the indirection/hiding to do what I want.
-
Oh wait, there are some issues. Please hold.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.