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-libraries
Commits
16e84882
Commit
16e84882
authored
Nov 24, 1999
by
Peter Achten
Browse files
PA: In StdPSt: PSt is now an instance of the FileSystem class.
In StdMaybe redundant appMaybe (mapMaybe) removed.
parent
2c304eef
Changes
6
Hide whitespace changes
Inline
Side-by-side
ObjectIO/ObjectIO/StdMaybe.dcl
View file @
16e84882
...
@@ -18,10 +18,6 @@ isJust :: !(Maybe .x) -> Bool // case @1 of (Just _) -> True; _ -> False
...
@@ -18,10 +18,6 @@ isJust :: !(Maybe .x) -> Bool // case @1 of (Just _) -> True; _ -> False
isNothing
::
!(
Maybe
.
x
)
->
Bool
// not o isJust
isNothing
::
!(
Maybe
.
x
)
->
Bool
// not o isJust
fromJust
::
!(
Maybe
.
x
)
->
.
x
// \(Just x) -> x
fromJust
::
!(
Maybe
.
x
)
->
.
x
// \(Just x) -> x
appMaybe
::
.(
IdFun
.
x
)
!(
Maybe
.
x
)
->
Maybe
.
x
// appMaybe f (Just x) = Just (f x)
// appMaybe f Nothing = Nothing
accMaybe
::
.(
St
.
x
.
a
)
!(
Maybe
.
x
)
->
(!
Maybe
.
a
,!
Maybe
.
x
)
accMaybe
::
.(
St
.
x
.
a
)
!(
Maybe
.
x
)
->
(!
Maybe
.
a
,!
Maybe
.
x
)
// accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f (Just x) = (Just (fst (f x)),Just (snd (f x)))
// accMaybe f Nothing = (Nothing,Nothing)
// accMaybe f Nothing = (Nothing,Nothing)
...
...
ObjectIO/ObjectIO/StdMaybe.icl
View file @
16e84882
...
@@ -25,10 +25,6 @@ isNothing _ = False
...
@@ -25,10 +25,6 @@ isNothing _ = False
fromJust
::
!(
Maybe
.
x
)
->
.
x
fromJust
::
!(
Maybe
.
x
)
->
.
x
fromJust
(
Just
x
)
=
x
fromJust
(
Just
x
)
=
x
appMaybe
::
.(
IdFun
.
x
)
!(
Maybe
.
x
)
->
Maybe
.
x
appMaybe
f
(
Just
x
)
=
Just
(
f
x
)
appMaybe
_
nothing
=
nothing
accMaybe
::
.(
St
.
x
.
a
)
!(
Maybe
.
x
)
->
(!
Maybe
.
a
,!
Maybe
.
x
)
accMaybe
::
.(
St
.
x
.
a
)
!(
Maybe
.
x
)
->
(!
Maybe
.
a
,!
Maybe
.
x
)
accMaybe
f
(
Just
x
)
accMaybe
f
(
Just
x
)
#
(
a
,
x
)
=
f
x
#
(
a
,
x
)
=
f
x
...
...
ObjectIO/ObjectIO/StdPSt.dcl
View file @
16e84882
...
@@ -18,6 +18,7 @@ from channelenv import ChannelEnv // MW11++
...
@@ -18,6 +18,7 @@ from channelenv import ChannelEnv // MW11++
/* PSt is an environment instance of the following classes:
/* PSt is an environment instance of the following classes:
- FileSystem (see StdFile)
- FileEnv (see StdFile)
- FileEnv (see StdFile)
- FileSelectEnv (see StdFileSelect)
- FileSelectEnv (see StdFileSelect)
- TimeEnv (see StdTime)
- TimeEnv (see StdTime)
...
@@ -27,6 +28,7 @@ from channelenv import ChannelEnv // MW11++
...
@@ -27,6 +28,7 @@ from channelenv import ChannelEnv // MW11++
IOSt is also an environment instance of the classes FileEnv, TimeEnv & ChannelEnv
IOSt is also an environment instance of the classes FileEnv, TimeEnv & ChannelEnv
*/
*/
instance
FileSystem
(
PSt
.
l
.
p
)
instance
FileEnv
(
PSt
.
l
.
p
),
(
IOSt
.
l
.
p
)
// MW11 added IOSt
instance
FileEnv
(
PSt
.
l
.
p
),
(
IOSt
.
l
.
p
)
// MW11 added IOSt
instance
FileSelectEnv
(
PSt
.
l
.
p
)
instance
FileSelectEnv
(
PSt
.
l
.
p
)
instance
TimeEnv
(
PSt
.
l
.
p
),
(
IOSt
.
l
.
p
)
// MW11 added IOSt
instance
TimeEnv
(
PSt
.
l
.
p
),
(
IOSt
.
l
.
p
)
// MW11 added IOSt
...
...
ObjectIO/ObjectIO/StdPSt.icl
View file @
16e84882
...
@@ -18,6 +18,37 @@ from ostoolbox import OSNewToolbox, WorldGetToolbox, WorldSetToolbox
...
@@ -18,6 +18,37 @@ from ostoolbox import OSNewToolbox, WorldGetToolbox, WorldSetToolbox
import
StdReceiver
,
receiverid
,
receiverhandle
,
receiverdevice
,
channelenv
// MW11++
import
StdReceiver
,
receiverid
,
receiverhandle
,
receiverdevice
,
channelenv
// MW11++
/* PSt is an environment instance of the class FileEnv (see StdFile).
*/
instance
FileSystem
(
PSt
.
l
.
p
)
where
fopen
::
!{#
Char
}
!
Int
!(
PSt
.
l
.
p
)
->
(!
Bool
,!*
File
,!
PSt
.
l
.
p
)
fopen
fName
fMode
pState
#
((
ok
,
file
),
pState
)
=
accFiles
(
fopen`
fName
fMode
)
pState
=
(
ok
,
file
,
pState
)
where
fopen`
::
!{#
Char
}
!
Int
!*
Files
->
(!(!
Bool
,!*
File
),!*
Files
)
fopen`
fName
fMode
files
#
(
ok
,
file
,
files
)
=
fopen
fName
fMode
files
=
((
ok
,
file
),
files
)
fclose
::
!*
File
!(
PSt
.
l
.
p
)
->
(!
Bool
,!
PSt
.
l
.
p
)
fclose
file
pState
=
accFiles
(
fclose
file
)
pState
stdio
::
!(
PSt
.
l
.
p
)
->
(!*
File
,!
PSt
.
l
.
p
)
stdio
pState
=
accFiles
stdio
pState
sfopen
::
!{#
Char
}
!
Int
!(
PSt
.
l
.
p
)
->
(!
Bool
,!
File
,!
PSt
.
l
.
p
)
sfopen
fName
fMode
pState
#
((
ok
,
sfile
),
pState
)
=
accFiles
(
sfopen`
fName
fMode
)
pState
=
(
ok
,
sfile
,
pState
)
where
sfopen`
::
!{#
Char
}
!
Int
!*
Files
->
(!(!
Bool
,!
File
),!*
Files
)
sfopen`
fName
fMode
files
#
(
ok
,
file
,
files
)
=
sfopen
fName
fMode
files
=
((
ok
,
file
),
files
)
/* PSt is an environment instance of the class FileEnv (see StdFile).
/* PSt is an environment instance of the class FileEnv (see StdFile).
*/
*/
instance
FileEnv
(
PSt
.
l
.
p
)
where
instance
FileEnv
(
PSt
.
l
.
p
)
where
...
...
ObjectIO/ObjectIO/StdWindow.icl
View file @
16e84882
...
@@ -1611,11 +1611,11 @@ where
...
@@ -1611,11 +1611,11 @@ where
setwindowscrollfunction
::
!
Direction
ScrollFunction
!(
WindowStateHandle
.
pst
)
->
WindowStateHandle
.
pst
setwindowscrollfunction
::
!
Direction
ScrollFunction
!(
WindowStateHandle
.
pst
)
->
WindowStateHandle
.
pst
setwindowscrollfunction
direction
scrollFun
wsH
=:{
wshHandle
=
Just
wlsH
=:{
wlsHandle
=
wH
}}
setwindowscrollfunction
direction
scrollFun
wsH
=:{
wshHandle
=
Just
wlsH
=:{
wlsHandle
=
wH
}}
|
direction
==
Horizontal
&&
isJust
hScroll
|
direction
==
Horizontal
&&
isJust
hScroll
#
info
=
{
windowInfo
&
windowHScroll
=
a
p
pMaybe
(
setScrollFun
scrollFun
)
hScroll
}
#
info
=
{
windowInfo
&
windowHScroll
=
m
apMaybe
(
setScrollFun
scrollFun
)
hScroll
}
#
wH
=
{
wH
&
whWindowInfo
=
WindowInfo
info
}
#
wH
=
{
wH
&
whWindowInfo
=
WindowInfo
info
}
=
{
wsH
&
wshHandle
=
Just
{
wlsH
&
wlsHandle
=
wH
}}
=
{
wsH
&
wshHandle
=
Just
{
wlsH
&
wlsHandle
=
wH
}}
|
direction
==
Vertical
&&
isJust
vScroll
|
direction
==
Vertical
&&
isJust
vScroll
#
info
=
{
windowInfo
&
windowVScroll
=
a
p
pMaybe
(
setScrollFun
scrollFun
)
vScroll
}
#
info
=
{
windowInfo
&
windowVScroll
=
m
apMaybe
(
setScrollFun
scrollFun
)
vScroll
}
#
wH
=
{
wH
&
whWindowInfo
=
WindowInfo
info
}
#
wH
=
{
wH
&
whWindowInfo
=
WindowInfo
info
}
=
{
wsH
&
wshHandle
=
Just
{
wlsH
&
wlsHandle
=
wH
}}
=
{
wsH
&
wshHandle
=
Just
{
wlsH
&
wlsHandle
=
wH
}}
|
otherwise
|
otherwise
...
...
ObjectIO/ObjectIO/controlinternal.icl
View file @
16e84882
...
@@ -1253,10 +1253,10 @@ where
...
@@ -1253,10 +1253,10 @@ where
#
(
found
,
itemHs
,
s
)
=
setWElement
(
setCompoundScrollFun
direction
scrollFun
)
id
itemH
.
wItems`
s
#
(
found
,
itemHs
,
s
)
=
setWElement
(
setCompoundScrollFun
direction
scrollFun
)
id
itemH
.
wItems`
s
=
(
found
,{
itemH
&
wItems`
=
itemHs
},
s
)
=
(
found
,{
itemH
&
wItems`
=
itemHs
},
s
)
|
direction
==
Horizontal
&&
isJust
hScroll
|
direction
==
Horizontal
&&
isJust
hScroll
#
info
=
{
info
&
compoundHScroll
=
a
p
pMaybe
(
setScrollFun
scrollFun
)
hScroll
}
#
info
=
{
info
&
compoundHScroll
=
m
apMaybe
(
setScrollFun
scrollFun
)
hScroll
}
=
(
True
,{
itemH
&
wItemInfo`
=
CompoundInfo`
info
},
s
)
=
(
True
,{
itemH
&
wItemInfo`
=
CompoundInfo`
info
},
s
)
|
direction
==
Vertical
&&
isJust
vScroll
|
direction
==
Vertical
&&
isJust
vScroll
#
info
=
{
info
&
compoundVScroll
=
a
p
pMaybe
(
setScrollFun
scrollFun
)
vScroll
}
#
info
=
{
info
&
compoundVScroll
=
m
apMaybe
(
setScrollFun
scrollFun
)
vScroll
}
=
(
True
,{
itemH
&
wItemInfo`
=
CompoundInfo`
info
},
s
)
=
(
True
,{
itemH
&
wItemInfo`
=
CompoundInfo`
info
},
s
)
|
otherwise
|
otherwise
=
(
True
,
itemH
,
s
)
=
(
True
,
itemH
,
s
)
...
...
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