logo
首页技术栈工具库讨论
open-union

open-union

Extensible, type-safe unions. This package is very new and likely to change. Basic usage example (language tags ommitted due to https://github.com/haskell/cabal/issues/774) which prints: Casting to an unrelated type does not cause errors; In the above example,showMyUnion contains a String case despite MyUnion not containing String - superfluous cases are ignored, for the time being. typesExhausted is NOT a catchall. It is a null case, and using it as a catchall (or forgetting to provide a certain case, for instance) will result in an error like: The left-hand parts of the ': (think type-level `(:)`) are the cases that still need to be satisfied. Trying to lift an incorrect type to a Union will cause an error resembling: The original use case for this library was code like this (snipped from some record/playback logic): The `(:\)` type-level operator is for removal from a set, i.e. startRecording can be applied to a track in any state except the Recording state.
由 
bruceshi2021-01-15 收录
--
推荐
不推荐
更多信息
GitHub iconbfops/open-union28
HACKAGE
carbal install open-union
查看
标签
根据用户添加的标签生成
暂无标签