Commit ee3fdd0c authored by Finn Teegen's avatar Finn Teegen
Browse files

Fix unification operators in combination with Data contexts

parent 6f8a79e6
...@@ -1983,8 +1983,6 @@ doSolve b | b = return () ...@@ -1983,8 +1983,6 @@ doSolve b | b = return ()
#ifdef __PAKCS__ #ifdef __PAKCS__
(=:=) = constrEq (=:=) = constrEq
-- For this operator we cannot remove the Data dictionary in the prolog code
-- Thus, we generalize the type of the external definition.
constrEq :: a -> a -> Bool constrEq :: a -> a -> Bool
constrEq external constrEq external
#else #else
...@@ -1993,14 +1991,24 @@ constrEq external ...@@ -1993,14 +1991,24 @@ constrEq external
--- Non-strict equational constraint. Used to implement functional patterns. --- Non-strict equational constraint. Used to implement functional patterns.
(=:<=) :: Data a => a -> a -> Bool (=:<=) :: Data a => a -> a -> Bool
#ifdef __PAKCS__
(=:<=) = unifEq
unifEq :: a -> a -> Bool
unifEq external
#else
(=:<=) external (=:<=) external
#endif
#ifdef __PAKCS__ #ifdef __PAKCS__
--- Non-strict equational constraint for linear functional patterns. --- Non-strict equational constraint for linear functional patterns.
--- Thus, it must be ensured that the first argument is always (after evalutation --- Thus, it must be ensured that the first argument is always (after evalutation
--- by narrowing) a linear pattern. Experimental. --- by narrowing) a linear pattern. Experimental.
(=:<<=) :: Data a => a -> a -> Bool (=:<<=) :: Data a => a -> a -> Bool
(=:<<=) external (=:<<=) = unifEqLinear
unifEqLinear :: a -> a -> Bool
unifEqLinear external
--- internal function to implement =:<= --- internal function to implement =:<=
ifVar :: _ -> a -> a -> a ifVar :: _ -> a -> a -> a
......
...@@ -97,11 +97,11 @@ ...@@ -97,11 +97,11 @@
<library>prim_standard</library> <library>prim_standard</library>
<entry>constrEq[raw]</entry> <entry>constrEq[raw]</entry>
</primitive> </primitive>
<primitive name="=:&lt;=" arity="3"> <primitive name="unifEq" arity="2">
<library>prim_standard</library> <library>prim_standard</library>
<entry>unifEq[raw]</entry> <entry>unifEq[raw]</entry>
</primitive> </primitive>
<primitive name="=:&lt;&lt;=" arity="3"> <primitive name="unifEqLinear" arity="2">
<library>prim_standard</library> <library>prim_standard</library>
<entry>unifEqLinear[raw]</entry> <entry>unifEqLinear[raw]</entry>
</primitive> </primitive>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment