Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 49ba119

Browse files
authored
Merge pull request #27 from purescript/compiler/0.12
Updates for 0.12
2 parents f7ec49d + 4bf0c91 commit 49ba119

File tree

11 files changed

+59
-86
lines changed

11 files changed

+59
-86
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/bower_components/
66
/node_modules/
77
/output/
8+
package-lock.json

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright 2018 PureScript
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation and/or
11+
other materials provided with the distribution.
12+
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software without
15+
specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

bower.json

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
{
22
"name": "purescript-generics-rep",
3-
"ignore": [
4-
"**/.*",
5-
"node_modules",
6-
"bower_components",
7-
"output"
8-
],
9-
"license": "MIT",
3+
"homepage": "https://github.com/purescript/purescript-generics-rep",
4+
"license": "BSD-3-Clause",
105
"repository": {
116
"type": "git",
127
"url": "git://github.com/purescript/purescript-generics-rep.git"
138
},
9+
"ignore": [
10+
"**/.*",
11+
"bower_components",
12+
"node_modules",
13+
"output",
14+
"test",
15+
"bower.json",
16+
"gulpfile.js",
17+
"package.json"
18+
],
1419
"dependencies": {
15-
"purescript-enums": "^3.2.1",
16-
"purescript-foldable-traversable": "^3.0.0",
17-
"purescript-monoid": "^3.0.0",
18-
"purescript-prelude": "^3.0.0",
19-
"purescript-symbols": "^3.0.0"
20+
"purescript-enums": "^4.0.0",
21+
"purescript-foldable-traversable": "^4.0.0",
22+
"purescript-maybe": "^4.0.0",
23+
"purescript-newtype": "^3.0.0",
24+
"purescript-prelude": "^4.0.0"
2025
},
2126
"devDependencies": {
22-
"purescript-assert": "^3.0.0",
23-
"purescript-console": "^3.0.0"
27+
"purescript-assert": "^4.0.0",
28+
"purescript-console": "^4.0.0"
2429
}
2530
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
55
"build": "eslint src && pulp build -- --censor-lib --strict",
6-
"test": "pulp test"
6+
"test": "pulp test --check-main-type Effect.Effect"
77
},
88
"devDependencies": {
9-
"eslint": "^3.17.1",
10-
"pulp": "^10.0.4",
11-
"purescript-psa": "^0.5.0-rc.1",
12-
"rimraf": "^2.6.1"
9+
"eslint": "^4.19.1",
10+
"pulp": "^12.2.0",
11+
"purescript-psa": "^0.6.0",
12+
"rimraf": "^2.6.2"
1313
}
1414
}

src/Data/Generic/Rep.purs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ module Data.Generic.Rep
88
, Product(..)
99
, Constructor(..)
1010
, Argument(..)
11-
, Rec(..)
12-
, Field(..)
1311
) where
1412

1513
import Data.Maybe (Maybe(..))
@@ -33,13 +31,6 @@ newtype Constructor (name :: Symbol) a = Constructor a
3331
-- | A representation for an argument in a data constructor.
3432
newtype Argument a = Argument a
3533

36-
-- | A representation for records.
37-
newtype Rec fields = Rec fields
38-
39-
-- | A representation for a record field which includes the field name
40-
-- | as a type-level string.
41-
newtype Field (field :: Symbol) a = Field a
42-
4334
-- | The `Generic` class asserts the existence of a type function from types
4435
-- | to their representations using the type constructors defined in this module.
4536
class Generic a rep | a -> rep where

src/Data/Generic/Rep/Eq.purs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ instance genericEqConstructor :: GenericEq a => GenericEq (Constructor name a) w
3030
instance genericEqArgument :: Eq a => GenericEq (Argument a) where
3131
genericEq' (Argument a1) (Argument a2) = a1 == a2
3232

33-
instance genericEqRec :: GenericEq a => GenericEq (Rec a) where
34-
genericEq' (Rec a1) (Rec a2) = genericEq' a1 a2
35-
36-
instance genericEqField :: Eq a => GenericEq (Field name a) where
37-
genericEq' (Field a1) (Field a2) = a1 == a2
38-
3933
-- | A `Generic` implementation of the `eq` member from the `Eq` type class.
4034
genericEq :: forall a rep. Generic a rep => GenericEq rep => a -> a -> Boolean
4135
genericEq x y = genericEq' (from x) (from y)

src/Data/Generic/Rep/Monoid.purs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ instance genericMonoidConstructor :: GenericMonoid a => GenericMonoid (Construct
2222
instance genericMonoidArgument :: Monoid a => GenericMonoid (Argument a) where
2323
genericMempty' = Argument mempty
2424

25-
instance genericMonoidRec :: GenericMonoid a => GenericMonoid (Rec a) where
26-
genericMempty' = Rec genericMempty'
27-
28-
instance genericMonoidField :: Monoid a => GenericMonoid (Field name a) where
29-
genericMempty' = Field mempty
30-
3125
-- | A `Generic` implementation of the `mempty` member from the `Monoid` type class.
3226
genericMempty :: forall a rep. Generic a rep => GenericMonoid rep => a
3327
genericMempty = to genericMempty'

src/Data/Generic/Rep/Ord.purs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ instance genericOrdConstructor :: GenericOrd a => GenericOrd (Constructor name a
3434
instance genericOrdArgument :: Ord a => GenericOrd (Argument a) where
3535
genericCompare' (Argument a1) (Argument a2) = compare a1 a2
3636

37-
instance genericOrdRec :: GenericOrd a => GenericOrd (Rec a) where
38-
genericCompare' (Rec a1) (Rec a2) = genericCompare' a1 a2
39-
40-
instance genericOrdField :: Ord a => GenericOrd (Field name a) where
41-
genericCompare' (Field a1) (Field a2) = compare a1 a2
42-
4337
-- | A `Generic` implementation of the `compare` member from the `Ord` type class.
4438
genericCompare :: forall a rep. Generic a rep => GenericOrd rep => a -> a -> Ordering
4539
genericCompare x y = genericCompare' (from x) (from y)

src/Data/Generic/Rep/Semigroup.purs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ instance genericSemigroupConstructor :: GenericSemigroup a => GenericSemigroup (
2626
instance genericSemigroupArgument :: Semigroup a => GenericSemigroup (Argument a) where
2727
genericAppend' (Argument a1) (Argument a2) = Argument (append a1 a2)
2828

29-
instance genericSemigroupRec :: GenericSemigroup a => GenericSemigroup (Rec a) where
30-
genericAppend' (Rec a1) (Rec a2) = Rec (genericAppend' a1 a2)
31-
32-
instance genericSemigroupField :: Semigroup a => GenericSemigroup (Field name a) where
33-
genericAppend' (Field a1) (Field a2) = Field (append a1 a2)
34-
3529
-- | A `Generic` implementation of the `append` member from the `Semigroup` type class.
3630
genericAppend :: forall a rep. Generic a rep => GenericSemigroup rep => a -> a -> a
3731
genericAppend x y = to (genericAppend' (from x) (from y))

src/Data/Generic/Rep/Show.purs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ module Data.Generic.Rep.Show
44
, genericShow
55
, class GenericShowArgs
66
, genericShowArgs
7-
, class GenericShowFields
8-
, genericShowFields
97
) where
108

119
import Prelude (class Show, show, (<>))
@@ -19,9 +17,6 @@ class GenericShow a where
1917
class GenericShowArgs a where
2018
genericShowArgs :: a -> Array String
2119

22-
class GenericShowFields a where
23-
genericShowFields :: a -> Array String
24-
2520
instance genericShowNoConstructors :: GenericShow NoConstructors where
2621
genericShow' a = genericShow' a
2722

@@ -37,11 +32,6 @@ instance genericShowArgsProduct
3732
=> GenericShowArgs (Product a b) where
3833
genericShowArgs (Product a b) = genericShowArgs a <> genericShowArgs b
3934

40-
instance genericShowFieldsProduct
41-
:: (GenericShowFields a, GenericShowFields b)
42-
=> GenericShowFields (Product a b) where
43-
genericShowFields (Product a b) = genericShowFields a <> genericShowFields b
44-
4535
instance genericShowConstructor
4636
:: (GenericShowArgs a, IsSymbol name)
4737
=> GenericShow (Constructor name a) where
@@ -56,18 +46,6 @@ instance genericShowConstructor
5646
instance genericShowArgsArgument :: Show a => GenericShowArgs (Argument a) where
5747
genericShowArgs (Argument a) = [show a]
5848

59-
instance genericShowArgsRec :: GenericShowFields a => GenericShowArgs (Rec a) where
60-
genericShowArgs (Rec a) = ["{ " <> intercalate ", " (genericShowFields a) <> " }"]
61-
62-
instance genericShowFieldsField
63-
:: (Show a, IsSymbol name)
64-
=> GenericShowFields (Field name a) where
65-
genericShowFields (Field a) =
66-
[reflectSymbol (SProxy :: SProxy name) <> ": " <> show a]
67-
68-
instance genericShowFieldsNoArguments :: GenericShowFields NoArguments where
69-
genericShowFields _ = []
70-
7149
-- | A `Generic` implementation of the `show` member from the `Show` type class.
7250
genericShow :: forall a rep. Generic a rep => GenericShow rep => a -> String
7351
genericShow x = genericShow' (from x)

0 commit comments

Comments
 (0)