Skip to content

Commit

Permalink
Merge branch 'aische-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
arturopala committed Nov 16, 2016
2 parents c64c833 + 48fe937 commit 67a5da9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions elm-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"Monocle.Common"
],
"dependencies": {
"elm-lang/core": "4.0.1 <= v < 5.0.0"
"elm-lang/core": "5.0.0 <= v < 6.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
"elm-version": "0.18.0 <= v < 0.19.0"
}
4 changes: 2 additions & 2 deletions example/OptionalExample.elm
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ streetNameOfAddress =

regionOfPlace : Optional Place String
regionOfPlace =
addressOfPlace `Monocle.Optional.compose` regionOfAddress
Monocle.Optional.compose addressOfPlace regionOfAddress


streetNameOfPlace : Optional Place String
streetNameOfPlace =
addressOfPlace `Monocle.Optional.composeLens` streetNameOfAddress
Monocle.Optional.composeLens addressOfPlace streetNameOfAddress


place : Place
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"homepage": "https://github.com/arturopala/elm-monocle#readme",
"devDependencies": {
"elm": "^0.17.0",
"elm": "^0.18.0",
"elm-test":"^0.16.0",
"onchange": "^2.0.0",
"ws": "^1.0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/Monocle/Common.elm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ id =
-}
first : Lens ( a, b ) a
first =
{ get = fst
{ get = Tuple.first
, set = \a ( _, b ) -> ( a, b )
}

Expand All @@ -121,6 +121,6 @@ first =
-}
second : Lens ( a, b ) b
second =
{ get = snd
{ get = Tuple.second
, set = \b ( a, _ ) -> ( a, b )
}
13 changes: 5 additions & 8 deletions src/Monocle/Optional.elm
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,11 @@ zip left right =
let
getOption ( a, b ) =
left.getOption a
|> (\ma ->
Maybe.andThen
ma
(\c ->
right.getOption b
|> Maybe.map (\d -> ( c, d ))
)
)
|> Maybe.andThen
(\c ->
right.getOption b
|> Maybe.map (\d -> ( c, d ))
)

set ( c, d ) ( a, b ) =
( left.set c a, right.set d b )
Expand Down

0 comments on commit 67a5da9

Please sign in to comment.