[GHC] #11693: Add `When` type family

#11693: Add `When` type family -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Core | Version: 8.1 Libraries | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Does a type family like `When` from [https://github.com/mikeizbicki/subhask/blob/master/src/SubHask/SubType.hs#L1... here] belong somewhere in `Data.Types.*` {{{#!hs type family When (a :: Bool) (b :: Constraint) :: Constraint where When True b = b When False b = () }}} like [https://hackage.haskell.org/package/base/docs/Control- Monad.html#v:when when]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11693 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11693: Add `When` type family -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ekmett): This strikes me as the kind of thing that belongs out in a user library like `constraints` or `subhask` as it requires a fair bit of machinery to use well, and suffers the sort of type-level "boolean blindness" that indicates it'd often need to be reimplemented subtly differently. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11693#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC