Skip to content

Commit 1b91ff1

Browse files
committed
Switch to Promise namespace, add purs-tidy
1 parent bd8e1cc commit 1b91ff1

File tree

9 files changed

+29
-17
lines changed

9 files changed

+29
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.*
22
!/.gitignore
33
!/.eslintrc.json
4+
!/.tidyrc.json
45
!/.github/
56
package-lock.json
67
/bower_components/

.tidyrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"importSort": "ide",
3+
"importWrap": "source",
4+
"indent": 2,
5+
"operatorsFile": null,
6+
"ribbon": 1,
7+
"typeArrowPlacement": "first",
8+
"unicode": "never",
9+
"width": null
10+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "eslint src && pulp build -- --censor-lib --strict"
5+
"build": "eslint src && purs-tidy check --config-require src/**/*.purs && pulp build -- --censor-lib --strict"
66
},
77
"devDependencies": {
8-
"eslint": "^8.22.0",
8+
"eslint": "^8.23.0",
99
"pulp": "16.0.2",
1010
"purescript-psa": "^0.8.2",
11+
"purs-tidy": "^0.9.2",
1112
"rimraf": "^3.0.2"
1213
}
1314
}

src/Web/Promise.purs renamed to src/Promise.purs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
module Web.Promise
2-
( module Web.Promise
3-
, module Web.Promise.Internal
4-
, module Web.Promise.Rejection
1+
module Promise
2+
( module Promise
3+
, module Promise.Internal
4+
, module Promise.Rejection
55
) where
66

77
import Prelude
88

99
import Effect (Effect)
1010
import Effect.Uncurried (mkEffectFn1, mkEffectFn2, runEffectFn1, runEffectFn2, runEffectFn3)
11-
import Web.Promise.Internal (Promise, reject)
12-
import Web.Promise.Internal as P
13-
import Web.Promise.Rejection (Rejection)
11+
import Promise.Internal (Promise, reject)
12+
import Promise.Internal as P
13+
import Promise.Rejection (Rejection)
1414

1515
type Executor a = (a -> Effect Unit) -> (Rejection -> Effect Unit) -> Effect Unit
1616

@@ -29,7 +29,7 @@ then_ k p = runEffectFn2 P.then_ (mkEffectFn1 k) p
2929

3030
thenOrCatch
3131
:: forall a b c
32-
. Flatten b c
32+
. Flatten b c
3333
=> (a -> Effect (Promise b))
3434
-> (Rejection -> Effect (Promise b))
3535
-> Promise a
File renamed without changes.

src/Web/Promise/Internal.purs renamed to src/Promise/Internal.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module Web.Promise.Internal where
1+
module Promise.Internal where
22

33
import Prelude
44

55
import Effect (Effect)
66
import Effect.Uncurried (EffectFn1, EffectFn2, EffectFn3)
7-
import Web.Promise.Rejection (Rejection)
7+
import Promise.Rejection (Rejection)
88

99
foreign import data Promise :: Type -> Type
1010

src/Web/Promise/Lazy.purs renamed to src/Promise/Lazy.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Web.Promise.Lazy where
1+
module Promise.Lazy where
22

33
import Prelude
44

@@ -7,8 +7,8 @@ import Data.Traversable (traverse)
77
import Effect (Effect)
88
import Effect.Class (class MonadEffect)
99
import Effect.Uncurried (mkEffectFn1, mkEffectFn2, runEffectFn1, runEffectFn2)
10-
import Web.Promise (class Flatten, Executor, Rejection)
11-
import Web.Promise.Internal as P
10+
import Promise (class Flatten, Executor, Rejection)
11+
import Promise.Internal as P
1212

1313
-- | A trivial box that adds a layer between promises to prevent automatic flattening.
1414
data Box a = Box a
File renamed without changes.

src/Web/Promise/Rejection.purs renamed to src/Promise/Rejection.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Web.Promise.Rejection
1+
module Promise.Rejection
22
( Rejection
33
, fromError
44
, toError
@@ -15,4 +15,4 @@ foreign import fromError :: Error -> Rejection
1515
foreign import _toError :: Fn3 (forall a. a -> Maybe a) (forall a. Maybe a) Rejection (Maybe Error)
1616

1717
toError :: Rejection -> Maybe Error
18-
toError = runFn3 _toError Just Nothing
18+
toError = runFn3 _toError Just Nothing

0 commit comments

Comments
 (0)