capability-0.5.0.1: Extensional capabilities and deriving combinators
Safe HaskellNone
LanguageHaskell2010

Capability.Reflection

Description

Use this module to provide an ad-hoc interpreter for a capability using type class reflection.

Use the functions interpret_ or interpret for ad-hoc interpretation of capabilities.

Refer to Reflected if you would like to enable reflection for a new capability.

More complex examples using this module can be found in the Reflection example module.

For details on reflection refer to the tutorial at https://www.tweag.io/posts/2017-12-21-reflection-tutorial.html and the reflection library at https://hackage.haskell.org/package/reflection.

Synopsis

Reflection

interpret_ :: forall tag c m a. (Monad m, forall s. Reifies s (Reified tag c m) => c (Reflected s c m)) => Reified tag c m -> (forall m'. c m' => m' a) -> m a Source #

interpret_ @tag dict action

Execute action using the ad-hoc interpretation of a capability c under tag defined by dict, where dict is a value of type Reified tag c, i.e. a record providing the implementation of the methods of capability c.

For example, the following provides an ad-hoc interpretation for the HasSource capability.

>>> :{
  interpret_ @"my-source"
    ReifiedSource { _await = pure "capabilities" }
    (replicateM 3 (await @"my-source"))
  :}
["capabilities", "capabilities", "capabilities"]

interpret :: forall tag (cs :: [Capability]) c m a. (Monad m, All cs m, forall s. Reifies s (Reified tag c m) => c (Reflected s c m)) => Reified tag c m -> (forall m'. All (c ': cs) m' => m' a) -> m a Source #

interpret @tag @ambient dict action

Like interpret_ but forwards the ambient capabilities ambient into the context of action as well.

For example, the following provides an ad-hoc interpretation for the HasSource capability, while using an ambient HasSink capability.

>>> :{
  interpret @"my-source" @'[HasSink "my-sink" String]
    ReifiedSource { _await = pure "capabilities" }
    (replicateM_ 3 (await @"my-source" >>= yield @"my-sink"))
  :}

data family Reified (tag :: k) (c :: Capability) (m :: Type -> Type) Source #

Reified tag capability m

Defines the dictionary type for the methods of capability under tag in the monad m. Refer to interpret_ for an example use-case.

For example, the HasSink capability has the method yield :: a -> m (). The corresponding dictionary type is defined as follows.

>>> :{
  data instance Reified tag (HasSink tag a) m =
    ReifiedSink { _yield :: forall a. a -> m () }
  :}

Superclass dictionaries are represented as nested records. For example, the HasState capability has the superclasses HasSource and HasSink and the method state :: (s -> (a, s)) -> m a. The corresponding dictionary type is defined as follows.

>>> :{
  data instance Reified tag (HasState tag s) m =
    ReifiedState
      { _stateSource :: Reified tag (HasSource tag s) m,
        _stateSink :: Reified tag (HasSink tag s) m,
        _state :: forall a. (s -> (a, s)) -> m a
      }
  :}

Instances

Instances details
data Reified (tag :: k) (HasSink tag a) m Source # 
Instance details

Defined in Capability.Sink.Internal.Class

data Reified (tag :: k) (HasSink tag a) m = ReifiedSink {}
data Reified (tag :: k) (HasSource tag a) m Source # 
Instance details

Defined in Capability.Source.Internal.Class

data Reified (tag :: k) (HasSource tag a) m = ReifiedSource {}
data Reified (tag :: k) (HasReader tag r) m Source # 
Instance details

Defined in Capability.Reader.Internal.Class

data Reified (tag :: k) (HasReader tag r) m = ReifiedReader {}
data Reified (tag :: k) (HasState tag s) m Source # 
Instance details

Defined in Capability.State.Internal.Class

data Reified (tag :: k) (HasState tag s) m = ReifiedState {}
data Reified (tag :: k) (HasThrow tag e) m Source # 
Instance details

Defined in Capability.Error

data Reified (tag :: k) (HasThrow tag e) m = ReifiedThrow {}
data Reified (tag :: k) (HasCatch tag e) m Source # 
Instance details

Defined in Capability.Error

data Reified (tag :: k) (HasCatch tag e) m = ReifiedCatch {}
data Reified (tag :: k) (HasWriter tag w) m Source # 
Instance details

Defined in Capability.Writer

data Reified (tag :: k) (HasWriter tag w) m = ReifiedWriter {}

newtype Reflected (s :: Type) (c :: Capability) (m :: Type -> Type) (a :: Type) Source #

Reflected s capability m

Carries the type class instance for capability in the monad m defined by the dictionary reflected in s in the type system.

For most use-cases it is not necessary to use this type directly. Use interpret_ or interpret instead.

If you wish to enable reflection for a new capability, then you will need to define a type class instance for Reflected for the new capability. Note, you will also need to define an instance of Reified which defines the dictionary type of the new capability. Hint, you can use reified @s to obtain the dictionary from the context in the instance implementation.

For example, the Reflected instance for the HasSink capability can be defined as follows. Assuming the dictionary described in Reified.

>>> :{
  instance
    (Monad m, Reifies s (Reified tag (HasSink tag a) m)) =>
    HasSink tag a (Reflected s (HasSink tag a) m)
    where
    yield a = Reflect $ _yield (reified @s) a
  :}

Constructors

Reflect (m a) 

Instances

Instances details
(Monad m, Reifies s (Reified tag (HasSink tag a) m)) => HasSink (tag :: k) a (Reflected s (HasSink tag a) m) Source # 
Instance details

Defined in Capability.Sink.Internal.Class

Methods

yield_ :: Proxy# tag -> a -> Reflected s (HasSink tag a) m () Source #

(Monad m, Reifies s' (Reified tag (HasState tag s) m)) => HasSink (tag :: k) s (Reflected s' (HasState tag s) m) Source # 
Instance details

Defined in Capability.State.Internal.Class

Methods

yield_ :: Proxy# tag -> s -> Reflected s' (HasState tag s) m () Source #

(Monoid w, Monad m, Reifies s (Reified tag (HasWriter tag w) m)) => HasSink (tag :: k) w (Reflected s (HasWriter tag w) m) Source # 
Instance details

Defined in Capability.Writer

Methods

yield_ :: Proxy# tag -> w -> Reflected s (HasWriter tag w) m () Source #

(Monad m, Reifies s (Reified tag (HasSource tag a) m)) => HasSource (tag :: k) a (Reflected s (HasSource tag a) m) Source # 
Instance details

Defined in Capability.Source.Internal.Class

Methods

await_ :: Proxy# tag -> Reflected s (HasSource tag a) m a Source #

(Monad m, Reifies s (Reified tag (HasReader tag r) m)) => HasSource (tag :: k) r (Reflected s (HasReader tag r) m) Source # 
Instance details

Defined in Capability.Reader.Internal.Class

Methods

await_ :: Proxy# tag -> Reflected s (HasReader tag r) m r Source #

(Monad m, Reifies s' (Reified tag (HasState tag s) m)) => HasSource (tag :: k) s (Reflected s' (HasState tag s) m) Source # 
Instance details

Defined in Capability.State.Internal.Class

Methods

await_ :: Proxy# tag -> Reflected s' (HasState tag s) m s Source #

(Monad m, Reifies s (Reified tag (HasReader tag r) m)) => HasReader (tag :: k) r (Reflected s (HasReader tag r) m) Source # 
Instance details

Defined in Capability.Reader.Internal.Class

Methods

local_ :: Proxy# tag -> (r -> r) -> Reflected s (HasReader tag r) m a -> Reflected s (HasReader tag r) m a Source #

reader_ :: Proxy# tag -> (r -> a) -> Reflected s (HasReader tag r) m a Source #

(Monad m, Reifies s' (Reified tag (HasState tag s) m)) => HasState (tag :: k) s (Reflected s' (HasState tag s) m) Source # 
Instance details

Defined in Capability.State.Internal.Class

Methods

state_ :: Proxy# tag -> (s -> (a, s)) -> Reflected s' (HasState tag s) m a Source #

(Monad m, Reifies s (Reified tag (HasCatch tag e) m)) => HasCatch (tag :: k) e (Reflected s (HasCatch tag e) m) Source # 
Instance details

Defined in Capability.Error

Methods

catch_ :: Proxy# tag -> Reflected s (HasCatch tag e) m a -> (e -> Reflected s (HasCatch tag e) m a) -> Reflected s (HasCatch tag e) m a Source #

catchJust_ :: Proxy# tag -> (e -> Maybe b) -> Reflected s (HasCatch tag e) m a -> (b -> Reflected s (HasCatch tag e) m a) -> Reflected s (HasCatch tag e) m a Source #

(Monad m, Reifies s (Reified tag (HasThrow tag e) m)) => HasThrow (tag :: k) e (Reflected s (HasThrow tag e) m) Source # 
Instance details

Defined in Capability.Error

Methods

throw_ :: Proxy# tag -> e -> Reflected s (HasThrow tag e) m a Source #

(Monad m, Reifies s (Reified tag (HasCatch tag e) m)) => HasThrow (tag :: k) e (Reflected s (HasCatch tag e) m) Source # 
Instance details

Defined in Capability.Error

Methods

throw_ :: Proxy# tag -> e -> Reflected s (HasCatch tag e) m a Source #

(Monad m, Monoid w, Reifies s (Reified tag (HasWriter tag w) m)) => HasWriter (tag :: k) w (Reflected s (HasWriter tag w) m) Source # 
Instance details

Defined in Capability.Writer

Methods

writer_ :: Proxy# tag -> (a, w) -> Reflected s (HasWriter tag w) m a Source #

listen_ :: Proxy# tag -> Reflected s (HasWriter tag w) m a -> Reflected s (HasWriter tag w) m (a, w) Source #

pass_ :: Proxy# tag -> Reflected s (HasWriter tag w) m (a, w -> w) -> Reflected s (HasWriter tag w) m a Source #

Monad m => Monad (Reflected s c m) Source # 
Instance details

Defined in Capability.Reflection

Methods

(>>=) :: Reflected s c m a -> (a -> Reflected s c m b) -> Reflected s c m b #

(>>) :: Reflected s c m a -> Reflected s c m b -> Reflected s c m b #

return :: a -> Reflected s c m a #

Functor m => Functor (Reflected s c m) Source # 
Instance details

Defined in Capability.Reflection

Methods

fmap :: (a -> b) -> Reflected s c m a -> Reflected s c m b #

(<$) :: a -> Reflected s c m b -> Reflected s c m a #

Applicative m => Applicative (Reflected s c m) Source # 
Instance details

Defined in Capability.Reflection

Methods

pure :: a -> Reflected s c m a #

(<*>) :: Reflected s c m (a -> b) -> Reflected s c m a -> Reflected s c m b #

liftA2 :: (a -> b -> c0) -> Reflected s c m a -> Reflected s c m b -> Reflected s c m c0 #

(*>) :: Reflected s c m a -> Reflected s c m b -> Reflected s c m b #

(<*) :: Reflected s c m a -> Reflected s c m b -> Reflected s c m a #

reified :: forall s tag c m. Reifies s (Reified tag c m) => Reified tag c m Source #

reified @s

Obtain the dictionary that is reflected in the type system under s.

This is a convenience wrapper around reflect.

Re-exported

class Reifies (s :: k) a | s -> a #

Minimal complete definition

reflect

Instances

Instances details
KnownNat n => Reifies (n :: Nat) Integer 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy n -> Integer #

KnownSymbol n => Reifies (n :: Symbol) String 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy n -> String #

Reifies Z Int 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy Z -> Int #

Reifies n Int => Reifies (D n :: Type) Int 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy (D n) -> Int #

Reifies n Int => Reifies (SD n :: Type) Int 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy (SD n) -> Int #

Reifies n Int => Reifies (PD n :: Type) Int 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy (PD n) -> Int #

(B b0, B b1, B b2, B b3, B b4, B b5, B b6, B b7, w0 ~ W b0 b1 b2 b3, w1 ~ W b4 b5 b6 b7) => Reifies (Stable w0 w1 a :: Type) a 
Instance details

Defined in Data.Reflection

Methods

reflect :: proxy (Stable w0 w1 a) -> a #

reify :: a -> (forall s. Reifies s a => Proxy s -> r) -> r #

Reify a value at the type level, to be recovered with reflect.

reflect :: Reifies s a => proxy s -> a #

Recover a value inside a reify context, given a proxy for its reified type.

data Proxy (t :: k) #

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the undefined :: a idiom.

>>> Proxy :: Proxy (Void, Int -> Int)
Proxy

Proxy can even hold types of higher kinds,

>>> Proxy :: Proxy Either
Proxy
>>> Proxy :: Proxy Functor
Proxy
>>> Proxy :: Proxy complicatedStructure
Proxy

Constructors

Proxy 

Instances

Instances details
Generic1 (Proxy :: k -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Proxy :: k -> Type #

Methods

from1 :: forall (a :: k0). Proxy a -> Rep1 Proxy a #

to1 :: forall (a :: k0). Rep1 Proxy a -> Proxy a #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Foldable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Representable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep Proxy #

Methods

tabulate :: (Rep Proxy -> a) -> Proxy a #

index :: Proxy a -> Rep Proxy -> a #

Eq1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Proxy a -> Proxy b -> Bool #

Ord1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Proxy a -> Proxy b -> Ordering #

Read1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Proxy a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Proxy a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Proxy a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Proxy a] #

Show1 (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Proxy a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Proxy a] -> ShowS #

Alternative (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a #

(<|>) :: Proxy a -> Proxy a -> Proxy a #

some :: Proxy a -> Proxy [a] #

many :: Proxy a -> Proxy [a] #

MonadPlus (Proxy :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a #

mplus :: Proxy a -> Proxy a -> Proxy a #

Hashable1 (Proxy :: Type -> Type) 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Proxy a -> Int #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

Enum (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s #

pred :: Proxy s -> Proxy s #

toEnum :: Int -> Proxy s #

fromEnum :: Proxy s -> Int #

enumFrom :: Proxy s -> [Proxy s] #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #

Eq (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool #

(/=) :: Proxy s -> Proxy s -> Bool #

Ord (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering #

(<) :: Proxy s -> Proxy s -> Bool #

(<=) :: Proxy s -> Proxy s -> Bool #

(>) :: Proxy s -> Proxy s -> Bool #

(>=) :: Proxy s -> Proxy s -> Bool #

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Ix (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s] #

index :: (Proxy s, Proxy s) -> Proxy s -> Int #

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int #

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool #

rangeSize :: (Proxy s, Proxy s) -> Int #

unsafeRangeSize :: (Proxy s, Proxy s) -> Int #

Generic (Proxy t)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (Proxy t) :: Type -> Type #

Methods

from :: Proxy t -> Rep (Proxy t) x #

to :: Rep (Proxy t) x -> Proxy t #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int #

hash :: Proxy a -> Int #

MonoFunctor (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

omap :: (Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Proxy a #

MonoFoldable (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

ofoldMap :: Monoid m => (Element (Proxy a) -> m) -> Proxy a -> m #

ofoldr :: (Element (Proxy a) -> b -> b) -> b -> Proxy a -> b #

ofoldl' :: (a0 -> Element (Proxy a) -> a0) -> a0 -> Proxy a -> a0 #

otoList :: Proxy a -> [Element (Proxy a)] #

oall :: (Element (Proxy a) -> Bool) -> Proxy a -> Bool #

oany :: (Element (Proxy a) -> Bool) -> Proxy a -> Bool #

onull :: Proxy a -> Bool #

olength :: Proxy a -> Int #

olength64 :: Proxy a -> Int64 #

ocompareLength :: Integral i => Proxy a -> i -> Ordering #

otraverse_ :: Applicative f => (Element (Proxy a) -> f b) -> Proxy a -> f () #

ofor_ :: Applicative f => Proxy a -> (Element (Proxy a) -> f b) -> f () #

omapM_ :: Applicative m => (Element (Proxy a) -> m ()) -> Proxy a -> m () #

oforM_ :: Applicative m => Proxy a -> (Element (Proxy a) -> m ()) -> m () #

ofoldlM :: Monad m => (a0 -> Element (Proxy a) -> m a0) -> a0 -> Proxy a -> m a0 #

ofoldMap1Ex :: Semigroup m => (Element (Proxy a) -> m) -> Proxy a -> m #

ofoldr1Ex :: (Element (Proxy a) -> Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Element (Proxy a) #

ofoldl1Ex' :: (Element (Proxy a) -> Element (Proxy a) -> Element (Proxy a)) -> Proxy a -> Element (Proxy a) #

headEx :: Proxy a -> Element (Proxy a) #

lastEx :: Proxy a -> Element (Proxy a) #

unsafeHead :: Proxy a -> Element (Proxy a) #

unsafeLast :: Proxy a -> Element (Proxy a) #

maximumByEx :: (Element (Proxy a) -> Element (Proxy a) -> Ordering) -> Proxy a -> Element (Proxy a) #

minimumByEx :: (Element (Proxy a) -> Element (Proxy a) -> Ordering) -> Proxy a -> Element (Proxy a) #

oelem :: Element (Proxy a) -> Proxy a -> Bool #

onotElem :: Element (Proxy a) -> Proxy a -> Bool #

MonoTraversable (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

otraverse :: Applicative f => (Element (Proxy a) -> f (Element (Proxy a))) -> Proxy a -> f (Proxy a) #

omapM :: Applicative m => (Element (Proxy a) -> m (Element (Proxy a))) -> Proxy a -> m (Proxy a) #

MonoPointed (Proxy a)

Since: mono-traversable-1.0.11.0

Instance details

Defined in Data.MonoTraversable

Methods

opoint :: Element (Proxy a) -> Proxy a #

type Rep1 (Proxy :: k -> Type) 
Instance details

Defined in GHC.Generics

type Rep1 (Proxy :: k -> Type) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: k -> Type))
type Rep (Proxy :: Type -> Type) 
Instance details

Defined in Data.Functor.Rep

type Rep (Proxy :: Type -> Type) = Void
type Rep (Proxy t) 
Instance details

Defined in GHC.Generics

type Rep (Proxy t) = D1 ('MetaData "Proxy" "Data.Proxy" "base" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) (U1 :: Type -> Type))
type Element (Proxy a) 
Instance details

Defined in Data.MonoTraversable

type Element (Proxy a) = a