Skip to content

Commit

Permalink
Add snippets for map, filter, foldl, foldr
Browse files Browse the repository at this point in the history
  • Loading branch information
rudi committed Dec 17, 2024
1 parent ad71a20 commit 8ffe62d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions abs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

### Added

- Add snippets for `map`, `filter`, `foldl`, `foldr`.

### Changed

### Removed
Expand Down
28 changes: 28 additions & 0 deletions abs/snippets/abs.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@
],
"description": "Exception definition"
},
"Filter": {
"prefix": ["filter"],
"body": [
"filter((${1:type} ${2:element}) => ${3:expression})(${4:list})"
],
"description": "Filter function call"
},
"Foldl": {
"prefix": ["foldl"],
"body": [
"foldl((${1:type} ${2:element}, ${3:type} ${4:accumulator}) => ${5:expression})(${6:list}, ${7:initval})"
],
"description": "Foldl function call"
},
"Foldr": {
"prefix": ["foldr"],
"body": [
"foldr((${1:type} ${2:element}, ${3:type} ${4:accumulator}) => ${5:expression})(${6:list}, ${7:initval})"
],
"description": "Foldl function call"
},
"Foreach": {
"prefix": ["foreach"],
"body": [
Expand All @@ -65,6 +86,13 @@
],
"description": "Let expression"
},
"Map": {
"prefix": ["map"],
"body": [
"map((${1:type} ${2:element}) => ${3:expression})(${4:list})"
],
"description": "Map function call"
},
"Module": {
"prefix": ["module"],
"body": [
Expand Down

0 comments on commit 8ffe62d

Please sign in to comment.