{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
module Hyper.Class.Infer.InferOf
( HasInferredType (..)
, HasInferredValue (..)
, InferOfConstraint (..)
) where
import Control.Lens (ALens', Lens')
import Hyper.Class.Infer (InferOf)
import Hyper.Type (HyperType, type (#))
import Hyper.Internal.Prelude
class HasInferredType t where
type TypeOf t :: HyperType
inferredType :: Proxy t -> ALens' (InferOf t # v) (v # TypeOf t)
class HasInferredValue t where
inferredValue :: Lens' (InferOf t # v) (v # t)
class InferOfConstraint c h where
inferOfConstraint :: proxy h -> Dict (c (InferOf h))
instance c (InferOf h) => InferOfConstraint c h where
inferOfConstraint :: forall (proxy :: HyperType -> *). proxy h -> Dict (c (InferOf h))
inferOfConstraint proxy h
_ = forall (a :: Constraint). a => Dict a
Dict