@@ -45,7 +45,7 @@ instance TypeScript Char where
45
45
46
46
instance {-# OVERLAPPABLE #-} (TypeScript a ) => TypeScript [a ] where
47
47
getTypeScriptType _ = (getTypeScriptType (Proxy :: Proxy a )) ++ " []"
48
- getParentTypes _ = ( TSType (Proxy :: Proxy a )) : (getParentTypes ( Proxy :: Proxy a ))
48
+ getParentTypes _ = [ TSType (Proxy :: Proxy a )]
49
49
50
50
instance {-# OVERLAPPING #-} TypeScript [Char ] where
51
51
getTypeScriptType _ = " string"
@@ -56,37 +56,30 @@ instance (TypeScript a, TypeScript b) => TypeScript (Either a b) where
56
56
, TSInterfaceDeclaration " Left" [" T" ] [TSField False " Left" " T" ]
57
57
, TSInterfaceDeclaration " Right" [" T" ] [TSField False " Right" " T" ]
58
58
]
59
- getParentTypes _ = L. nub ((TSType (Proxy :: Proxy a ))
60
- : (TSType (Proxy :: Proxy b ))
61
- : (getParentTypes (Proxy :: Proxy a ))
62
- <> (getParentTypes (Proxy :: Proxy b )))
59
+ getParentTypes _ = L. nub [ (TSType (Proxy :: Proxy a ))
60
+ , (TSType (Proxy :: Proxy b ))
61
+ ]
63
62
64
63
instance (TypeScript a , TypeScript b ) => TypeScript (a , b ) where
65
64
getTypeScriptType _ = [i |[#{getTypeScriptType (Proxy :: Proxy a)}, #{getTypeScriptType (Proxy :: Proxy b)}]|]
66
- getParentTypes _ = L. nub ((TSType (Proxy :: Proxy a ))
67
- : (TSType (Proxy :: Proxy b ))
68
- : (getParentTypes (Proxy :: Proxy a ))
69
- <> (getParentTypes (Proxy :: Proxy b )))
65
+ getParentTypes _ = L. nub [ (TSType (Proxy :: Proxy a ))
66
+ , (TSType (Proxy :: Proxy b ))
67
+ ]
70
68
71
69
instance (TypeScript a , TypeScript b , TypeScript c ) => TypeScript (a , b , c ) where
72
70
getTypeScriptType _ = [i |[#{getTypeScriptType (Proxy :: Proxy a)}, #{getTypeScriptType (Proxy :: Proxy b)}, #{getTypeScriptType (Proxy :: Proxy c)}]|]
73
- getParentTypes _ = L. nub ((TSType (Proxy :: Proxy a ))
74
- : (TSType (Proxy :: Proxy b ))
75
- : (TSType (Proxy :: Proxy c ))
76
- : (getParentTypes (Proxy :: Proxy a ))
77
- <> (getParentTypes (Proxy :: Proxy b ))
78
- <> (getParentTypes (Proxy :: Proxy c )))
71
+ getParentTypes _ = L. nub [ (TSType (Proxy :: Proxy a ))
72
+ , (TSType (Proxy :: Proxy b ))
73
+ , (TSType (Proxy :: Proxy c ))
74
+ ]
79
75
80
76
instance (TypeScript a , TypeScript b , TypeScript c , TypeScript d ) => TypeScript (a , b , c , d ) where
81
77
getTypeScriptType _ = [i |[#{getTypeScriptType (Proxy :: Proxy a)}, #{getTypeScriptType (Proxy :: Proxy b)}, #{getTypeScriptType (Proxy :: Proxy c)}, #{getTypeScriptType (Proxy :: Proxy d)}]|]
82
- getParentTypes _ = L. nub ((TSType (Proxy :: Proxy a ))
83
- : (TSType (Proxy :: Proxy b ))
84
- : (TSType (Proxy :: Proxy c ))
85
- : (TSType (Proxy :: Proxy d ))
86
- : (getParentTypes (Proxy :: Proxy a ))
87
- <> (getParentTypes (Proxy :: Proxy b ))
88
- <> (getParentTypes (Proxy :: Proxy c ))
89
- <> (getParentTypes (Proxy :: Proxy d )))
78
+ getParentTypes _ = L. nub [ (TSType (Proxy :: Proxy a ))
79
+ , (TSType (Proxy :: Proxy b ))
80
+ , (TSType (Proxy :: Proxy c ))
81
+ , (TSType (Proxy :: Proxy d ))
82
+ ]
90
83
91
84
instance (TypeScript a ) => TypeScript (Maybe a ) where
92
85
getTypeScriptType _ = getTypeScriptType (Proxy :: Proxy a )
@@ -98,9 +91,8 @@ instance TypeScript A.Value where
98
91
99
92
instance (TypeScript a , TypeScript b ) => TypeScript (HashMap a b ) where
100
93
getTypeScriptType _ = [i |{[k: #{getTypeScriptType (Proxy :: Proxy a)}]: #{getTypeScriptType (Proxy :: Proxy b)}}|]
101
- getParentTypes _ = L. nub ((getParentTypes (Proxy :: Proxy a ))
102
- <> (getParentTypes (Proxy :: Proxy b )))
94
+ getParentTypes _ = L. nub [TSType (Proxy :: Proxy a ), TSType (Proxy :: Proxy b )]
103
95
104
96
instance (TypeScript a ) => TypeScript (Set a ) where
105
97
getTypeScriptType _ = getTypeScriptType (Proxy :: Proxy a ) <> " []" ;
106
- getParentTypes _ = L. nub (getParentTypes (Proxy :: Proxy a ))
98
+ getParentTypes _ = L. nub [ TSType (Proxy :: Proxy a )]
0 commit comments