{-# 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 Optics.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 :: Lens s t a b
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 :: Lens s t a b
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 :: Lens s t a b
the = forall s. HasType a s => Lens s s a a
forall a s. HasType a s => Lens s s a a
typed @a