diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2020-03-28 12:04:16 -0400 |
---|---|---|
committer | Alec Theriault <alec.theriault@gmail.com> | 2020-03-28 13:36:25 -0400 |
commit | 730a2163245cf7aaf389458113e6fa338eca7865 (patch) | |
tree | 8822a3ed69620eb56e01f185d46787d280f51032 /haddock-api/src/Haddock/Types.hs | |
parent | e68cc0f05c102193660466d611640aec922bc9a9 (diff) |
Use TTG empty extensions to remove some `error`'s
None of these error cases should ever have been reachable, so this is
just a matter of leveraging the type system to assert this.
* Use the `NoExtCon` and `noExtCon` to handle case matches for no
extension constructors, instead of throwing an `error`.
* Use the extension field of `HsSpliceTy` to ensure that this variant
of `HsType` cannot exist in an `HsType DocNameI`.
Diffstat (limited to 'haddock-api/src/Haddock/Types.hs')
-rw-r--r-- | haddock-api/src/Haddock/Types.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 28e3caed..ec76fb72 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -35,6 +35,7 @@ import Control.Monad.IO.Class (MonadIO(..)) import Data.Typeable (Typeable) import Data.Map (Map) import Data.Data (Data) +import Data.Void (Void) import Documentation.Haddock.Types import BasicTypes (Fixity(..), PromotionFlag(..)) @@ -713,7 +714,7 @@ type instance XOpTy DocNameI = NoExtField type instance XParTy DocNameI = NoExtField type instance XIParamTy DocNameI = NoExtField type instance XKindSig DocNameI = NoExtField -type instance XSpliceTy DocNameI = NoExtField +type instance XSpliceTy DocNameI = Void -- see `renameHsSpliceTy` type instance XDocTy DocNameI = NoExtField type instance XBangTy DocNameI = NoExtField type instance XRecTy DocNameI = NoExtField |