Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The type R Bool
is ike Bool
, but allows recursive definitions:
>>>
:{
let x = rTrue y = x &&& z z = y ||| rFalse in getR x :} True
This finds the least solution, i.e. prefers False
over True
:
>>>
:{
let x = x &&& y y = y &&& x in (getR x, getR y) :} (False,False)
Use R (Dual Bool)
from Data.Recursive.DualBool if you want the greatest solution.
Documentation
A value of type R a
is a a
, but defined using only specific operations
(which you will find in the corresponding module, e.g.
Data.Recursive.Bool), which allow recursive definitions.
You can use getR
to extract the value.
Do not use the extracted value in the definition of that value, this will loop just like a recursive definition with plain values would.
getR :: HasPropagator a => R a -> a Source #
Extract the value from a R a
. This must not be used when _defining_ that value.