rec-def-0.2.2: Recursively defined values
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Recursive.Internal

Description

This modules contains the newtype definitions backing

Access to the newtype contructor can break the guarantees of these modules. Only import this if you want to extend the APIs for these types.

Synopsis

Documentation

newtype RBool Source #

Like Bool, but admits recursive definitions, preferring the least solution.

Constructors

RBool (Purify P2) 

newtype RDualBool Source #

Like Bool, but admits recursive definitions, preferring the greatest solution.

Constructors

RDualBool (Purify P2) 

newtype RSet a Source #

Like Set, but admits recursive definitions.

Constructors

RSet (Purify (Prop (Set a))) 

data RMap a b Source #

Like Map, but admits recursive definitions.

Constructors

RMap (RSet a) (Map a b) 

type family OpenR a where ... Source #

See openR. Can be extended as needed

Equations

OpenR RBool = Purify P2 
OpenR RDualBool = Purify P2 
OpenR (RSet a) = Purify (Prop (Set a)) 
OpenR (a -> b) = OpenR a -> OpenR b 
OpenR [a] = [OpenR a] 
OpenR other = other 

openR :: Coercible a (OpenR a) => OpenR a -> a Source #

A constrainted form of coerce that only resolves the newtypes from this module, in a directed way.

This improves type inference (e.g. if id was using coerce instead, it would need a type signature).

The idiom is due to Daniel Díaz Carrete.