-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type Params #4
Comments
Yeah, I'm not sure how to encode this sort of polymorphism in the input record type. Definitely something to think about... |
@pelotom For information; I've used the HKT trick of fp-ts and came to a working solution export interface Foo {
name: string
}
export interface Bar<T> {
provider: All<T>,
params: T
}
export interface Baz<T> {
queries: All<T>[]
}
export type Sum<T> = {
foo: Foo,
bar: Bar<T>,
baz: Baz<T>
}
export type All<T> = SumOf<Sum<T>>
declare module './SumType' {
interface SumType<T> {
sumTest: Sum<T>
}
}
const query =
sumizeHK('sumTest')({
foo: undefined,
bar: undefined,
baz: undefined
}) |
no need to keep that open.. |
@pelotom do you think an encoding in the input record with the technic you've used here https://github.com/pelotom/hkts could now be possible? |
You could construct unions that involve placeholders types ( |
We cannot express the code below currently (because of Type Params):
It may not be possible with the current API (Not spent any time thinking about it).
However for the record, let put that here.
The text was updated successfully, but these errors were encountered: