mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-20 07:17:50 +03:00
Rename Inspect WalkFn aliases
This commit is contained in:
parent
390b5fee77
commit
24806fa417
@ -49,7 +49,7 @@ GuiFormatter := { nodes : List Elem }
|
||||
init : {} -> GuiFormatter
|
||||
init = \{} -> @GuiFormatter { nodes: [] }
|
||||
|
||||
list : list, Inspect.ElemWalkFn GuiFormatter list elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
list : list, Inspect.ElemWalker GuiFormatter list elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
list = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
@ -63,7 +63,7 @@ list = \content, walkFn, toInspector ->
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
set : set, Inspect.ElemWalkFn GuiFormatter set elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
set : set, Inspect.ElemWalker GuiFormatter set elem, (elem -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
set = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
@ -77,7 +77,7 @@ set = \content, walkFn, toInspector ->
|
||||
|
||||
addNode f0 (Col nodes)
|
||||
|
||||
dict : dict, Inspect.KeyValWalkFn GuiFormatter dict key value, (key -> Inspector GuiFormatter), (value -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
dict : dict, Inspect.KeyValWalker GuiFormatter dict key value, (key -> Inspector GuiFormatter), (value -> Inspector GuiFormatter) -> Inspector GuiFormatter
|
||||
dict = \d, walkFn, keyToInspector, valueToInspector ->
|
||||
f0 <- Inspect.custom
|
||||
# Use a temporary buffer for the children nodes
|
||||
@ -228,4 +228,3 @@ addNode = \@GuiFormatter { nodes }, node ->
|
||||
|
||||
toGui : GuiFormatter -> Elem
|
||||
toGui = \@GuiFormatter { nodes } -> Col nodes
|
||||
|
||||
|
@ -3,6 +3,8 @@ interface Inspect
|
||||
Inspect,
|
||||
InspectFormatter,
|
||||
Inspector,
|
||||
KeyValWalker,
|
||||
ElemWalker,
|
||||
init,
|
||||
list,
|
||||
set,
|
||||
@ -30,13 +32,11 @@ interface Inspect
|
||||
apply,
|
||||
inspect,
|
||||
toInspector,
|
||||
KeyValWalkFn,
|
||||
ElemWalkFn,
|
||||
]
|
||||
imports []
|
||||
|
||||
KeyValWalkFn state container key value : container, state, (state, key, value -> state) -> state
|
||||
ElemWalkFn state container elem : container, state, (state, elem -> state) -> state
|
||||
KeyValWalker state collection key val : collection, state, (state, key, val -> state) -> state
|
||||
ElemWalker state collection elem : collection, state, (state, elem -> state) -> state
|
||||
|
||||
InspectFormatter has
|
||||
init : {} -> f | f has InspectFormatter
|
||||
@ -47,9 +47,9 @@ InspectFormatter has
|
||||
bool : Bool -> Inspector f | f has InspectFormatter
|
||||
str : Str -> Inspector f | f has InspectFormatter
|
||||
|
||||
list : list, ElemWalkFn state list elem, (elem -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
set : set, ElemWalkFn state set elem, (elem -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
dict : dict, KeyValWalkFn state dict key value, (key -> Inspector f), (value -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
list : list, ElemWalker state list elem, (elem -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
set : set, ElemWalker state set elem, (elem -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
dict : dict, KeyValWalker state dict key value, (key -> Inspector f), (value -> Inspector f) -> Inspector f | f has InspectFormatter
|
||||
|
||||
# Note opaque is used for both opaque types and functions.
|
||||
# The auto deriver for functions probably could put the function type.
|
||||
|
@ -43,7 +43,7 @@ LogFormatter := { data : Str }
|
||||
init : {} -> LogFormatter
|
||||
init = \{} -> @LogFormatter { data: "" }
|
||||
|
||||
list : list, Inspect.ElemWalkFn (LogFormatter, Bool) list elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
list : list, Inspect.ElemWalker (LogFormatter, Bool) list elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
list = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "["
|
||||
@ -62,7 +62,7 @@ list = \content, walkFn, toInspector ->
|
||||
|> .0
|
||||
|> write "]"
|
||||
|
||||
set : set, Inspect.ElemWalkFn (LogFormatter, Bool) set elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
set : set, Inspect.ElemWalker (LogFormatter, Bool) set elem, (elem -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
set = \content, walkFn, toInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "{"
|
||||
@ -81,7 +81,7 @@ set = \content, walkFn, toInspector ->
|
||||
|> .0
|
||||
|> write "}"
|
||||
|
||||
dict : dict, Inspect.KeyValWalkFn (LogFormatter, Bool) dict key value, (key -> Inspector LogFormatter), (value -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
dict : dict, Inspect.KeyValWalker (LogFormatter, Bool) dict key value, (key -> Inspector LogFormatter), (value -> Inspector LogFormatter) -> Inspector LogFormatter
|
||||
dict = \d, walkFn, keyToInspector, valueToInspector ->
|
||||
f0 <- Inspect.custom
|
||||
write f0 "{"
|
||||
|
Loading…
Reference in New Issue
Block a user