interactive prompt can handle polymorphic types
This commit is contained in:
parent
a0e3aa0cb3
commit
4a4983f693
20 changed files with 485 additions and 276 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { makeGeneric } from "../generics/generics.js";
|
||||
import { Type } from "../primitives/types.js";
|
||||
import { GenericType, Type } from "../primitives/types.js";
|
||||
import { typedFnType } from "./types.js";
|
||||
import { prodType } from "./types.js";
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ export const ModuleProduct = {l: [
|
|||
(b)
|
||||
(prodType(a)(b))
|
||||
)
|
||||
)),
|
||||
), GenericType),
|
||||
|
||||
// (a, b) -> a
|
||||
...typedFnType(getLeft, fnType =>
|
||||
|
|
@ -37,7 +37,7 @@ export const ModuleProduct = {l: [
|
|||
fnType
|
||||
(prodType(a)(b))
|
||||
(a)
|
||||
)),
|
||||
), GenericType),
|
||||
|
||||
// (a, b) -> b
|
||||
...typedFnType(getRight, fnType =>
|
||||
|
|
@ -45,5 +45,5 @@ export const ModuleProduct = {l: [
|
|||
fnType
|
||||
(prodType(a)(b))
|
||||
(b)
|
||||
)),
|
||||
), GenericType),
|
||||
]};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue