{-# LANGUAGE PackageImports #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Generics.Product.Any
(
HasAny (..)
) where
import "this" Data.Generics.Internal.VL.Lens
import "this" Data.Generics.Product.Fields
import "this" Data.Generics.Product.Positions
import "this" Data.Generics.Product.Typed
class HasAny sel s t a b | s sel -> a where
the :: Lens s t a b
instance HasPosition i s t a b => HasAny i s t a b where
the :: (a -> f b) -> s -> f t
the = forall s t a b. HasPosition i s t a b => Lens s t a b
forall (i :: Nat) s t a b. HasPosition i s t a b => Lens s t a b
position @i
instance HasField field s t a b => HasAny field s t a b where
the :: (a -> f b) -> s -> f t
the = forall s t a b. HasField field s t a b => Lens s t a b
forall (field :: Symbol) s t a b.
HasField field s t a b =>
Lens s t a b
field @field
instance (HasType a s, t ~ s, a ~ b) => HasAny a s t a b where
the :: (a -> f b) -> s -> f t
the = forall s. HasType a s => Lens s s a a
forall a s. HasType a s => Lens s s a a
typed @a