hegel
hegel copied to clipboard
An advanced static type checker
To allow for type refinement to be abstracted into functions: ```ts function isNumber(n: unknown): n is number { if (typeof n === 'number' && !isNaN(n)) return true return false }...
Consider the following function: ```js let f = (a, b) => a + b ``` The inferred type is ``` (T, T) => T ``` This might seem correct, but...
IMHO, this should typecheck ``` type T = K type ApplyNumber = T const x : ApplyNumber = 3 ```
ok so i was planning to try and use hegel in real project to see what is missing and what's not. so i decided to first extract my project setup...
Hey, I'm not sure if this kind of things is outside of the scope of the language (is it "_only_" supposed to add types to JS, or is it an...
I had a look at the documentation and the cli interface, but I couldn't find anything that looked like it output type inferences. Is there a way to get hegel...
I tried the playground, but had the following error in chrome. Mixed Content: The page at 'https://hegel.js.org/try#MYGwhgzhAEAiYBcwCFIFNoG8BQ1oCc1gB7AO1KIQAoBKLAtBAV31OgQAsBLCAbgHoAVNAB0YhiXKVoIYgHMuwaIP4BfbOtCQYAMS4APZoSy4JZCsGp1M7bhBEATfMQAO8JACN0tXgyNtOHgFhMREzKUsZeUVlNVMnV3cwLwg0Wix1dWwAMyZSSy4yaFTmFwBRACYyqgcPAC44RBR0a3iPEUJJCyteDWxsfn5oAEFSB2gAT2IWdjQwAFtEDGzifDliBHZiaGAOMFI5DAhiecZuA+gwbIQ0fGgHNA8mOQUD7EkITdroAF5oCgA7tA9IYWGkaL0Hk8XrdeoMRmNJtNoHsAG4YYYAeQAKtBbs47lw2FMZmgHFwEKtoFSifcWIhCmxiNloC5nAAraQkeYuLjgBCM7AlJjlKo1DwQ7BAA' was loaded over HTTPS, but requested an insecure resource 'http://hegel.js.org/try/#MYGwhgzhAEAiYBcwCFIFNoG8BQ1oCc1gB7AO1KIQAoBKLAtBAV31OgQAsBLCAbgHoAVNAB0YhiXKVoIYgHMuwaIP4BfbOtCQYAMS4APZoSy4JZCsGp1M7bhBEATfMQAO8JACN0tXgyNtOHgFhMREzKUsZeUVlNVMnV3cwLwg0Wix1dWwAMyZSSy4yaFTmFwBRACYyqgcPAC44RBR0a3iPEUJJCyteDWxsfn5oAEFSB2gAT2IWdjQwAFtEDGzifDliBHZiaGAOMFI5DAhiecZuA+gwbIQ0fGgHNA8mOQUD7EkITdroAF5oCgA7tA9IYWGkaL0Hk8XrdeoMRmNJtNoHsAG4YYYAeQAKtBbs47lw2FMZmgHFwEKtoFSifcWIhCmxiNloC5nAAraQkeYuLjgBCM7AlJjlKo1DwQ7BAA'. This request has...
¿How I can define and implement an overloaded function with different result type? Example: ```ts function generate(type: 'number' | 'string') { if (type === 'number') { return 1234 } else...
> tidr: for lazy type refinement we need a parameterized unknown A problem: we can't define a _expected_ type for future refinement: ```ts const data: Array | unknown = JSON.parse(some)...
I tried this on the playground but it fails (`Analyzation: SpreadElement`) Curry is very hard to type correctly, this would be the ultimate test for your project: ```ts const curry...