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) lstwhereiis 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. assumingappStateListis a lens made from the_appStateLensfield of your application state type) likeor without a lens (i.e. assuming
appStateListis just a record field of your application state type) like