optics-core-0.4.1.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) (k6 :: k1) (s :: k2) (t :: k3) (a :: k4) (b :: k5) | field s -> k6 t a b, field t -> k6 s a b
- class TypeInferenceLoop (msg1 :: k) (msg2 :: k1) (msg3 :: k2) (field :: k3) (k9 :: k4) (s :: k5) (t :: k6) (a :: k7) (b :: k8) | field s -> k9 t a b, field t -> k9 s a b

# Documentation

class Dysfunctional (field :: k) (k6 :: k1) (s :: k2) (t :: k3) (a :: k4) (b :: k5) | field s -> k6 t a b, field t -> k6 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 :: k) (msg2 :: k1) (msg3 :: k2) (field :: k3) (k9 :: k4) (s :: k5) (t :: k6) (a :: k7) (b :: k8) | field s -> k9 t a b, field t -> k9 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