Skip to content

Update to v0.14.0-rc3 #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ node_js: stable
env:
- PATH=$HOME/purescript:$PATH
install:
- TAG=$(basename $(curl --location --silent --output /dev/null -w %{url_effective} https://github.com/purescript/purescript/releases/latest))
# - TAG=$(basename $(curl --location --silent --output /dev/null -w %{url_effective} https://github.com/purescript/purescript/releases/latest))
- TAG=v0.14.0-rc3
- curl --location --output $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
Expand Down
22 changes: 11 additions & 11 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
"package.json"
],
"dependencies": {
"purescript-bifunctors": "^4.0.0",
"purescript-const": "^4.0.0",
"purescript-control": "^4.0.0",
"purescript-either": "^4.0.0",
"purescript-foldable-traversable": "^4.0.0",
"purescript-maybe": "^4.0.0",
"purescript-newtype": "^3.0.0",
"purescript-prelude": "^4.0.0",
"purescript-tuples": "^5.0.0",
"purescript-unsafe-coerce": "^4.0.0"
"purescript-bifunctors": "master",
"purescript-const": "master",
"purescript-control": "master",
"purescript-either": "master",
"purescript-foldable-traversable": "master",
"purescript-maybe": "master",
"purescript-newtype": "master",
"purescript-prelude": "master",
"purescript-tuples": "master",
"purescript-unsafe-coerce": "master"
},
"devDependencies": {
"purescript-assert": "^4.0.0"
"purescript-assert": "master"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "pulp build -- --censor-lib --strict"
"build": "pulp build -- --censor-lib --strict",
"test": "pulp test"
},
"devDependencies": {
"pulp": "^15.0.0",
"purescript-psa": "^0.6.0",
"purescript-psa": "^0.8.0",
"rimraf": "^2.6.2"
}
}
1 change: 1 addition & 0 deletions src/Data/Functor/App.purs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Data.Traversable (class Traversable)
import Data.TraversableWithIndex (class TraversableWithIndex)
import Unsafe.Coerce (unsafeCoerce)

newtype App :: forall k. (k -> Type) -> k -> Type
newtype App f a = App (f a)

hoistApp :: forall f g. (f ~> g) -> App f ~> App g
Expand Down
1 change: 1 addition & 0 deletions src/Data/Functor/Compose.purs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)
import Data.Tuple (Tuple, curry)

-- | `Compose f g` is the composition of the two functors `f` and `g`.
newtype Compose :: forall k1 k2. (k2 -> Type) -> (k1 -> k2) -> k1 -> Type
newtype Compose f g a = Compose (f (g a))

bihoistCompose
Expand Down
1 change: 1 addition & 0 deletions src/Data/Functor/Coproduct.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Data.Traversable (class Traversable, traverse, sequence)
import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)

-- | `Coproduct f g` is the coproduct of two functors `f` and `g`
newtype Coproduct :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
newtype Coproduct f g a = Coproduct (Either (f a) (g a))

-- | Left injection
Expand Down
1 change: 1 addition & 0 deletions src/Data/Functor/Coproduct/Inject.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Data.Either (Either(..))
import Data.Functor.Coproduct (Coproduct(..), coproduct)
import Data.Maybe (Maybe(..))

class Inject :: forall k. (k -> Type) -> (k -> Type) -> Constraint
class Inject f g where
inj :: forall a. f a -> g a
prj :: forall a. g a -> Maybe (f a)
Expand Down
20 changes: 20 additions & 0 deletions src/Data/Functor/Coproduct/Nested.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,46 @@ import Data.Either (Either(..))
import Data.Functor.Coproduct (Coproduct(..), coproduct, left, right)
import Data.Newtype (unwrap)

type Coproduct1 :: forall k. (k -> Type) -> k -> Type
type Coproduct1 a = C2 a (Const Void)
type Coproduct2 :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct2 a b = C3 a b (Const Void)
type Coproduct3 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct3 a b c = C4 a b c (Const Void)
type Coproduct4 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct4 a b c d = C5 a b c d (Const Void)
type Coproduct5 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct5 a b c d e = C6 a b c d e (Const Void)
type Coproduct6 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct6 a b c d e f = C7 a b c d e f (Const Void)
type Coproduct7 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct7 a b c d e f g = C8 a b c d e f g (Const Void)
type Coproduct8 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct8 a b c d e f g h = C9 a b c d e f g h (Const Void)
type Coproduct9 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct9 a b c d e f g h i = C10 a b c d e f g h i (Const Void)
type Coproduct10 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Coproduct10 a b c d e f g h i j = C11 a b c d e f g h i j (Const Void)

type C2 :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
type C2 a z = Coproduct a z
type C3 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C3 a b z = Coproduct a (C2 b z)
type C4 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C4 a b c z = Coproduct a (C3 b c z)
type C5 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C5 a b c d z = Coproduct a (C4 b c d z)
type C6 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C6 a b c d e z = Coproduct a (C5 b c d e z)
type C7 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C7 a b c d e f z = Coproduct a (C6 b c d e f z)
type C8 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C8 a b c d e f g z = Coproduct a (C7 b c d e f g z)
type C9 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C9 a b c d e f g h z = Coproduct a (C8 b c d e f g h z)
type C10 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C10 a b c d e f g h i z = Coproduct a (C9 b c d e f g h i z)
type C11 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type C11 a b c d e f g h i j z = Coproduct a (C10 b c d e f g h i j z)

infixr 6 coproduct as <\/>
Expand Down
1 change: 1 addition & 0 deletions src/Data/Functor/Product.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)
import Data.Tuple (Tuple(..), fst, snd)

-- | `Product f g` is the product of the two functors `f` and `g`.
newtype Product :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
newtype Product f g a = Product (Tuple (f a) (g a))

-- | Create a product.
Expand Down
20 changes: 20 additions & 0 deletions src/Data/Functor/Product/Nested.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,46 @@ import Data.Const (Const(..))
import Data.Functor.Product (Product(..), product)
import Data.Tuple (Tuple(..))

type Product1 :: forall k. (k -> Type) -> k -> Type
type Product1 a = T2 a (Const Unit)
type Product2 :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
type Product2 a b = T3 a b (Const Unit)
type Product3 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product3 a b c = T4 a b c (Const Unit)
type Product4 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product4 a b c d = T5 a b c d (Const Unit)
type Product5 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product5 a b c d e= T6 a b c d e (Const Unit)
type Product6 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product6 a b c d e f = T7 a b c d e f (Const Unit)
type Product7 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product7 a b c d e f g = T8 a b c d e f g (Const Unit)
type Product8 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product8 a b c d e f g h = T9 a b c d e f g h (Const Unit)
type Product9 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product9 a b c d e f g h i = T10 a b c d e f g h i (Const Unit)
type Product10 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type Product10 a b c d e f g h i j = T11 a b c d e f g h i j (Const Unit)

type T2 :: forall k. (k -> Type) -> (k -> Type) -> k -> Type
type T2 a z = Product a z
type T3 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T3 a b z = Product a (T2 b z)
type T4 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T4 a b c z = Product a (T3 b c z)
type T5 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T5 a b c d z = Product a (T4 b c d z)
type T6 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T6 a b c d e z = Product a (T5 b c d e z)
type T7 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T7 a b c d e f z = Product a (T6 b c d e f z)
type T8 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T8 a b c d e f g z = Product a (T7 b c d e f g z)
type T9 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T9 a b c d e f g h z = Product a (T8 b c d e f g h z)
type T10 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T10 a b c d e f g h i z = Product a (T9 b c d e f g h i z)
type T11 :: forall k. (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> (k -> Type) -> k -> Type
type T11 a b c d e f g h i j z = Product a (T10 b c d e f g h i j z)

infixr 6 product as </\>
Expand Down