Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit f77e7d1

Browse files
authored
Merge pull request #32 from palf/update-dependencies
updating dependencies and using generalised `unwrap`
2 parents b6aafcf + 3d2c794 commit f77e7d1

7 files changed

Lines changed: 23 additions & 21 deletions

File tree

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ sudo: false
33
node_js:
44
- 0.10
55
install:
6-
- npm install -g bower gulp
6+
- npm install -g bower
77
- npm install
88
- bower install --production
99
script:
10-
- gulp psc
11-
- bower install
12-
- gulp test
10+
- npm run build
11+
- npm run test

bower.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "purescript-lens",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "PureScript implementation of Lens.",
55
"license": "MIT",
66
"homepage": "https://github.com/joneshf/purescript-lens",
@@ -24,12 +24,11 @@
2424
"tests"
2525
],
2626
"dependencies": {
27-
"purescript-const": "^1.0.0",
28-
"purescript-distributive": "^1.0.0",
29-
"purescript-profunctor": "^1.0.0"
27+
"purescript-const": "^2.0.0",
28+
"purescript-distributive": "^2.0.0",
29+
"purescript-profunctor": "^2.0.0"
3030
},
3131
"devDependencies": {
32-
"purescript-psci-support": "^1.0.0",
33-
"purescript-console": "^1.0.0"
32+
"purescript-console": "^2.0.0"
3433
}
3534
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "purescript-lens",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "PureScript implementation of Lens",
55
"license": "MIT",
66
"homepage": "https://github.com/joneshf/purescript-lens",

src/Optic/Getter.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ module Optic.Getter
55
, weiv
66
) where
77

8-
import Data.Const (getConst, Const(..))
8+
import Data.Const (Const(..))
99
import Data.Functor.Contravariant (class Contravariant, coerce)
1010
import Data.Profunctor (class Profunctor, dimap)
11+
import Data.Newtype (unwrap)
1112

1213
import Optic.Types (Getting())
1314

@@ -19,7 +20,7 @@ module Optic.Getter
1920
to s2a = dimap s2a coerce
2021

2122
view :: forall s a. Getting a s a -> s -> a
22-
view asa s = getConst (asa Const s)
23+
view asa s = unwrap (asa Const s)
2324

2425
weiv :: forall s a. s -> Getting a s a -> a
2526
weiv = flip view

src/Optic/Internal/Setter.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module Optic.Internal.Setter where
22

33
import Data.Distributive (class Distributive)
4-
import Data.Identity (runIdentity, Identity(..))
4+
import Data.Identity (Identity(..))
5+
import Data.Newtype (unwrap)
56
import Data.Profunctor (rmap, class Profunctor)
67
import Data.Traversable (class Traversable)
78

@@ -14,5 +15,5 @@ module Optic.Internal.Setter where
1415

1516
instance settableIdentity :: Settable Identity where
1617
untainted (Identity x) = x
17-
untaintedDot = rmap runIdentity
18+
untaintedDot = rmap unwrap
1819
taintedDot = rmap Identity

src/Optic/Prism.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ module Optic.Prism
1111
) where
1212

1313
import Data.Either (either, Either(..))
14-
import Data.Identity (runIdentity, Identity(..))
14+
import Data.Identity (Identity(..))
1515
import Data.Maybe (maybe, Maybe(..))
16+
import Data.Newtype (unwrap)
1617
import Data.Profunctor (dimap)
1718
import Data.Profunctor.Choice (right, class Choice)
1819

@@ -55,4 +56,4 @@ module Optic.Prism
5556

5657
withPrism :: forall b r a t s. APrism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r
5758
withPrism stab f = case stab (Market Identity Right) of
58-
Market b2t s2Eta -> f (runIdentity <<< b2t) (s2Eta >>> either (runIdentity >>> Left) Right)
59+
Market b2t s2Eta -> f (unwrap <<< b2t) (s2Eta >>> either (unwrap >>> Left) Right)

src/Optic/Setter.purs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ module Optic.Setter
1818
) where
1919

2020
import Data.Functor.Contravariant ((>$<), class Contravariant)
21-
import Data.Identity (runIdentity, Identity(..))
21+
import Data.Identity (Identity(..))
2222
import Data.Maybe (Maybe(..))
23+
import Data.Newtype (unwrap)
2324
import Data.Profunctor (lmap, rmap, class Profunctor)
2425

2526
import Optic.Internal.Setter (taintedDot, untaintedDot, class Settable)
@@ -52,13 +53,13 @@ module Optic.Setter
5253
mapped = sets (<$>)
5354

5455
over :: forall p s t a b. Profunctor p => Setting p s t a b -> p a b -> s -> t
55-
over pstab pab = runIdentity <<< pstab (rmap Identity pab)
56+
over pstab pab = unwrap <<< pstab (rmap Identity pab)
5657

5758
set :: forall s t a b. ASetter s t a b -> b -> s -> t
58-
set stab b = runIdentity <<< stab (Identity <<< const b)
59+
set stab b = unwrap <<< stab (Identity <<< const b)
5960

6061
set' :: forall s a. ASetter' s a -> a -> s -> s
61-
set' sa a = runIdentity <<< sa (Identity <<< const a)
62+
set' sa a = unwrap <<< sa (Identity <<< const a)
6263

6364
sets :: forall p q f s t a b. (Profunctor p, Profunctor q, Settable f) => (p a b -> q s t) -> Optical p q f s t a b
6465
sets pab2qst = untaintedDot >>> pab2qst >>> taintedDot

0 commit comments

Comments
 (0)