-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Framework for defaulting superclasses -- -- Framework for defaulting superclasses @package impl @version 0.1.0.0 -- | This small but extensible framework facilitates defining complex -- defaulting rules that are not handled by DefaultSignatures, -- and reducing the overhead of giving instances to new datatypes by -- generating superclasses. One reason we might want this is when a -- superclass wants to be given a default by two different subclasses -- (ex: Bifunctor and Profunctor both could generate -- Functor instances). See the example internal library -- for how to implement instances of Impl. module Impl class Impl c where { type family Methods c :: [Symbol]; } -- | Instantiate the implementing class along with all its superclasses Ex: -- --
-- impl @Monad [t|[]|] -- ! #return [|\x -> [x]|] -- ! #bind [|flip concatMap|] --impl :: Impl c => TypeQ -> NamedMethods c :-> DecsQ -- | Named TH Exps for the class method implementations type NamedMethods c = NamedExpQ (Methods c) -- | Converts a variable number of arguments into curried form. Ex: -- --
-- >>> :!kind '[Int,String,Double] :-> IO () -- Int -> String -> Double -> IO () --type family as :-> r infixr 0 :-> type TypeQ = Q Type -- | Supply a parameter to a function: -- --
-- function ! #param_name value ---- --
-- function ! #x 7 ! #y 42 ! defaults ---- -- This is an infix version of with. (!) :: WithParam p fn fn' => fn -> Param p -> fn' infixl 9 ! -- | Infix notation for the type of a named parameter. type (:!) (name :: Symbol) a = NamedF Identity a name -- | Assign a name to a value of type a wrapped in f. -- --
-- #verbose True :: NamedF Identity Bool "verbose" --data NamedF (f :: Type -> Type) a (name :: Symbol) -- | arg unwraps a named parameter with the specified name. One way -- to use it is to match on arguments with -XViewPatterns: -- --
-- fn (arg #t -> t) (arg #f -> f) = ... ---- -- This way, the names of parameters can be inferred from the patterns: -- no type signature for fn is required. In case a type -- signature for fn is provided, the parameters must come in the -- same order: -- --
-- fn :: "t" :! Integer -> "f" :! Integer -> ... -- fn (arg #t -> t) (arg #f -> f) = ... -- ok -- fn (arg #f -> f) (arg #t -> t) = ... -- does not typecheck --arg :: () => Name name -> (name :! a) -> a