Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StdEnv-doc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
StdEnv-doc
Commits
ab41a6cb
Commit
ab41a6cb
authored
Aug 21, 2019
by
Steffen Michels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add == and < instance for ()
parent
dfe469d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
StdTuple.dcl
StdTuple.dcl
+2
-0
StdTuple.icl
StdTuple.icl
+9
-1
No files found.
StdTuple.dcl
View file @
ab41a6cb
...
...
@@ -19,9 +19,11 @@ snd3 tuple :== t2 where (_, t2, _) = tuple
// thd3 :: !(.a,.b,!.c) -> .c // t3 of (t1,t2,t3)
thd3
tuple
:==
t3
where
(_,
_,
t3
)
=
tuple
instance
==
()
::
!()
!()
->
Bool
:==
code {
pop_a
2
;
pushB
TRUE
}
instance
==
(
a
,
b
)
|
Eq
a
&
Eq
b
::
!(!
a
,
b
)
!(!
a
,
b
)
->
Bool
|
Eq
a
&
Eq
b
instance
==
(
a
,
b
,
c
)
|
Eq
a
&
Eq
b
&
Eq
c
::
!(!
a
,
b
,
c
)
!(!
a
,
b
,
c
)
->
Bool
|
Eq
a
&
Eq
b
&
Eq
c
instance
<
()
::
!()
!()
->
Bool
:==
code {
pop_a
2
;
pushB
FALSE
}
instance
<
(
a
,
b
)
|
Ord
a
&
Ord
b
::
!(!
a
,
b
)
!(!
a
,
b
)
->
Bool
|
Ord
a
&
Ord
b
instance
<
(
a
,
b
,
c
)
|
Ord
a
&
Ord
b
&
Ord
c
::
!(!
a
,
b
,
c
)
!(!
a
,
b
,
c
)
->
Bool
|
Ord
a
&
Ord
b
&
Ord
c
...
...
StdTuple.icl
View file @
ab41a6cb
...
...
@@ -21,6 +21,10 @@ snd3 tuple :== t2 where (_, t2, _) = tuple
// thd3 :: !(.a,.b,!.c) -> .c // t3 of (t1,t2,t3)
thd3
tuple
:==
t3
where
(_,
_,
t3
)
=
tuple
instance
==
()
where
(==)
::
!()
!()
->
Bool
(==)
_
_
=
code inline {
pop_a
2
;
pushB
TRUE
}
instance
==
(
a
,
b
)
|
Eq
a
&
Eq
b
where
(==)
::!(!
a
,
b
)
!(!
a
,
b
)
->
Bool
|
Eq
a
&
Eq
b
...
...
@@ -30,7 +34,11 @@ instance == (a,b,c) | Eq a & Eq b & Eq c
where
(==)
::!(!
a
,
b
,
c
)
!(!
a
,
b
,
c
)
->
Bool
|
Eq
a
&
Eq
b
&
Eq
c
(==)
(
x1
,
y1
,
z1
)
(
x2
,
y2
,
z2
)
=
x1
==
x2
&&
y1
==
y2
&&
z1
==
z2
instance
<
()
where
(<)
::
!()
!()
->
Bool
(<)
_
_
=
code inline {
pop_a
2
;
pushB
FALSE
}
instance
<
(
a
,
b
)
|
Ord
a
&
Ord
b
where
(<)
::!(!
a
,
b
)
!(!
a
,
b
)
->
Bool
|
Ord
a
&
Ord
b
...
...
Write
Preview
Markdown
is supported
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