diff --git a/.gitignore b/.gitignore deleted file mode 100644 index b215c44..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.* -!/.gitignore -!/.travis.yml -/bower_components/ -/node_modules/ -/output/ -package-lock.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7399e47..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: node_js -dist: trusty -sudo: required -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)) - - 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 - - npm install -g bower - - npm install - - bower install -script: - - npm run -s build -after_success: -- >- - test $TRAVIS_TAG && - echo $GITHUB_TOKEN | pulp login && - echo y | pulp publish --no-push diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 311379c..0000000 --- a/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2018 PureScript - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index 8b4d582..248ba4b 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,5 @@ -# purescript-proxy +# DEPRECATED -[![Latest release](http://img.shields.io/bower/v/purescript-proxy.svg)](https://github.com/purescript/purescript-proxy/releases) -[![Build Status](https://travis-ci.org/purescript/purescript-proxy.svg?branch=master)](https://travis-ci.org/purescript/purescript-proxy) +The library is no longer maintained under this repository, it has been merged into [`purescript-prelude`](https://github.com/purescript/purescript-prelude). -Value proxy for type inputs. - -## Installation - -``` -bower install purescript-proxy -``` - -## Documentation - -Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-proxy). +[The previous releases](https://github.com/purescript-deprecated/purescript-proxy/releases) will continue to work for older libraries that still depend on them. diff --git a/bower.json b/bower.json deleted file mode 100644 index 6d1b39a..0000000 --- a/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "purescript-proxy", - "homepage": "https://github.com/purescript/purescript-proxy", - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "git://github.com/purescript/purescript-proxy.git" - }, - "ignore": [ - "**/.*", - "bower_components", - "node_modules", - "output", - "test", - "bower.json", - "package.json" - ], - "dependencies": { - "purescript-prelude": "^4.0.0" - } -} diff --git a/package.json b/package.json deleted file mode 100644 index d34ea78..0000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "private": true, - "scripts": { - "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build -- --censor-lib --strict" - }, - "devDependencies": { - "pulp": "^15.0.0", - "purescript-psa": "^0.6.0", - "rimraf": "^2.6.2" - } -} diff --git a/src/Type/Proxy.purs b/src/Type/Proxy.purs deleted file mode 100644 index 89cc2a7..0000000 --- a/src/Type/Proxy.purs +++ /dev/null @@ -1,187 +0,0 @@ --- | The `Proxy` type and values are for situations where type information is --- | required for an input to determine the type of an output, but where it is --- | not possible or convenient to provide a _value_ for the input. --- | --- | A hypothetical example: if you have a class that is used to handle the --- | result of an AJAX request, you may want to use this information to set the --- | expected content type of the request, so you might have a class something --- | like this: --- | --- | ``` purescript --- | class AjaxResponse a where --- | responseType :: a -> ResponseType --- | fromResponse :: Foreign -> a --- | ``` --- | --- | The problem here is `responseType` requires a value of type `a`, but we --- | won't have a value of that type until the request has been completed. The --- | solution is to use a `Proxy` type instead: --- | --- | ``` purescript --- | class AjaxResponse a where --- | responseType :: Proxy a -> ResponseType --- | fromResponse :: Foreign -> a --- | ``` --- | --- | We can now call `responseType (Proxy :: Proxy SomeContentType)` to produce --- | a `ResponseType` for `SomeContentType` without having to construct some --- | empty version of `SomeContentType` first. In situations like this where --- | the `Proxy` type can be statically determined, it is recommended to pull --- | out the definition to the top level and make a declaration like: --- | --- | ``` purescript --- | _SomeContentType :: Proxy SomeContentType --- | _SomeContentType = Proxy --- | ``` --- | --- | That way the proxy value can be used as `responseType _SomeContentType` --- | for improved readability. However, this is not always possible, sometimes --- | the type required will be determined by a type variable. As PureScript has --- | scoped type variables, we can do things like this: --- | --- | ``` purescript --- | makeRequest :: URL -> ResponseType -> Aff _ Foreign --- | makeRequest = ... --- | --- | fetchData :: forall a. (AjaxResponse a) => URL -> Aff _ a --- | fetchData url = fromResponse <$> makeRequest url (responseType (Proxy :: Proxy a)) --- | ``` -module Type.Proxy where - -import Prelude - --- | Value proxy for kind `Type` types. -data Proxy a = Proxy - -derive instance eqProxy :: Eq (Proxy a) - -derive instance functorProxy :: Functor Proxy - -derive instance ordProxy :: Ord (Proxy a) - -instance applicativeProxy :: Applicative Proxy where - pure _ = Proxy - -instance applyProxy :: Apply Proxy where - apply _ _ = Proxy - -instance bindProxy :: Bind Proxy where - bind _ _ = Proxy - -instance booleanAlgebraProxy :: BooleanAlgebra (Proxy a) - -instance boundedProxy :: Bounded (Proxy a) where - bottom = Proxy - top = Proxy - -instance commutativeRingProxy :: CommutativeRing (Proxy a) - -instance discardProxy :: Discard (Proxy a) where - discard = bind - -instance heytingAlgebraProxy :: HeytingAlgebra (Proxy a) where - conj _ _ = Proxy - disj _ _ = Proxy - implies _ _ = Proxy - ff = Proxy - not _ = Proxy - tt = Proxy - -instance monadProxy :: Monad Proxy - -instance ringProxy :: Ring (Proxy a) where - sub _ _ = Proxy - -instance semigroupProxy :: Semigroup (Proxy a) where - append _ _ = Proxy - -instance semiringProxy :: Semiring (Proxy a) where - add _ _ = Proxy - mul _ _ = Proxy - one = Proxy - zero = Proxy - -instance showProxy :: Show (Proxy a) where - show _ = "Proxy" - --- | Value proxy for kind `Type -> Type` types. -data Proxy2 (a :: Type -> Type) = Proxy2 - -derive instance eqProxy2 :: Eq (Proxy2 a) - -derive instance ordProxy2 :: Ord (Proxy2 a) - -instance booleanAlgebraProxy2 :: BooleanAlgebra (Proxy2 a) - -instance boundedProxy2 :: Bounded (Proxy2 a) where - bottom = Proxy2 - top = Proxy2 - -instance commutativeRingProxy2 :: CommutativeRing (Proxy2 a) - -instance discardProxy2 :: Discard (Proxy2 a) where - discard = bind - -instance heytingAlgebraProxy2 :: HeytingAlgebra (Proxy2 a) where - conj _ _ = Proxy2 - disj _ _ = Proxy2 - implies _ _ = Proxy2 - ff = Proxy2 - not _ = Proxy2 - tt = Proxy2 - -instance ringProxy2 :: Ring (Proxy2 a) where - sub _ _ = Proxy2 - -instance semigroupProxy2 :: Semigroup (Proxy2 a) where - append _ _ = Proxy2 - -instance semiringProxy2 :: Semiring (Proxy2 a) where - add _ _ = Proxy2 - mul _ _ = Proxy2 - one = Proxy2 - zero = Proxy2 - -instance showProxy2 :: Show (Proxy2 a) where - show _ = "Proxy2" - --- | Value proxy for kind `Type -> Type -> Type` types. -data Proxy3 (a :: Type -> Type -> Type) = Proxy3 - -derive instance eqProxy3 :: Eq (Proxy3 a) - -derive instance ordProxy3 :: Ord (Proxy3 a) - -instance booleanAlgebraProxy3 :: BooleanAlgebra (Proxy3 a) - -instance boundedProxy3 :: Bounded (Proxy3 a) where - bottom = Proxy3 - top = Proxy3 - -instance commutativeRingProxy3 :: CommutativeRing (Proxy3 a) - -instance discardProxy3 :: Discard (Proxy3 a) where - discard = bind - -instance heytingAlgebraProxy3 :: HeytingAlgebra (Proxy3 a) where - conj _ _ = Proxy3 - disj _ _ = Proxy3 - implies _ _ = Proxy3 - ff = Proxy3 - not _ = Proxy3 - tt = Proxy3 - -instance ringProxy3 :: Ring (Proxy3 a) where - sub _ _ = Proxy3 - -instance semigroupProxy3 :: Semigroup (Proxy3 a) where - append _ _ = Proxy3 - -instance semiringProxy3 :: Semiring (Proxy3 a) where - add _ _ = Proxy3 - mul _ _ = Proxy3 - one = Proxy3 - zero = Proxy3 - -instance showProxy3 :: Show (Proxy3 a) where - show _ = "Proxy3"