Skip to content

Commit

Permalink
feat: changed the behaviour of the Shikensu.programs function
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Feb 16, 2024
1 parent b19df99 commit 57a087a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 5.1.0

Changed the behaviour of the `Shikensu.programs` function, programs are now performed sequentially instead of concurrently (+ the documentation of the function now states this).

## 5.0.1

Fixes an issue with listing extension-less files.
Expand Down
2 changes: 1 addition & 1 deletion docs.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions gren.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"type": "package",
"platform": "node",
"name": "icidasset/shikensu-gren",
"summary": "Run a sequence of functions on in-memory representations of files",
"license": "BSD-3-Clause",
"version": "5.0.1",
"exposed-modules": [
"Shikensu",
"Shikensu.Bundle",
"Shikensu.Contrib",
"Shikensu.Definition",
"Shikensu.Error",
"Shikensu.Focus",
"Shikensu.Path",
"Shikensu.Path.Encapsulated"
],
"gren-version": "0.2.0 <= v < 1.0.0",
"dependencies": {
"gren-lang/core": "4.0.0 <= v < 5.0.0",
"gren-lang/node": "3.0.0 <= v < 4.0.0"
}
"type": "package",
"platform": "node",
"name": "icidasset/shikensu-gren",
"summary": "Run a sequence of functions on in-memory representations of files",
"license": "BSD-3-Clause",
"version": "5.1.0",
"exposed-modules": [
"Shikensu",
"Shikensu.Bundle",
"Shikensu.Contrib",
"Shikensu.Definition",
"Shikensu.Error",
"Shikensu.Focus",
"Shikensu.Path",
"Shikensu.Path.Encapsulated"
],
"gren-version": "0.2.0 <= v < 1.0.0",
"dependencies": {
"gren-lang/core": "4.0.0 <= v < 5.0.0",
"gren-lang/node": "3.0.0 <= v < 4.0.0"
}
}
13 changes: 9 additions & 4 deletions src/Shikensu.gren
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ program sequence focus =
Technically not multiple programs, but same idea as
the `program` function, just with multiple lists.
Programs are performed sequentially.
import Shikensu
import Shikensu.Focus exposing (Focus(..))
Expand All @@ -124,14 +126,17 @@ programs collection =
, onError = \env err -> Stream.sendLine env.stderr ("🚨 " ++ Error.toString err)
}
(\fsPermission ->
collection
|> Array.map
(\{ focus, sequence } ->
Array.foldl
(\{ focus, sequence } ->
Task.andThen
(\_ ->
focus
|> list fsPermission
|> sequence
)
|> Task.sequence
)
(bundle fsPermission [])
collection
)


Expand Down

0 comments on commit 57a087a

Please sign in to comment.