-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Closed type class declarations -- -- See Data.Class.Closed for explanation. @package closed-classes @version 0.1 -- | Closed type classes are defined by adding a private field with a -- default implementation that requires a Closed constraint. For -- example: -- --
--   {-# LANGUAGE DefaultSignatures, FlexibleContexts #-}
--   
--   module Foo (Foo) where
--   
--   class Foo a where
--     default _private :: Closed Foo => Proxy a
--     _private :: Proxy a
--     _private = Proxy
--   
--   instance Foo Int where
--     _private = Proxy
--   
-- -- Since _private is not exported, any new instance defined -- outside the Foo module will be forced to use the default -- implementation, which has the unsatisfiable Closed Foo -- constraint. -- --
--   module Bar where
--   
--   import Foo
--   
--   instance Foo Char -- • User defined Foo instances are not allowed.
--   
-- -- Thus new instances can only be defined in the same module as -- Foo, where _private is visible. Note that -- Closed itself is a closed type class, implemented using the -- same trick! -- -- To automatically generate the boilerplate, see -- Data.Class.Closed.TH. module Data.Class.Closed -- | Closed constraints are unsatisfiable. Attempting to resolve a -- Closed <class> constraint will result in -- --
--   • User defined <class> instances are not allowed.
--   
class Closed (a :: k) instance forall k (a :: k). (TypeError ...) => Data.Class.Closed.Closed a module Data.Class.Closed.TH -- | Closes all declared classes. Any instances must be given in the same -- quote. close :: Q [Dec] -> Q [Dec] module Data.Class.Closed.Example class Example₁ a_a5OY example₁ :: Example₁ a_a5OY => a_a5OY class Example₂ a_a5OZ b_a5P0 example₂ :: Example₂ a_a5OZ b_a5P0 => a_a5OZ -> Proxy (b_a5P0 :: Bool) instance Data.Class.Closed.Example.Example₂ a 'GHC.Types.True instance Data.Class.Closed.Example.Example₁ ()