File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -2125,12 +2125,20 @@ Here is a list of Haskell features for which the Clash compiler has only
2125
2125
For \"easy\" 'Vec'tor literals you should use Template Haskell splices and
2126
2126
the 'listToVecTH' /meta/-function that as we have seen earlier in this tutorial.
2127
2127
2128
- * __GADT pattern matching__
2128
+ * __GADTs__
2129
2129
2130
- While pattern matching for regular ADTs is supported, pattern matching for
2131
- GADTs is __not__. The constructors 'Cons' and 'Nil' of the 'Vec'tor type,
2132
- which is also a GADT, are __no__ exception! However, you can use the
2133
- convenient ':>' pattern synonym.
2130
+ Clash has experimental support for GADTs. Similar to recursive types, Clash
2131
+ can't determine bit-sizes of GADTs. Notable exceptions to this rule are
2132
+ 'Vec' and 'RTree'. You can still use your own GADTs, as long as they can be
2133
+ removed through static analysis. For example, the following case will be
2134
+ optimized away and is therefore fine to use:
2135
+
2136
+ @
2137
+ x =
2138
+ case 'resetKind' @@'System' of
2139
+ SAsynchronous -> 'a'
2140
+ SSynchronous -> 'b'
2141
+ @
2134
2142
2135
2143
* __Floating point types__
2136
2144
You can’t perform that action at this time.
0 commit comments