Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Wieczerkowski
curry-libs
Commits
ee3fdd0c
Commit
ee3fdd0c
authored
Jan 21, 2020
by
Finn Teegen
Browse files
Fix unification operators in combination with Data contexts
parent
6f8a79e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Prelude.curry
View file @
ee3fdd0c
...
...
@@ -1983,8 +1983,6 @@ doSolve b | b = return ()
#ifdef __PAKCS__
(=:=) = 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 external
#else
...
...
@@ -1993,14 +1991,24 @@ constrEq external
--- Non-strict equational constraint. Used to implement functional patterns.
(=:<=) :: Data a => a -> a -> Bool
#ifdef __PAKCS__
(=:<=) = unifEq
unifEq :: a -> a -> Bool
unifEq external
#else
(=:<=) external
#endif
#ifdef __PAKCS__
--- Non-strict equational constraint for linear functional patterns.
--- Thus, it must be ensured that the first argument is always (after evalutation
--- by narrowing) a linear pattern. Experimental.
(=:<<=) :: Data a => a -> a -> Bool
(=:<<=) external
(=:<<=) = unifEqLinear
unifEqLinear :: a -> a -> Bool
unifEqLinear external
--- internal function to implement =:<=
ifVar :: _ -> a -> a -> a
...
...
Prelude.pakcs
View file @
ee3fdd0c
...
...
@@ -97,11 +97,11 @@
<library>
prim_standard
</library>
<entry>
constrEq[raw]
</entry>
</primitive>
<primitive
name=
"
=:<=
"
arity=
"
3
"
>
<primitive
name=
"
unifEq
"
arity=
"
2
"
>
<library>
prim_standard
</library>
<entry>
unifEq[raw]
</entry>
</primitive>
<primitive
name=
"
=:<<=
"
arity=
"
3
"
>
<primitive
name=
"
unifEqLinear
"
arity=
"
2
"
>
<library>
prim_standard
</library>
<entry>
unifEqLinear[raw]
</entry>
</primitive>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment