{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.ProtoLens.Field
( HasField(..)
, field
) where
import GHC.Prim (Proxy#, proxy#)
import GHC.TypeLits (Symbol)
field :: forall x s a f . (HasField s x a, Functor f) => (a -> f a) -> s -> f s
field :: forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
field = Proxy# x -> (a -> f a) -> s -> f s
forall s (x :: Symbol) a (f :: * -> *).
(HasField s x a, Functor f) =>
Proxy# x -> (a -> f a) -> s -> f s
forall (f :: * -> *).
Functor f =>
Proxy# x -> (a -> f a) -> s -> f s
fieldOf (Proxy# x
forall {k} (a :: k). Proxy# a
proxy# :: Proxy# x)
class HasField s (x :: Symbol) a | s x -> a where
fieldOf :: Functor f => Proxy# x -> (a -> f a) -> s -> f s