我输入了Haskell
newtype Uid a = Uid {uidToText :: Text}
deriving (Eq, Ord, Show, Data, Typeable, Generic)
使用purescript-bridge
库mkSumType
功能,我无法SumType
。现在我有了
clientTypes :: [SumType 'Haskell]
clientTypes =
[ ...
, mkSumType (Proxy :: Proxy (Uid a))
]
main :: IO ()
main = writePSTypes path (buildBridge bridge) clientTypes
它说
• No instance for (Data.Typeable.Internal.Typeable a0)
arising from a use of ‘mkSumType’
• In the expression: mkSumType (Proxy :: Proxy (Uid a))
我该如何解决?
答案 0 :(得分:4)
TypeParameters模块中无效,可用于此目的。只需添加
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border Name="Border"
Width="145"
Margin="10"
Padding="0"
BorderThickness="0"
CornerRadius="20">
<ContentPresenter x:Name="ContentSite"
Margin="10"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ContentSource="Header" TextBlock.Foreground="{StaticResource DarkGrayBrush}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border"
Property="Background"
Value="{StaticResource DarkGreenBrush}" />
<Setter TargetName="ContentSite" Property="TextBlock.Foreground"
Value="{StaticResource ForegroundColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
将完成工作。