Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
3a153dc9
Commit
3a153dc9
authored
Feb 12, 2002
by
Diederik van Arkel
Browse files
Remove unused strictness annotations
parent
449c3d5a
Changes
65
Hide whitespace changes
Inline
Side-by-side
Pm/PmEnvironment.icl
View file @
3a153dc9
...
...
@@ -14,7 +14,7 @@ emptyTargets
// = [t_StdEnv13,t_StdIO13] // 1.3
=
[
t_StdEnv20
,
t_StdIO20
]
// 2.0
t_StdEnv
::
!
Target
t_StdEnv
::
Target
t_StdEnv
// = t_StdEnv13 // 1.3
=
t_StdEnv20
// 2.0
...
...
@@ -154,7 +154,7 @@ PathOption = SimpleOption "Path" id const
//---
t_StdEnv13
::
!
Target
t_StdEnv13
::
Target
t_StdEnv13
=
{
target_name
=
"StdEnv"
,
target_path
=
...
...
@@ -206,7 +206,7 @@ t_StdIO13 =
,
target_meth
=
CompileSync
}
t_StdEnv20
::
!
Target
t_StdEnv20
::
Target
t_StdEnv20
=
{
target_name
=
"StdEnv"
,
target_path
=
...
...
Pm/PmFileInfo.dcl
View file @
3a153dc9
...
...
@@ -22,7 +22,7 @@ from PmAbcMagic import :: ABCCache, :: ABCOptions
,
objdate
::
!
DATE
}
FI_EmptyCache
::
!
FileInfoCache
FI_EmptyCache
::
FileInfoCache
FI_GetFileInfo
::
!
Processor
!
Pathname
!
ABCCache
!
FileInfoCache
!*
env
->
((!
ABCCache
,!
FileInfoCache
,
!
FileInfo
),!*
env
)
|
FileEnv
env
FI_UpdateAbcDate
::
!
Pathname
!
Pathname
!
Bool
!
FileInfoCache
!*
Files
->
((!
DATE
,!
FileInfoCache
),
!*
Files
)
FI_UpdateABCInfo
::
!
Pathname
!
Pathname
!
ABCCache
!
FileInfoCache
!*
Files
->
((!
DATE
,!
ABCCache
,!
FileInfoCache
),
!*
Files
)
...
...
@@ -30,4 +30,4 @@ FI_UpdateObjDate :: !Pathname !Pathname !FileInfoCache !*Files -> (!FileInfoCach
FI_UpdateFileInfo
::
!
Pathname
!(
FileInfo
->
FileInfo
)
!
FileInfoCache
->
FileInfoCache
FI_GetCleanModules
::
!
Pathname
!
StaticLibInfo
!
FileInfoCache
->
(!
List
Pathname
,
!
FileInfoCache
)
YoungestObj
::
!
DATE
!
FileInfoCache
->
!
DATE
YoungestObj
::
!
DATE
!
FileInfoCache
->
DATE
Pm/PmFileInfo.icl
View file @
3a153dc9
...
...
@@ -30,7 +30,7 @@ import PmAbcMagic
::
FileInfoCache
:==
List
FileInfo
FI_EmptyCache
::
!
FileInfoCache
FI_EmptyCache
::
FileInfoCache
FI_EmptyCache
=
Nil
FI_GetFileInfo
::
!
Processor
!
Pathname
!
ABCCache
!
FileInfoCache
!*
env
->
((!
ABCCache
,!
FileInfoCache
,
!
FileInfo
),!*
env
)
|
FileEnv
env
...
...
@@ -130,7 +130,7 @@ where
notLibraryObject
objpath
=
not
(
isProjLibraryModule
(
GetModuleName
objpath
)
libsinfo
)
// Finds the most recently modified .obj file in FileInfo...
YoungestObj
::
!
DATE
!
FileInfoCache
->
!
DATE
YoungestObj
::
!
DATE
!
FileInfoCache
->
DATE
YoungestObj
youngest
Nil
=
youngest
YoungestObj
youngest
({
objdate
}:!
rest
)
|
not
youngest
.
exists
...
...
Pm/PmPath.dcl
View file @
3a153dc9
definition
module
PmPath
import
StdFile
,
StdOverloaded
,
StdString
import
StdFile
,
StdOverloaded
//
, StdString
import
StdPathname
from
UtilStrictLists
import
::
List
from
PmTypes
import
::
Modulename
,
::
Processor
...
...
Pm/PmPrefs.icl
View file @
3a153dc9
...
...
@@ -191,7 +191,7 @@ emptyPrjPrefs =
//--
twSyntaxColours
::
!
SyntaxColours
twSyntaxColours
::
SyntaxColours
twSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
twTabs
...
...
@@ -202,7 +202,7 @@ twSyntaxColours =
,
keywordColour
=
twChar
}
cwSyntaxColours
::
!
SyntaxColours
cwSyntaxColours
::
SyntaxColours
cwSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
twTabs
...
...
@@ -213,7 +213,7 @@ cwSyntaxColours =
,
keywordColour
=
twChar
}
ewSyntaxColours
::
!
SyntaxColours
ewSyntaxColours
::
SyntaxColours
ewSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
twTabs
...
...
@@ -224,7 +224,7 @@ ewSyntaxColours =
,
keywordColour
=
twChar
}
scSyntaxColours
::
!
SyntaxColours
scSyntaxColours
::
SyntaxColours
scSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
scTabs
...
...
@@ -235,7 +235,7 @@ scSyntaxColours =
,
keywordColour
=
scKeyw
}
dmSyntaxColours
::
!
SyntaxColours
dmSyntaxColours
::
SyntaxColours
dmSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
scTabs
...
...
@@ -246,7 +246,7 @@ dmSyntaxColours =
,
keywordColour
=
scKeyw
}
imSyntaxColours
::
!
SyntaxColours
imSyntaxColours
::
SyntaxColours
imSyntaxColours
=
{
textColour
=
Black
,
tabColour
=
scTabs
...
...
Pm/PmProject.dcl
View file @
3a153dc9
...
...
@@ -77,10 +77,10 @@ PR_SysUptoDate :: !Project -> Bool
PR_ExecUpToDate
::
!
Project
->
Bool
PR_Saved
::
!
Project
->
Bool
PR_GetModuleInfo
::
!
Modulename
!
Project
->
!
Maybe
ModInfo
PR_GetModuleInfo
::
!
Modulename
!
Project
->
Maybe
ModInfo
PR_UpdateModule
::
!
Modulename
!(
!
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_UpdateModules
::
![
Modulename
]
!(
!
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_UpdateModule
::
!
Modulename
!(
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_UpdateModules
::
![
Modulename
]
!(
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_SetLinkOptions
::
!
Project
!
LinkOptions
->
Project
PR_GetLinkOptions
::
!
Project
->
LinkOptions
...
...
@@ -88,16 +88,16 @@ PR_GetLinkOptions :: !Project -> LinkOptions
PR_AddABCInfo
::
!
String
!(
List
LinkObjFileName
)
!(
List
LinkLibraryName
)
!
CompilerOptions
!
EditWdOptions
!
EditWdOptions
!
Project
->
Project
PR_GetABCLinkInfo
::
!
Project
->
!
ABCLinkInfo
PR_GetABCLinkInfo
::
!
Project
->
ABCLinkInfo
PR_GetStaticLibsInfo
::
!
Project
->
!
StaticLibInfo
PR_GetStaticLibsInfo
::
!
Project
->
StaticLibInfo
PR_SetStaticLibsInfo
::
!
StaticLibInfo
!
Project
->
Project
PR_GetTarget
::
!
Project
->
!
String
PR_GetTarget
::
!
Project
->
String
PR_SetTarget
::
!
String
!
Project
->
Project
PR_GetExecPath
::
!
Project
->
!
String
PR_SetExecPath
::
!
String
!
Project
->
!
Project
PR_GetExecPath
::
!
Project
->
String
PR_SetExecPath
::
!
String
!
Project
->
Project
SL_Add
::
!
String
!
StaticLibInfo
->
StaticLibInfo
SL_Rem
::
![
String
]
!
String
!
String
!
StaticLibInfo
->
StaticLibInfo
...
...
Pm/PmProject.icl
View file @
3a153dc9
...
...
@@ -57,7 +57,7 @@ Unmodified :== False;
,
abc
::
!
Bool
// abc up to date?
}
::
InfUpdate
:==
!
InfListItem
->
(!
InfListItem
,
!
Bool
)
::
InfUpdate
:==
InfListItem
->
(!
InfListItem
,
Bool
)
PR_InitProject
::
Project
;
PR_InitProject
=
...
...
@@ -80,10 +80,10 @@ PR_InitProject =
,
posl
=
Nothing
}
PR_GetExecPath
::
!
Project
->
!
String
PR_GetExecPath
::
!
Project
->
String
PR_GetExecPath
{
execpath
}
=
execpath
PR_SetExecPath
::
!
String
!
Project
->
!
Project
PR_SetExecPath
::
!
String
!
Project
->
Project
PR_SetExecPath
pth
prj
=
{
prj
&
execpath
=
pth
}
DefStaticLibInfo
=
...
...
@@ -172,7 +172,7 @@ where
,
info
.
compilerOptions
=
compilerOptions
},
True
)
TryInsertInList
::
!
String
!
String
!
InfList
->
!
InfList
TryInsertInList
::
!
String
!
String
!
InfList
->
InfList
TryInsertInList
importermn
importerdir
Nil
// no root module...
=
Nil
TryInsertInList
importermn
importerdir
((
root
=:{
mn
,
info
}):!
rest
)
...
...
@@ -182,7 +182,7 @@ where
#
rest
=
TryInsertImporter
rest
rest
=
root
:!
rest
where
TryInsertImporter
::
!
InfList
!
InfList
->
!
InfList
TryInsertImporter
::
!
InfList
!
InfList
->
InfList
TryInsertImporter
Nil
list
#
item
=
{
mn
=
importermn
,
...
...
@@ -431,7 +431,7 @@ PR_GetOpenModulenames project=:{inflist}
where
(
modnames
,_)
=
P_MapR
GetModulenames
inflist
GetModulenames
::
!
InfListItem
->
(
List
!
String
,!
Bool
)
GetModulenames
::
!
InfListItem
->
(
List
String
,!
Bool
)
GetModulenames
{
mn
,
info
={
dir
,
defopen
,
impopen
}}
|
defopen
&&
impopen
=
((
defname
:!
impname
:!
Nil
),
True
)
|
defopen
=
((
defname
:!
Nil
),
True
)
...
...
@@ -519,14 +519,14 @@ where
src
=
True
,
abc
=
True
};
PR_GetModuleInfo
::
!
Modulename
!
Project
->
!
Maybe
ModInfo
PR_GetModuleInfo
::
!
Modulename
!
Project
->
Maybe
ModInfo
PR_GetModuleInfo
mn
{
Project
|
inflist
}
#
item
=
FindInList
mn
inflist
|
isNothing
item
=
Nothing
=
Just
(
fromJust
item
).
InfListItem
.
info
PR_UpdateModule
::
!
Modulename
!(
!
ModInfo
->
ModInfo
)
!
Project
->
Project
;
PR_UpdateModule
::
!
Modulename
!(
ModInfo
->
ModInfo
)
!
Project
->
Project
;
PR_UpdateModule
mn
update
project
=:{
inflist
,
saved
}
=
{
project
&
inflist
=
infl`
,
saved
=
saved
&&
unchanged
};
where
...
...
@@ -556,7 +556,7 @@ eqCO co1 co2
co1
.
bv
==
co2
.
bv
&&
co1
.
gc
==
co2
.
gc
PR_UpdateModules
::
![
Modulename
]
!(
!
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_UpdateModules
::
![
Modulename
]
!(
ModInfo
->
ModInfo
)
!
Project
->
Project
PR_UpdateModules
mn
update
project
=
seq
[(
PR_UpdateModule
m
update
)
\\
m
<-
mn
]
project
// DvA quick hack, not very efficient!
...
...
@@ -576,7 +576,7 @@ where
#
(
first
,
changed
)
=
update
first
=
(
Reverse2
acc
(
first
:!
rest
),
changed
)
FindInList
::
!
String
!
InfList
->
!
Maybe
InfListItem
FindInList
::
!
String
!
InfList
->
Maybe
InfListItem
FindInList
key
Nil
=
Nothing
FindInList
key
((
itm
=:{
mn
,
info
}):!
rest
)
|
mn
<>
key
=
FindInList
key
rest
=
Just
itm
...
...
@@ -742,7 +742,7 @@ SubstitutePath applicationDir projectDir path
//---
PR_GetABCLinkInfo
::
!
Project
->
!
ABCLinkInfo
;
PR_GetABCLinkInfo
::
!
Project
->
ABCLinkInfo
;
PR_GetABCLinkInfo
project
=:{
inflist
}
#
allLinkInfoRecords
=
map
(\{
InfListItem
|
info
={
abcLinkInfo
}}
->
abcLinkInfo
)
(
StrictListToList
inflist
);
oneLinkInfoRecord
=
foldl
mergeTwoRecords
emptyRecord
allLinkInfoRecords
;
...
...
@@ -757,14 +757,14 @@ where
//---
PR_GetStaticLibsInfo
::
!
Project
->
!
StaticLibInfo
PR_GetStaticLibsInfo
::
!
Project
->
StaticLibInfo
PR_GetStaticLibsInfo
{
Project
|
staticLibInfo
}
=
staticLibInfo
PR_SetStaticLibsInfo
::
!
StaticLibInfo
!
Project
->
Project
PR_SetStaticLibsInfo
staticLibInfo
project
=
{
Project
|
project
&
staticLibInfo
=
staticLibInfo
}
PR_GetTarget
::
!
Project
->
!
String
PR_GetTarget
::
!
Project
->
String
PR_GetTarget
{
Project
|
target
}
=
target
PR_SetTarget
::
!
String
!
Project
->
Project
...
...
Util/ExtListBox.icl
View file @
3a153dc9
...
...
@@ -413,7 +413,7 @@ keyFilter :: KeyboardState -> Bool
keyFilter
(
SpecialKey
_
(
KeyDown
True
)
_)
=
True
keyFilter
_
=
False
keyboard
::
!.
KeyboardState
!*((.
ExtListBoxState
*(
PSt
.
a
),.
b
),!*
PSt
.
a
)
->
!
*((
ExtListBoxState
*(
PSt
.
a
),.
b
),!*
PSt
.
a
);
keyboard
::
!.
KeyboardState
!*((.
ExtListBoxState
*(
PSt
.
a
),.
b
),!*
PSt
.
a
)
->
*((
ExtListBoxState
*(
PSt
.
a
),.
b
),!*
PSt
.
a
);
keyboard
(
SpecialKey
key
(
KeyDown
repeat
)
{
shiftDown
,
controlDown
})
((
lbState
=:{
tMargin
,
listboxId
,
selection
,
items
,
lineHeight
,
funs
,
shiftfuns
},
ls
),
ps
)
|
key
==
enterKey
||
key
==
returnKey
|
not
hasSelection
...
...
Util/FilteredListBox.dcl
View file @
3a153dc9
...
...
@@ -19,12 +19,12 @@ openFilteredListBoxId :: !*env -> (!FilteredListBoxId,!*env) | Ids env
appendFilteredListBoxItems
::
!
FilteredListBoxId
![
FilteredListBoxItem
]
!(
PSt
.
l
)
->
PSt
.
l
setFilteredListBoxPen
::
!
FilteredListBoxId
![
PenAttribute
]
!(
PSt
.
l
)
->
PSt
.
l
exec_next_filtered
::
!
Bool
!
FilteredListBoxId
(
!
String
!
(
PSt
.
l
)
->
(
PSt
.
l
))
!(
PSt
.
l
)
->
(
PSt
.
l
)
exec_next_filtered
::
!
Bool
!
FilteredListBoxId
(
String
(
PSt
.
l
)
->
(
PSt
.
l
))
!(
PSt
.
l
)
->
(
PSt
.
l
)
flbMouse
::
({#
Char
}
->
.(*(
PSt
.
a
)
->
*
PSt
.
a
))
->
.
ControlAttribute
*((
FilteredListBoxState
,.
b
),*
PSt
.
a
);
flbKeyboard
::
({#
Char
}
->
.(*(
PSt
.
a
)
->
*
PSt
.
a
))
->
.
ControlAttribute
*((
FilteredListBoxState
,.
b
),*
PSt
.
a
);
::
FilteredListBoxState
setFilter
::
!
FilteredListBoxId
(
!
String
->
Bool
)
!(
PSt
.
l
)
->
PSt
.
l
setFilter
::
!
FilteredListBoxId
(
String
->
Bool
)
!(
PSt
.
l
)
->
PSt
.
l
getFilter
::
!
FilteredListBoxId
!(
PSt
.
l
)
->
(!
String
->
Bool
,
PSt
.
l
)
Util/FilteredListBox.icl
View file @
3a153dc9
...
...
@@ -37,7 +37,7 @@ openFilteredListBoxId env
|
FInCloseAllItems
// Request to remove all current items
|
FInSetPen
[
PenAttribute
]
// Request to set control pen
|
FInGetPen
// Request to get control pen
|
FInSetFilter
(
!
String
->
Bool
)
|
FInSetFilter
(
String
->
Bool
)
|
FInGetFilter
::
FilteredMessageOut
...
...
@@ -49,7 +49,7 @@ openFilteredListBoxId env
|
FOutSetPen
// Reply to set the control pen
|
FOutGetPen
[
PenAttribute
]
// Reply to get the control pen
|
FOutSetFilter
|
FOutGetFilter
(
!
String
->
Bool
)
|
FOutGetFilter
(
String
->
Bool
)
::
FilteredListBoxItem
:==
String
...
...
@@ -532,7 +532,7 @@ setFilteredListBoxPen :: !FilteredListBoxId ![PenAttribute] !(PSt .l) -> PSt .l
setFilteredListBoxPen
{
freceiverId
}
pen
ps
=
snd
(
syncSend2
freceiverId
(
FInSetPen
pen
)
ps
)
setFilter
::
!
FilteredListBoxId
(
!
String
->
Bool
)
!(
PSt
.
l
)
->
PSt
.
l
setFilter
::
!
FilteredListBoxId
(
String
->
Bool
)
!(
PSt
.
l
)
->
PSt
.
l
setFilter
{
freceiverId
}
flt
ps
=
snd
(
syncSend2
freceiverId
(
FInSetFilter
flt
)
ps
)
...
...
@@ -545,7 +545,7 @@ getFilter {freceiverId} ps
_
->
const
True
=
(
out
,
ps
)
exec_next_filtered
::
!
Bool
!
FilteredListBoxId
(
!
String
!
(
PSt
.
l
)
->
(
PSt
.
l
))
!(
PSt
.
l
)
->
(
PSt
.
l
)
exec_next_filtered
::
!
Bool
!
FilteredListBoxId
(
String
(
PSt
.
l
)
->
(
PSt
.
l
))
!(
PSt
.
l
)
->
(
PSt
.
l
)
exec_next_filtered
next
lbId
efun
ps
#
((
ok
,
sel
),
ps
)
=
getFilteredListBoxSelection
lbId
ps
|
not
ok
=
ps
...
...
Util/StateMonad.dcl
View file @
3a153dc9
...
...
@@ -3,7 +3,7 @@ definition module StateMonad
// a general-purpose state monad (implemented by macros)
::
StateM
state
a
:==
!
state
->
*(
a
,
!
state
)
:==
state
->
*(
a
,
state
)
// basic monad operations as macro definitions
...
...
Util/StateMonad.icl
View file @
3a153dc9
...
...
@@ -3,7 +3,7 @@ implementation module StateMonad
// a general-purpose state monad (implemented by macros)
::
StateM
state
a
:==
!
state
->
*(
a
,
!
state
)
:==
state
->
*(
a
,
state
)
/*
...
...
Util/StdPathname.dcl
View file @
3a153dc9
...
...
@@ -6,9 +6,9 @@ EmptyPathname :== ""
RemovePath
::
!
Pathname
->
String
RemoveSuffix
::
!
Pathname
->
String
RemoveSuffix`
::
!
Pathname
->
String
;
RemoveSuffix`
::
!
Pathname
->
String
RemoveFilename
::
!
Pathname
->
Pathname
replace_prefix_path
::
!
Pathname
!
Pathname
!
Pathname
->
!
Pathname
replace_prefix_path
::
!
Pathname
!
Pathname
!
Pathname
->
Pathname
equal_suffix
::
!
String
!
String
->
Bool
IsFullPathname
::
!
Pathname
->
Bool
MakeFullPathname
::
!
Pathname
!
String
->
Pathname
...
...
Util/StdPathname.icl
View file @
3a153dc9
...
...
@@ -64,7 +64,7 @@ RemoveFilename path
where
(
found
,
position
)
=
FindLastChar
dirseparator
path
(
dec
(
size
path
));
replace_prefix_path
::
!
Pathname
!
Pathname
!
Pathname
->
!
Pathname
;
replace_prefix_path
::
!
Pathname
!
Pathname
!
Pathname
->
Pathname
;
replace_prefix_path
old_prefix_path
new_prefix_path
path
|
old_prefix_path
==
path
=
new_prefix_path
;
...
...
@@ -105,7 +105,7 @@ FindLastChar c s i
|
c
==
s
.[
i
]
=
(
True
,
i
);
=
FindLastChar
c
s
(
dec
i
);
LastChar
::
!
Char
!
String
!
Int
->
!
Int
;
LastChar
::
!
Char
!
String
!
Int
->
Int
;
LastChar
c
s
i
|
i
<=
0
=
-1
;
|
c
==
s
.[
i
]
=
i
;
...
...
Util/StdRegExp.dcl
View file @
3a153dc9
...
...
@@ -2,17 +2,17 @@ definition module StdRegExp
import
StdOverloaded
,
StdParsComb
,
StdMaybe
::
StrSlice
:==
!
(![
Char
],!(!
Int
,!
Int
))
// slice = found string with begin and end position
::
StrSlice
:==
(![
Char
],!(!
Int
,!
Int
))
// slice = found string with begin and end position
// which is relative to previous string found
::
StrResult
:==
!
(!
StrSlice
,![
StrSlice
])
// found string + list of found substrings
::
StrResult
:==
(!
StrSlice
,![
StrSlice
])
// found string + list of found substrings
::
Cparser
a
b
:==
CParser
!
Char
!
a
!
b
::
Cparser
a
b
:==
CParser
Char
a
b
Beginmark
:==
'\000'
// character reserved for marking begin of substring
Endmark
:==
'\001'
// character reserved for marking end of substring
findParser
::
Parser
Char
(
Parser
Char
StrSlice
)
replaceOne_RE
::
[.
Char
]
.
StrResult
->
(.
Maybe
{#
Char
},
Maybe
.[
Char
]);
replaceOne_RE
::
[.
Char
]
!
.
StrResult
->
(.
Maybe
{#
Char
},
Maybe
.[
Char
]);
massageResult
::
![
Char
]
->
StrResult
// The string to search for is specified by using a Regular Expression:
...
...
Util/StdRegExp.icl
View file @
3a153dc9
...
...
@@ -36,9 +36,9 @@ where (+) s t = s +++ t
// **************************
::
Cparser
a
b
:==
CParser
!
Char
!
a
!
b
::
StrSlice
:==
!
(![
Char
],!(!
Int
,!
Int
))
::
StrResult
:==
!
(!
StrSlice
,![
StrSlice
])
::
Cparser
a
b
:==
CParser
Char
a
b
::
StrSlice
:==
(![
Char
],!(!
Int
,!
Int
))
::
StrResult
:==
(!
StrSlice
,![
StrSlice
])
Beginmark
:==
'\000'
// character reserved for marking begin of substring
Endmark
:==
'\001'
// character reserved for marking end of substring
...
...
@@ -213,7 +213,7 @@ replaceParser
<@
\
pExpr
arg
->
flatten
(
map
(\
f
->
f
arg
)
pExpr
)
)
replaceOne_RE
::
[.
Char
]
.
StrResult
->
(.
Maybe
{#
Char
},
Maybe
.[
Char
]);
replaceOne_RE
::
[.
Char
]
!
.
StrResult
->
(.
Maybe
{#
Char
},
Maybe
.[
Char
]);
replaceOne_RE
rep
string
=
case
(
replaceParser
rep
)
of
[]
->
(
Just
"no valid replace pattern"
,
Nothing
)
...
...
Util/StrictList.dcl
View file @
3a153dc9
...
...
@@ -5,12 +5,12 @@ from StdClass import class ==
// Strict lists consume less space than normal lists
::
StrictList
a
=
SCons
!
a
(
!
StrictList
a
)
=
SCons
!
a
!
(
StrictList
a
)
|
SNil
instance
==
(
StrictList
a
)
|
==
a
slAppend
::
!(
StrictList
.
a
)
!
u
:(
StrictList
.
a
)
->
!
u
:
StrictList
.
a
slAppend
::
!(
StrictList
.
a
)
!
u
:(
StrictList
.
a
)
->
u
:
StrictList
.
a
slReverse
::
!(
StrictList
a
)
->
StrictList
a
slSplitAt
::
!
Int
u
:(
StrictList
.
a
)
->
(
StrictList
.
a
,
u
:
StrictList
.
a
)
slFromList
::
![
a
]
->
StrictList
a
...
...
Util/StrictList.icl
View file @
3a153dc9
...
...
@@ -3,7 +3,7 @@ implementation module StrictList
import
StdInt
,
StdMisc
,
StdBool
::
StrictList
a
=
SCons
!
a
(
!
StrictList
a
)
=
SCons
!
a
!
(
StrictList
a
)
|
SNil
instance
==
(
StrictList
a
)
|
==
a
where
...
...
@@ -11,7 +11,7 @@ instance == (StrictList a) | == a where
(==)
(
SCons
x
xs
)
(
SCons
y
ys
)
=
x
==
y
&&
xs
==
ys
(==)
_
_
=
False
slAppend
::
!(
StrictList
.
a
)
!
u
:(
StrictList
.
a
)
->
!
u
:
StrictList
.
a
slAppend
::
!(
StrictList
.
a
)
!
u
:(
StrictList
.
a
)
->
u
:
StrictList
.
a
slAppend
SNil
list`
=
list`
slAppend
(
SCons
x
list
)
list`
=
SCons
x
(
slAppend
list
list`
)
...
...
Util/UtilDate.icl
View file @
3a153dc9
...
...
@@ -17,7 +17,7 @@ where
fromString
string
=
ConvertToDate
string
where
ConvertToDate
::
!
String
->
!
DATE
ConvertToDate
::
!
String
->
DATE
ConvertToDate
str
|
colpos
>=
strlen
=
NoDate
=
{
exists
=
first
==
'y'
||
first
==
'Y'
,
...
...
@@ -50,7 +50,7 @@ where
acc`
=
10
*
acc
+
(
toInt
cur
)
-
(
toInt
'0'
)
cur
=
str
.[
fro
]
FindSpace
::
!
Int
!
Int
!
String
->
!
Int
FindSpace
::
!
Int
!
Int
!
String
->
Int
FindSpace
i
len
str
|
i
>=
len
||
str
.[
i
]
==
' '
=
i
=
FindSpace
(
inc
i
)
len
str
...
...
Util/UtilStrictLists.dcl
View file @
3a153dc9
...
...
@@ -4,39 +4,39 @@ import StdString, StdClass
// A strict list data structure
::
List
t
=
(:!)
infixr
0
!
t
(
!
List
t
)
::
List
t
=
(:!)
infixr
0
!
t
!
(
List
t
)
|
Nil
instance
toString
(
List
a
)
|
toString
a
Singleton
::
!(
List
t
)
->
t
;
IsEmptyList
::
!(
List
t
)
->
Bool
;
Head
::
!(
List
t
)
->
t
;
Concat
::
!(
List
.
t
)
!
u
:(
List
.
t
)
->
!
u
:
List
.
t
;
Reverse
::
!(
List
t
)
->
List
t
;
Reverse2
::
!(
List
.
a
)
!
u
:(
List
.
a
)
->
v
:
List
.
a
,
[
u
<=
v
]
;
LLength
::
!(
List
t
)
->
Int
;
FilterR
::
(
!
s
->
Bool
)
!(
List
s
)
->
List
s
;
Filter
::
(
!
s
->
Bool
)
!(
List
s
)
->
List
s
;
Append
::
!(
List
t
)
!
t
->
List
t
;
Select
::
!(
List
t
)
!
Int
->
t
;
Update2
::
!(
List
(
List
t
))
!
Int
!
Int
!
t
->
List
(
List
t
)
;
AppendLists
::
!(
List
.
a
)
!
u
:(
List
.
a
)
->
v
:
List
.
a
,
[
u
<=
v
]
;
FlattenList
::
!(
List
(
List
.
a
))
->
List
.
a
;
P_MapR
::
!(
!
s
->
(
!
t
,
!
Bool
))
!(
List
s
)
->
(!
List
t
,!
Bool
)
Singleton
::
!(
List
t
)
->
t
IsEmptyList
::
!(
List
t
)
->
Bool
Head
::
!(
List
t
)
->
t
Concat
::
!(
List
.
t
)
!
u
:(
List
.
t
)
->
u
:
List
.
t
Reverse
::
!(
List
t
)
->
List
t
Reverse2
::
!(
List
.
a
)
!
u
:(
List
.
a
)
->
v
:
List
.
a
,
[
u
<=
v
]
LLength
::
!(
List
t
)
->
Int
FilterR
::
!
(
s
->
Bool
)
!(
List
s
)
->
List
s
Filter
::
!
(
s
->
Bool
)
!(
List
s
)
->
List
s
Append
::
!(
List
t
)
!
t
->
List
t
Select
::
!(
List
t
)
!
Int
->
t
Update2
::
!(
List
(
List
t
))
!
Int
!
Int
!
t
->
List
(
List
t
)
AppendLists
::
!(
List
.
a
)
!
u
:(
List
.
a
)
->
v
:
List
.
a
,
[
u
<=
v
]
FlattenList
::
!(
List
(
List
.
a
))
->
List
.
a
P_MapR
::
!(
s
->
(
t
,
Bool
))
!(
List
s
)
->
(!
List
t
,!
Bool
)
InsertStringInList
::
!
String
!(
List
String
)
->
List
String
;
InsertStringInList
::
!
String
!(
List
String
)
->
List
String
RemoveDup
::
!.(
List
a
)
->
.(
List
a
)
|
Eq
a
RemoveStringFromList
::
!
String
!(
List
String
)
->
List
String
;
RemoveMember
::
a
!
u
:(
List
a
)
->
v
:
List
a
|
==
a
,
[
u
<=
v
]
;
RemoveMembers
::
!
u
:(
List
a
)
!.(
List
a
)
->
v
:
List
a
|
==
a
,
[
u
<=
v
]
;
UnionStringList
::
!(
List
String
)
!(
List
String
)
->
List
String
;
StringOccurs
::
!
String
!.(
List
String
)
->
Bool
;
SortStrings
::
!.(
List
String
)
->
.
List
String
;
EQStrings
::
!(
List
String
)
!(
List
String
)
->
Bool
;
RemoveStringFromList
::
!
String
!(
List
String
)
->
List
String
RemoveMember
::
a
!
u
:(
List
a
)
->
v
:
List
a
|
==
a
,
[
u
<=
v
]
RemoveMembers
::
!
u
:(
List
a
)
!.(
List
a
)
->
v
:
List
a
|
==
a
,
[
u
<=
v
]
UnionStringList
::
!(
List
String
)
!(
List
String
)
->
List
String
StringOccurs
::
!
String
!.(
List
String
)
->
Bool
SortStrings
::
!.(
List
String
)
->
.
List
String
EQStrings
::
!(
List
String
)
!(
List
String
)
->
Bool
InclString
::
!
String
!(
List
String
)
->
List
String
StrictListToList
::
!(
List
.
a
)
->
[.
a
]
;
ListToStrictList
::
![.
a
]
->
(
List
.
a
)
;
Map
::
!(
!
s
->
t
)
!(
List
s
)
->
List
t
;
MapR
::
!(
!
s
->
t
)
!(
List
s
)
->
List
t
;
// reverses!!!
StrictListToList
::
!(
List
.
a
)
->
[.
a
]
ListToStrictList
::
![.
a
]
->
(
List
.
a
)
Map
::
!(
s
->
t
)
!(
List
s
)
->
List
t
MapR
::
!(
s
->
t
)
!(
List
s
)
->
List
t
// reverses!!!
Prev
1
2
3
4
Next
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