-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathModel.elm
43 lines (28 loc) · 1020 Bytes
/
Model.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Model where
import Graphics.Input.Field exposing (..)
import Dict exposing (..)
import Set exposing (..)
type alias ID = Int
type alias Doc = {cp: Int, str: String, len: Int}
type alias WChar = {id: WId
, next: WId
, prev: WId
, vis: Int
, ch: Char}
type alias WString = List WChar
type WUpdate = Insert WChar | Delete WChar | SiteId Int | CurrWString WString String | NoUpdate
type Edit = W WUpdate | T TUpdate
type TUpdate = I Char Int Int | D Char Int | IS String Int | DS String Int | RequestWString | NoTUpdate
type alias WId = (Int, Int)
type alias Model =
{
counter: Int
, site: ID
, wString: WString
, start: WChar
, doc: Doc
, debug: String
, wSeen: Set WId
, pool: List WUpdate
, processedPool: List WUpdate
}