You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
16:27:12 ~/Documents/GitHub/aoc main $ roc check test.roc
0 errors and 0 warnings found in 15 ms
16:27:14 ~/Documents/GitHub/aoc main $ roc test test.roc
^C
module []
Mapper a : [ Start a, Middle a a a, End a ] -> a
mapAdjacent : List a, Mapper a -> List a
mapAdjacent = \values, fn ->
when values is
[] -> []
[start, .. as rest] ->
help : List a, a, List a -> List a
help = \inner, left, acc ->
when values is
[] -> acc
[end] -> help [] end (List.append acc (fn (End end)))
[middle, right, ..] -> help (List.dropFirst inner 1) middle (List.append acc (fn (Middle left middle right)))
help rest start [fn (Start start)]
expect
a = mapAdjacent [1] \_ -> 42
a == [42]
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: