TheDan64 / inkwell

It's a New Kind of Wrapper for Exposing LLVM (Safely)
https://thedan64.github.io/inkwell/
Apache License 2.0
2.29k stars 219 forks source link

Higher Kinded Types? #335

Open JCBurnside opened 2 years ago

JCBurnside commented 2 years ago

Is your feature request related to a problem? Please describe. trying to make a functional language so I need higher kinded types (eg int32 -> int32 -> int32) thus I need to create a function that has a return type of another function. as well why can't I simply create pointer and/or function off an AnyTypeEnum?

Describe the solution you'd like Allow chaining of the fn_type method on AnyTypeEnum. simply implemented as a match on self that would allow

Describe possible drawbacks to your solution I don't think it can hinder much?

Describe alternatives you've considered not really any work arounds i've found.

JCBurnside commented 2 years ago

Just realized i need to make it return a function pointer in order to pull it off. Still would like to see the latter part of the suggestion.

TheDan64 commented 2 years ago

I'm not sure that it makes sense to add to AnyTimeEnum since not all types (now or in the future) may be valid. But perhaps we could make the method fallible or something. hmm