Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
clean-libraries
Commits
e504a61b
Commit
e504a61b
authored
Jun 27, 2002
by
John van Groningen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added !'s
parent
d5992d29
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
StdEnv/StdList.dcl
StdEnv/StdList.dcl
+3
-3
StdEnv/StdList.icl
StdEnv/StdList.icl
+3
-3
No files found.
StdEnv/StdList.dcl
View file @
e504a61b
definition
module
StdList
// ****************************************************************************************
// Concurrent Clean Standard Library Module Version 2.0
// Concurrent Clean Standard Library Module Version 2.0
1
// Copyright 1998 University of Nijmegen
// ****************************************************************************************
...
...
@@ -22,7 +22,7 @@ instance fromString [x] | fromChar x // Convert String via [Char] into [x]
// List Operators:
(!!)
infixl
9
::
![.
a
]
Int
->
.
a
// Get nth element of the list
(!!)
infixl
9
::
![.
a
]
!
Int
->
.
a
// Get nth element of the list
(++)
infixr
5
::
![.
a
]
u
:[.
a
]
->
u
:[.
a
]
// Append args
flatten
::
![[.
a
]]
->
[.
a
]
// e0 ++ e1 ++ ... ++ e##
isEmpty
::
![.
a
]
->
Bool
// [] ?
...
...
@@ -43,7 +43,7 @@ reverse :: ![.a] -> [.a] // Reverse the list
insert
::
(
a
->
a
->
.
Bool
)
a
!
u
:[
a
]
->
u
:[
a
]
// Insert arg2 when pred arg2 elem holds
insertAt
::
!
Int
.
a
u
:[.
a
]
->
u
:[.
a
]
// Insert arg2 on position arg1 in list
removeAt
::
!
Int
!
u
:[.
a
]
->
u
:[.
a
]
// Remove arg2!!arg1 from list
updateAt
::
!
Int
.
a
u
:[.
a
]
->
u
:[.
a
]
// Replace list!!arg1 by arg2
updateAt
::
!
Int
.
a
!
u
:[.
a
]
->
u
:[.
a
]
// Replace list!!arg1 by arg2
splitAt
::
!
Int
u
:[.
a
]
->
([.
a
],
u
:[.
a
])
// (take n list,drop n list)
// Creating lists:
...
...
StdEnv/StdList.icl
View file @
e504a61b
implementation
module
StdList
// ****************************************************************************************
// Concurrent Clean Standard Library Module Version 2.0
// Concurrent Clean Standard Library Module Version 2.0
1
// Copyright 1998 University of Nijmegen
// ****************************************************************************************
...
...
@@ -81,7 +81,7 @@ instance fromString [x] | fromChar x
// ****************************************************************************************
// standard operators
// ****************************************************************************************
(!!)
infixl
9
::![.
a
]
Int
->
.
a
(!!)
infixl
9
::![.
a
]
!
Int
->
.
a
(!!)
[]
_
=
subscript_error
(!!)
list
i
...
...
@@ -188,7 +188,7 @@ removeAt 0 [y : ys] = ys
removeAt
n
[
y
:
ys
]
=
[
y
:
removeAt
(
n
-1
)
ys
]
removeAt
n
[]
=
[]
updateAt
::
!
Int
.
a
u
:[.
a
]
->
u
:[.
a
]
updateAt
::
!
Int
.
a
!
u
:[.
a
]
->
u
:[.
a
]
updateAt
0
x
[]
=
[]
updateAt
0
x
[
y
:
ys
]
=
[
x
:
ys
]
updateAt
_
x
[]
=
[]
...
...
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