How to append to List? #470
-
Hi, There is no append function to List.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Beta Was this translation helpful? Give feedback.
-
I understand.
I dont get it. How |
Beta Was this translation helpful? Give feedback.
The function to modify the list would be something like
\lst -> listReplace (listElements lst <> elementsToAppend) (Just i) lst
wherei
is the index of the element that you want selected after the modification. In the context ofEventM
, you'd either use this with a lens (i.e. assumingappStateList
is a lens made from the_appStateLens
field of your application state type) likeor without a lens (i.e. assuming
appStateList
is just a record field of your application state type) like