Commit be6a9880 authored by Diederik van Arkel's avatar Diederik van Arkel

cleanup types

parent 0ce22489
......@@ -16,7 +16,7 @@ where
getEditorState :: !*env -> *(!EditorState,!*env)
setEditorState :: !EditorState !*env -> *env
instance Editor (PSt *p) | Editor p
instance Editor (PSt *l) | Editor l
:: EditorState
......
......@@ -13,7 +13,7 @@ where
getEditorState :: !*env -> *(!EditorState,!*env)
setEditorState :: !EditorState !*env -> *env
instance Editor (PSt *p) | Editor p
instance Editor (PSt *l) | Editor l
where
getEditorState ps = accPLoc getEditorState ps
setEditorState es ps = appPLoc (setEditorState es) ps
......
......@@ -30,25 +30,25 @@ from EdSelection import Selection, emptySelection, lineSelection
from EdMonad import UndoState, EditMonad, EditState, StateM, getPathName
import IdeState
isEditWin :: Id *(PSt *a) -> *(Bool,*PSt *a) | Editor a
isEditWin :: Id *(PSt *l) -> *(Bool,*PSt *l) | Editor l
// "Remote method invocations". The destination is denoted by a window identifier.
message :: !Id !.(EditAction *b .c) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
sendToActiveWindow :: .(EditAction *b .c) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
message :: !Id !.(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
sendToActiveWindow :: .(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
// Messages
msgSave :: EditAction General (Maybe String)
msgSaveTo :: !String -> EditAction General (Maybe String)
msgSetFont :: Font -> EditAction *l nothing
msgGetFont :: EditAction *l Font
msgSetFont :: Font -> EditAction .l nothing
msgGetFont :: EditAction .l Font
msgSetTabs :: !(Int,Bool,Bool) -> EditAction *l nothing
msgGetTabs :: EditAction *l (Int,Bool,Bool)
msgSetTabs :: !(Int,Bool,Bool) -> EditAction .l nothing
msgGetTabs :: EditAction .l (Int,Bool,Bool)
msgCopy :: EditAction *l nothing
msgCopy :: EditAction .l nothing
msgCut :: EditAction General nothing
msgPaste :: EditAction General nothing
msgClear :: EditAction General nothing
......@@ -57,21 +57,21 @@ msgSelectAll :: EditAction General nothing
msgUndo :: EditAction General nothing
msgBalance :: EditAction General nothing
msgGetUndoState :: EditAction *l (UndoState,String)
msgGetPathName :: EditAction *l String
msgSetPathName :: String -> EditAction *l nothing
msgGetNeedSave :: EditAction *l Bool
msgSetNeedSave :: Bool -> EditAction *l nothing
msgGetText :: EditAction *l Text
msgSetText :: !Text -> EditAction *l nothing
msgGetUndoState :: EditAction .l (UndoState,String)
msgGetPathName :: EditAction .l String
msgSetPathName :: String -> EditAction .l nothing
msgGetNeedSave :: EditAction .l Bool
msgSetNeedSave :: Bool -> EditAction .l nothing
msgGetText :: EditAction .l Text
msgSetText :: !Text -> EditAction .l nothing
msgRevertText :: !Text -> EditAction General nothing
msgGetSelection :: EditAction *l (String,Selection)
msgGetSelection :: EditAction .l (String,Selection)
msgReplaceSelection :: String -> EditAction General nothing
msgChangeSelection :: Selection -> EditAction General nothing
msgScrollToCursor :: EditAction *l nothing
msgScrollToCursor :: EditAction .l nothing
msgScrollToLine :: LineNr -> EditAction General nothing
msgPrint :: !PrintSetup -> EditAction *l PrintSetup
msgDetab :: EditAction *l nothing
msgPrint :: !PrintSetup -> EditAction .l PrintSetup
msgDetab :: EditAction .l nothing
:: FRInfo =
{ fr_pos :: !Selection
......
......@@ -33,7 +33,7 @@ import EdText
import IdeState, UtilNewlinesFile
isEditWin :: Id *(PSt *a) -> *(Bool,*PSt *a) | Editor a
isEditWin :: Id *(PSt *l) -> *(Bool,*PSt *l) | Editor l
isEditWin windowId pState
# (editorState, pState) = getEditorState pState
# (maybeEditId, editorState) = findReceiver windowId editorState
......@@ -41,7 +41,7 @@ isEditWin windowId pState
# pState = setEditorState editorState pState
= (iseditwin, pState)
message :: !Id !.(EditAction *b .c) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
message :: !Id !.(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
message windowId monad pState
# (editorState, pState) = getEditorState pState
# (maybeEditId, editorState) = findReceiver windowId editorState
......@@ -52,7 +52,7 @@ message windowId monad pState
# pState = setEditorState editorState pState
= (Just x, pState)
sendToActiveWindow :: .(EditAction *b .c) !*(PSt *b) -> *(Maybe .c,*PSt *b) | Editor b
sendToActiveWindow :: .(EditAction *l .r) !*(PSt *l) -> *(Maybe .r,*PSt *l) | Editor l
sendToActiveWindow editAction pState
# (maybeId, pState) = accPIO getActiveWindow pState
| isNothing maybeId
......@@ -66,23 +66,23 @@ sendToActiveWindow editAction pState
//--
msgSetFont :: Font -> EditAction *l nothing
msgSetFont :: Font -> EditAction .l nothing
msgSetFont font
= setFont font
msgGetFont :: EditAction *l Font
msgGetFont :: EditAction .l Font
msgGetFont
= getFontInfo >>>= \{ thefont } ->
result thefont
msgSetTabs :: !(Int,Bool,Bool) -> EditAction *l nothing
msgSetTabs :: !(Int,Bool,Bool) -> EditAction .l nothing
msgSetTabs (t,a,s) =
getFontInfo >>>= \fontinfo ->
setFontInfo {fontinfo & tabSize = t, autoTab = a, showTabs = s} >>>
setFont fontinfo.thefont >>>
skip
msgGetTabs :: EditAction *l (Int,Bool,Bool)
msgGetTabs :: EditAction .l (Int,Bool,Bool)
msgGetTabs
= getFontInfo >>>= \{ tabSize,autoTab,showTabs } ->
result (tabSize,autoTab,showTabs)
......@@ -238,7 +238,7 @@ msgSelectAll =
) >>>
mChangeSelectionTo {start={row=0,col=0},end={row=linenr,col = size line}}
msgCopy :: EditAction *l nothing
msgCopy :: EditAction .l nothing
msgCopy =
getText >>>= \text ->
getSelection >>>= \selection ->
......@@ -493,32 +493,32 @@ msgBalance =
(appEnv (appPIO beep))
)
msgGetUndoState :: EditAction *l (UndoState,String)
msgGetUndoState :: EditAction .l (UndoState,String)
msgGetUndoState
= getUndoInfo >>>= \undoinfo ->
result (undoinfo.state,undoinfo.action)
msgGetPathName :: EditAction *l String
msgGetPathName :: EditAction .l String
msgGetPathName
= getPathName
msgSetPathName :: String -> EditAction *l nothing
msgSetPathName :: String -> EditAction .l nothing
msgSetPathName path =
setPathName path
msgGetNeedSave :: EditAction *l Bool
msgGetNeedSave :: EditAction .l Bool
msgGetNeedSave
= getNeedSave
msgSetNeedSave :: Bool -> EditAction *l nothing
msgSetNeedSave :: Bool -> EditAction .l nothing
msgSetNeedSave ns
= setNeedSave ns
msgGetText :: EditAction *l Text
msgGetText :: EditAction .l Text
msgGetText
= getText
msgSetText :: !Text -> EditAction *l nothing
msgSetText :: !Text -> EditAction .l nothing
msgSetText text =
setText text >>>
setSelection emptySelection >>>
......@@ -538,7 +538,7 @@ msgRevertText text =
setNeedSave False >>> // DvA: only called by revert!
setUndoInfo {state = None, action = "", uninfo = NoInfo} // DvA: only called by revert!
msgGetSelection :: EditAction *l (String,Selection)
msgGetSelection :: EditAction .l (String,Selection)
msgGetSelection
= getText >>>= \text ->
getSelection >>>= \selection ->
......@@ -565,7 +565,7 @@ msgChangeSelection selection =
vCenterCursor
)
msgScrollToCursor :: EditAction *l nothing
msgScrollToCursor :: EditAction .l nothing
msgScrollToCursor
= vCenterCursor
......@@ -787,7 +787,7 @@ redoReplaceAll [(osel,nsel,ofrg,nfrg):rest] text
//-- Ed Text Printing
msgPrint :: !PrintSetup -> EditAction *l PrintSetup
msgPrint :: !PrintSetup -> EditAction .l PrintSetup
msgPrint printSetup
= getText >>>= \text ->
getPathName >>>= \pathName ->
......@@ -835,7 +835,7 @@ where
intlength = size intstring
blanks = " "
msgDetab :: EditAction *l nothing
msgDetab :: EditAction .l nothing
msgDetab =
getText >>>= \text ->
let
......
......@@ -11,11 +11,11 @@ doPathsDialog :: // Display a Paths dialogue
!Pathname // Application path
!Pathname // Project path
!(List Pathname) // List of paths
(!(List Pathname) !(PSt *l) -> (PSt *l)) // Save paths function
(PSt *l) -> (PSt *l)
(!(List Pathname) !(PSt .l) -> (PSt .l)) // Save paths function
(PSt .l) -> (PSt .l)
doCompilerOptionsDialog :: // Display Compiler Options dialogue
!String // Dialogue title string
!CompilerOptions // Compiler options
(!CompilerOptions !(PSt *l) -> (PSt *l)) // Save options function
!(PSt *l) -> (PSt *l)
(!CompilerOptions !(PSt .l) -> (PSt .l)) // Save options function
!(PSt .l) -> (PSt .l)
......@@ -542,7 +542,7 @@ setCheckControlMark full id io
True -> markCheckControlItems id [1] io
False -> unmarkCheckControlItems id [1] io
doPathsDialog :: !String !Pathname !Pathname !(List Pathname) (!(List Pathname) !(PSt *l) -> (PSt *l)) (PSt *l) -> (PSt *l)
doPathsDialog :: !String !Pathname !Pathname !(List Pathname) (!(List Pathname) !(PSt .l) -> (PSt .l)) (PSt .l) -> (PSt .l)
doPathsDialog titlestring ap pp lo set ps
# (wid,ps) = openId ps
(okid,ps) = openId ps
......@@ -645,7 +645,7 @@ where
ps = appendExtListBoxItems lb1Id (zip3 (FullPaths full ap pp (StrictListToList lo))(repeat id)(repeat id)) ps
= ((lo,full),ps)
doCompilerOptionsDialog :: !String !CompilerOptions (!CompilerOptions !(PSt *l) -> (PSt *l)) !(PSt *l) -> (PSt *l)
doCompilerOptionsDialog :: !String !CompilerOptions (!CompilerOptions !(PSt .l) -> (PSt .l)) !(PSt .l) -> (PSt .l)
doCompilerOptionsDialog titlestring ini set ps
# (wid,ps) = accPIO openId ps
# (cid,ps) = accPIO openId ps
......
......@@ -23,7 +23,7 @@ StartIntr :: !(!Id,!Id) !(Callback General) !*(PSt General) -> !*(PSt General)
1st arg. The dialog id of the 'control dialog'.
2nd arg. The program state.
*/
StopIntr :: !(!Id,!Id) !*(PSt .a) -> !*(PSt .a)
StopIntr :: !(!Id,!Id) !*(PSt .l) -> !*(PSt .l)
/* Continues an 'interruptable' function. This function is called by an 'interruptable' function to
allow user interruption at this state of its processing.
......
......@@ -51,7 +51,7 @@ TriggerNoIntr interruptId noi (ls,ps)
# ps = appPIO (disableTimer interruptId) ps
= (ls,callback False ps)
StopIntr :: !(!Id,!Id) !*(PSt .a) -> !*(PSt .a)
StopIntr :: !(!Id,!Id) !*(PSt .l) -> !*(PSt .l)
StopIntr (dialogId,interruptId) ps
= appPIO (closeTimer interruptId) ps
......
......@@ -11,13 +11,13 @@ class Clipper env where
getClipInfo :: !*env -> *(!ClipInfo,!*env)
setClipInfo :: !ClipInfo !*env -> *env
instance Clipper (PSt *p) | Clipper p
instance Clipper (PSt *l) | Clipper l
isClipboardWindow :: !Id !*env -> (Bool,*env) | Clipper env
initClipInfo :: Id [Id] *env -> *(ClipInfo,*env) | Ids env
clipMenuItems :: !Id !Id !ClipInfo -> .MenuItem .c *(PSt *e) | Clipper , Editor e
cw_maybe_close :: !Id !*(PSt *c) -> (Bool,*PSt *c) | Clipper, Editor c
clipMenuItems :: !Id !Id !ClipInfo -> .MenuItem .c *(PSt *l) | Clipper , Editor l
cw_maybe_close :: !Id !*(PSt *l) -> (Bool,*PSt *l) | Clipper, Editor l
// avoid compiler warnings...
......
......@@ -17,7 +17,7 @@ class Clipper env where
getClipInfo :: !*env -> *(!ClipInfo,!*env)
setClipInfo :: !ClipInfo !*env -> *env
instance Clipper (PSt *p) | Clipper p
instance Clipper (PSt *l) | Clipper l
where
getClipInfo ps = accPLoc getClipInfo ps
setClipInfo ci ps = appPLoc (setClipInfo ci) ps
......@@ -48,7 +48,7 @@ isClipboardWindow wId ps
# ({clip_clipId},ps) = getClipInfo ps
= (clip_clipId == wId,ps)
cw_maybe_close :: !Id !*(PSt *c) -> (Bool,*PSt *c) | Clipper, Editor c
cw_maybe_close :: !Id !*(PSt *l) -> (Bool,*PSt *l) | Clipper, Editor l
cw_maybe_close win ps
# (ci,ps) = getClipInfo ps
| ci.clip_clipId <> win
......@@ -81,7 +81,7 @@ deactivate ps
# ps = appPIO ( enableMenuElements ci.menuIds ) ps
= ps
clipMenuItems :: !Id !Id !ClipInfo -> .MenuItem .c *(PSt *e) | Clipper , Editor e
clipMenuItems :: !Id !Id !ClipInfo -> .MenuItem .c *(PSt *l) | Clipper , Editor l
clipMenuItems mn_sav mn_rev ci
= MenuItem "Show Clipboard" [MenuFunction (noLS showClip), MenuId ci.clip_itemId]
where
......
......@@ -23,16 +23,16 @@ iniConsWinInfo :: // initialise console window information
!ConPrefs // console window preferences
!*a -> *(.ConsWinInfo,*a) | accScreenPicture, Ids a
updateConsoleWindowI :: !String [WindowAttribute *(EditState,*(PSt *b))] !*(PSt *b) -> *PSt *b | Consoler b
updateConsoleWindowI :: !String [WindowAttribute *(EditState,*(PSt *l))] !*(PSt *l) -> *PSt *l | Consoler l
// update console window with stdin info
updateConsoleWindowO :: !String [WindowAttribute *(EditState,*(PSt *b))] !*(PSt *b) -> *PSt *b | Consoler b
updateConsoleWindowO :: !String [WindowAttribute *(EditState,*(PSt *l))] !*(PSt *l) -> *PSt *l | Consoler l
// update console window with stdout info
updateConsoleWindowE :: !String [WindowAttribute *(EditState,*(PSt *b))] !*(PSt *b) -> *PSt *b | Consoler b
updateConsoleWindowE :: !String [WindowAttribute *(EditState,*(PSt *l))] !*(PSt *l) -> *PSt *l | Consoler l
// update console window with stderr info
maybe_cons_win_message2 :: .(EditMonad *(PSt *b) .c) !*(PSt *b) -> (Maybe .c,*(PSt *b)) | Consoler b
maybe_cons_win_message2 :: .(EditMonad *(PSt *l) .c) !*(PSt *l) -> (Maybe .c,*(PSt *l)) | Consoler l
// send message to console window
getConPrefs :: !ConsWinInfo -> ConPrefs
conswinColours :: !*(PSt *a) -> *(PSt *a) | Consoler a
conswinColours :: !*(PSt *l) -> *(PSt *l) | Consoler l
// present a dialogue for setting console window colours
......@@ -9,7 +9,7 @@ from StdPSt import PSt, IOSt
from EdState import EditorState, Editor
import IDE
optionsKeyMapping :: !*(PSt *b) -> *PSt *b | Editor b;
optionsKeyMapping :: !*(PSt *l) -> *PSt *l | Editor l
defaultColours :: !*(PSt *General) -> *(PSt *General)
//optionsFontAndTabs :: !*(PSt *General) -> *(PSt *General)
defaultFontAndTabs :: !*(PSt *General) -> *(PSt *General)
......
......@@ -5,6 +5,6 @@ definition module interrupt
import StdId, StdPSt
StartIntr :: !(!Id,Id) .a (.Bool -> .(.a -> .(*(PSt .b) -> *(.a,*(PSt .b))))) !*(PSt .b) -> *(PSt .b)
StopIntr :: !(.a,!Id) !*(PSt .b) -> *(PSt .b)
ContIntr :: !(.a,!Id) !*(PSt .b) -> *(PSt .b)
StartIntr :: !(!Id,Id) .a (.Bool -> .(.a -> .(*(PSt .l) -> *(.a,*(PSt .l))))) !*(PSt .l) -> *(PSt .l)
StopIntr :: !(.a,!Id) !*(PSt .l) -> *(PSt .l)
ContIntr :: !(.a,!Id) !*(PSt .l) -> *(PSt .l)
......@@ -10,16 +10,16 @@ from PmPrefs import TypPrefs
iniTypeWinInfo :: !Id !Id ![Id] !TypPrefs !*a -> *(.TypeWinInfo,*a) | Ids, accScreenPicture a
// initialise type window info
updateTypeWindow :: !Bool !String [WindowAttribute *(EditState,*(PSt *b))] ![String] !*(PSt *b) -> *PSt *b | Typer b
updateTypeWindow :: !Bool !String [WindowAttribute *(EditState,*(PSt *l))] ![String] !*(PSt *l) -> *PSt *l | Typer l
// add content to the types window
isTypeWindow :: !Id !.TypeWinInfo -> Bool
// is window the Types window
tw_maybe_close :: !Id !*(PSt *b) -> *(Bool,*(PSt *b)) | Typer b
tw_maybe_close :: !Id !*(PSt *l) -> *(Bool,*(PSt *l)) | Typer l
// tw_maybe_close :: close window if it is types window
tw_safe_close :: !*(PSt *b) -> *PSt *b | Typer b
tw_safe_close :: !*(PSt *l) -> *PSt *l | Typer l
// tw_safe_close :: close types window
//-
......@@ -38,8 +38,8 @@ TW_GetInf :: !TypeWinInfo -> TypPrefs
TW_SetUpd :: ![Id] !TypeWinInfo -> TypeWinInfo
// message passing with types window
maybe_type_win_message :: !Id .(EditMonad *(PSt *b) .c) !*(PSt *b) -> (Maybe .c,*(PSt *b)) | Typer b
type_win_message :: !.(EditMonad *(PSt *b) .c) !*(PSt *b) -> *(Maybe .c,*(PSt *b)) | Typer b
maybe_type_win_message :: !Id .(EditMonad *(PSt *l) .c) !*(PSt *l) -> (Maybe .c,*(PSt *l)) | Typer l
type_win_message :: !.(EditMonad *(PSt *l) .c) !*(PSt *l) -> *(Maybe .c,*(PSt *l)) | Typer l
// dialogue to set colours for types window
typewinColours :: !*(PSt *a) -> *(PSt *a) | Typer a
typewinColours :: !*(PSt *l) -> *(PSt *l) | Typer l
......@@ -27,6 +27,6 @@ GetCurrentDirectory :: (!Bool,!String)
import StdPSt, StdMaybe
selectDirectory` :: !(PSt *l) -> (!Maybe String,!(PSt *l))
selectDirectory` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
ShellDefault :: !{#Char} !(PSt .l) -> (!Int,!(PSt .l))
......@@ -319,7 +319,7 @@ from commondef import fatalError
CcRqALTDIRECTORYDIALOG :== 1475
selectDirectory` :: !(PSt *l) -> (!Maybe String,!(PSt *l))
selectDirectory` :: !(PSt .l) -> (!Maybe String,!(PSt .l))
selectDirectory` env
// = selectDirectory Nothing env
# initial = global.[0]
......@@ -329,7 +329,7 @@ selectDirectory` env
(Just _) -> update_maybe_string result global
= (result,env)
where
selectDirectory :: !(Maybe String) !(PSt *l) -> (!Maybe String,!PSt *l)
selectDirectory :: !(Maybe String) !(PSt .l) -> (!Maybe String,!PSt .l)
selectDirectory initial pState
# (tb,pState) = accPIO getIOToolbox pState
# tb = osInitialiseFileSelectors tb
......@@ -338,7 +338,7 @@ where
= (if ok (Just name) Nothing,pState)
// handleOSEvent turns handleOneEventForDevices into the form required by osSelect(in/out)putfile.
handleOSEvent :: !OSEvent !*(PSt *l) -> *PSt *l
handleOSEvent :: !OSEvent !*(PSt .l) -> *PSt .l
handleOSEvent osEvent pState
= thd3 (handleOneEventForDevices (ScheduleOSEvent osEvent []) pState)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment