optics-core-0.4.1: Optics as an abstract interface: core definitions
Safe Haskell None
Language Haskell2010

Optics.Internal.Magic

Description

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis
  • class Dysfunctional field k s t a b | field s -> k t a b, field t -> k s a b
  • class TypeInferenceLoop msg1 msg2 msg3 field k s t a b | field s -> k t a b, field t -> k s a b

Documentation

class Dysfunctional field k s t a b | field s -> k t a b, field t -> k s a b Source #

How about a magic trick? I'm gonna make the coverage condition disappear.

Instances

Instances details
TypeInferenceLoop "Type inference for the local binding failed. Write the type" "signature yourself or disable monomorphism restriction with" "NoMonomorphismRestriction LANGUAGE pragma so GHC infers it." field k7 s t a b => Dysfunctional (field :: k1) (k7 :: k2) (s :: k3) (t :: k4) (a :: k5) (b :: k6) Source #

Show something useful when type inference goes into a loop and stops with "reduction stack overflow" message (sometimes happens when trying to infer types of local bindings when monomorphism restriction is enabled).

Instance details

Defined in Optics.Internal.Magic

class TypeInferenceLoop msg1 msg2 msg3 field k s t a b | field s -> k t a b, field t -> k s a b Source #

Instances

Instances details
TypeInferenceLoop msg1 msg2 msg3 field k10 s t a b => TypeInferenceLoop (msg1 :: k1) (msg2 :: k2) (msg3 :: k3) (field :: k4) (k10 :: k5) (s :: k6) (t :: k7) (a :: k8) (b :: k9) Source #

Including the instance head in the context lifts the coverage condition for all type variables in the instance. A dirty trick until we have https://github.com/ghc-proposals/ghc-proposals/pull/374 and can do it properly.

Instance details

Defined in Optics.Internal.Magic