我想知道如何在数组元素之间放置逗号,而行尾没有逗号。有类似的问题,但我的有点不同,因为我使用 *ngFor 指令来显示文本:
<span *ngFor="let style of styles">
{{style}} //If I put a comma after the text, there would be a comma at the end of the line after the
//last element was displayed
<span>
Run Code Online (Sandbox Code Playgroud)
解决我的问题的方法是什么?
我有一个给定的类型
type Foo = Either (Bool, ()) (Maybe Ordering)
Run Code Online (Sandbox Code Playgroud)
我知道该类型Bool有两个不同的值:True和False。
假设,以下类型是否正确:
type Foo = Either (Bool, ()) (Maybe Ordering)
Run Code Online (Sandbox Code Playgroud)
2+2+1+2+3 = 10考虑到其他类型的构建方式,具有不同的值:
data Either a b = Left a | Right b
data Maybe a = Just a | Nothing
data Ordering = EQ | LT | GT
Run Code Online (Sandbox Code Playgroud)