Files
sml-projects/fcore/app-with.sml

80 lines
1.7 KiB
Standard ML
Raw Normal View History

2024-10-08 08:53:43 +01:00
structure AppWith =
struct
open AppType
fun startLine (app: app_type, startLine, newBuffer) =
let
val
{ startLine = _
, buffer = _
, mode
, windowWidth
, windowHeight
, cursorIdx
} = app
in
{ startLine = startLine
, buffer = newBuffer
, mode = mode
, windowWidth = windowWidth
, windowHeight = windowHeight
, cursorIdx = cursorIdx
}
end
2024-10-08 08:53:43 +01:00
fun bufferAndSize (app: app_type, newBuffer, newWidth, newHeight) =
let
val
{ mode
, buffer = _
, windowWidth = _
, windowHeight = _
, startLine
, cursorIdx
} = app
2024-10-08 08:53:43 +01:00
in
{ mode = mode
, buffer = newBuffer
2024-10-08 08:53:43 +01:00
, windowWidth = newWidth
, windowHeight = newHeight
, startLine = startLine
2024-10-09 10:59:32 +01:00
, cursorIdx = cursorIdx
2024-10-08 08:53:43 +01:00
}
end
fun bufferAndCursorIdx
(app: app_type, newBuffer, newCursorIdx, newMode, newStartLine) =
let
val
2024-10-26 06:01:48 +01:00
{ mode = _
, buffer = _
, cursorIdx = _
, windowWidth
, windowHeight
, startLine = _
2024-10-26 06:01:48 +01:00
} = app
in
2024-10-26 06:01:48 +01:00
{ mode = newMode
, buffer = newBuffer
, cursorIdx = newCursorIdx
, startLine = newStartLine
, windowWidth = windowWidth
, windowHeight = windowHeight
}
end
2024-10-26 06:01:48 +01:00
fun mode (app: app_type, newMode) =
let
val {mode = _, buffer, cursorIdx, windowWidth, windowHeight, startLine} =
app
in
{ mode = newMode
, buffer = buffer
, cursorIdx = cursorIdx
, windowWidth = windowWidth
, windowHeight = windowHeight
, startLine = startLine
}
end
2024-10-08 08:53:43 +01:00
end