fsharp / fsharp/fsharp.org

F# Spec doesn't mention private representation Discriminated unions

Đang mở
#321 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
language-spec
Ngôn ngữ chính
TeX
Star
311
Fork
291
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

For example, in this type:

```
type HtmlAttribute =
private | HtmlAttribute of name:string * value:string
```

What's the effect that `private` should have? I see that in C# projects, I no longer have the `NewHtmlAttribute` constructor, but I can keep doing pattern matching and create new values with `HtmlAttribute("a", "b")` in F#. Is that the intended behaviour? I was expecting to not be able to create new values using the union case constructor, and force people to use a static method that normalizes the arguments

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.