Skip to content

Commit

Permalink
Merge pull request #19 from purescript-contrib/compiler/0.12
Browse files Browse the repository at this point in the history
Updates for 0.12
  • Loading branch information
garyb authored May 26, 2018
2 parents f126106 + 96d592d commit fc19af5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ language: node_js
dist: trusty
sudo: required
node_js: stable
env:
- PATH=$HOME/purescript:$PATH
install:
- npm install -g bower
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
- chmod a+x $HOME/purescript
- npm install
- bower install --production
- npm install
- bower install
script:
- npm run -s build
after_success:
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"package.json"
],
"dependencies": {
"purescript-tuples": "^4.0.0",
"purescript-gen": "^1.3.1"
"purescript-tuples": "^5.0.0",
"purescript-gen": "^2.0.0"
}
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"build": "pulp build -- --censor-lib --strict"
},
"devDependencies": {
"pulp": "^11.0.0",
"purescript-psa": "^0.5.0",
"purescript": "^0.11.1",
"rimraf": "^2.5.4"
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
"rimraf": "^2.6.2"
}
}
14 changes: 7 additions & 7 deletions src/Data/These.purs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ instance bitraversableThese :: Bitraversable These where
bitraverse f _ (This a) = This <$> f a
bitraverse _ g (That x) = That <$> g x
bitraverse f g (Both a x) = Both <$> f a <*> g x
bisequence = bitraverse id id
bisequence = bitraverse identity identity

instance applyThese :: Semigroup a => Apply (These a) where
apply (This a) _ = This a
Expand Down Expand Up @@ -120,21 +120,21 @@ maybeThese = case _, _ of
Nothing, Nothing -> Nothing

fromThese :: forall a b. a -> b -> These a b -> Tuple a b
fromThese _ x (This a) = Tuple a x
fromThese a _ (That x) = Tuple a x
fromThese _ x (This a) = Tuple a x
fromThese a _ (That x) = Tuple a x
fromThese _ _ (Both a x) = Tuple a x

-- | Returns an `a` value if possible.
theseLeft :: forall a b. These a b -> Maybe a
theseLeft (Both x _) = Just x
theseLeft (This x) = Just x
theseLeft _ = Nothing
theseLeft (This x) = Just x
theseLeft _ = Nothing

-- | Returns a `b` value if possible.
theseRight :: forall a b. These a b -> Maybe b
theseRight (Both _ x) = Just x
theseRight (That x) = Just x
theseRight _ = Nothing
theseRight (That x) = Just x
theseRight _ = Nothing

-- | Returns the `a` value if and only if the value is constructed with `This`.
this :: forall a b. These a b -> Maybe a
Expand Down

0 comments on commit fc19af5

Please sign in to comment.