{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE AllowAmbiguousTypes #-}

{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -Wno-unused-imports #-} -- TEMP

-- | Magic function interface to ConCat.Satisfy.Plugin

module ConCat.Satisfy where

-- | Magic function to satisfy a constraint. Requires -fplugin=ConCat.Satisfy.Plugin to work.
satisfy :: forall c z. (c => z) -> z
satisfy :: forall (c :: Constraint) z. (c => z) -> z
satisfy c => z
_ = [Char] -> z
forall a. HasCallStack => [Char] -> a
error [Char]
"satisfy: Use -fplugin=ConCat.Satisfy.Plugin"
{-# NOINLINE [0] satisfy #-}

-- The a argument contains a tuple of dictionary variables
satisfy' :: forall ev c z. ev -> (c => z) -> z
satisfy' :: forall ev (c :: Constraint) z. ev -> (c => z) -> z
satisfy' ev
_ c => z
_ = [Char] -> z
forall a. HasCallStack => [Char] -> a
error [Char]
"satisfy': Use -fplugin=ConCat.Satisfy.Plugin"
{-# NOINLINE [0] satisfy' #-}

satisfy1 :: forall c f a. (c f => f a) -> f a
satisfy1 :: forall (c :: (* -> *) -> Constraint) (f :: * -> *) a.
(c f => f a) -> f a
satisfy1 = forall (c :: Constraint) z. (c => z) -> z
satisfy @(c f)
{-# INLINE satisfy1 #-}

satisfy2 :: forall c f a b. (c f => f a b) -> f a b
satisfy2 :: forall (c :: (* -> * -> *) -> Constraint) (f :: * -> * -> *) a b.
(c f => f a b) -> f a b
satisfy2 = forall (c :: Constraint) z. (c => z) -> z
satisfy @(c f)
{-# INLINE satisfy2 #-}