git.iko.soy/purescript-literals
on 9834653 help sign in
bower.json+28−25
since splitsnapshots
unifiedsplit
@@ -1,27 +1,30 @@
1{
1{
2− "name": "purescript-literals",
2+ "name": "purescript-literals",
3+ "homepage": "https://github.com/jvliwanag/purescript-literal",
4+ "authors": [
5+ "Jan Vincent Liwanag <jvliwanag@gmail.com>"
6+ ],
7+ "description": "A Symbol Proxy having a runtime value equal to the reflected symbol",
8+ "main": "",
3− "license": [
9+ "license": "MIT",
4− "MIT"
5− ],
6− "repository": {
10+ "repository": {
7− "type": "git",
11+ "type": "git",
8− "url": "https://github.com/rowtype-yoga/purescript-literals.git"
12+ "url": "https://github.com/jvliwanag/purescript-literals.git"
9− },
13+ },
10− "ignore": [
14+ "ignore": [
11− "**/.*",
15+ "**/.*",
12− "node_modules",
16+ "node_modules",
13− "bower_components",
17+ "bower_components",
14− "output"
18+ "test",
19+ "tests"
15− ],
20+ ],
16− "dependencies": {
21+ "dependencies": {
17− "purescript-assert": "^v6.0.0",
22+ "purescript-unsafe-coerce": "^4.0.0",
23+ "purescript-prelude": "^4.1.1",
18− "purescript-effect": "^v4.0.0",
24+ "purescript-maybe": "^4.0.1",
19− "purescript-integers": "^v6.0.0",
25+ "purescript-integers": "^4.0.0",
20− "purescript-maybe": "^v6.0.0",
26+ "purescript-typelevel-prelude": "^5.0.2",
27+ "purescript-partial": "^2.0.1",
21− "purescript-numbers": "^v9.0.0",
28+ "purescript-numbers": "^7.0.0"
22− "purescript-partial": "^v4.0.0",
23− "purescript-prelude": "^v6.0.0",
24− "purescript-typelevel-prelude": "^v7.0.0",
25− "purescript-unsafe-coerce": "^v6.0.0"
26− }
29+ }
27}
30}
packages.dhall+3−2
@@ -116,9 +116,10 @@ let additions =
116 }
116 }
117-------------------------------
117-------------------------------
118-}
118-}
119+
120+
119let upstream =
121let upstream =
120− https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220530/packages.dhall
122+ https://github.com/purescript/package-sets/releases/download/psc-0.13.4-20191110/packages.dhall sha256:563a7f694e18e6399f7f6d01f5b7e3c3345781655d99945768f48e458feb93a4
121− sha256:15dd8041480502850e4043ea2977ed22d6ab3fc24d565211acde6f8c5152a799
122
123
123let overrides = {=}
124let overrides = {=}
124
125
spago.dhall+16−15
@@ -1,17 +1,18 @@
1−{ name = "literals"
1+{ name =
2−, license = "MIT"
2+ "literals"
3−, repository = "https://github.com/rowtype-yoga/purescript-literals.git"
4, dependencies =
3, dependencies =
5− [ "assert"
4+ [ "assert"
6− , "effect"
5+ , "effect"
6+ , "console"
7− , "integers"
7+ , "integers"
8− , "maybe"
9− , "numbers"
8+ , "numbers"
10− , "partial"
9+ , "partial"
11− , "prelude"
10+ , "psci-support"
12− , "typelevel-prelude"
13− , "unsafe-coerce"
11+ , "unsafe-coerce"
12+ , "typelevel-prelude"
14− ]
13+ ]
14+, packages =
15−, packages = ./packages.dhall
15+ ./packages.dhall
16+, sources =
16−, sources = [ "src/**/*.purs", "test/**/*.purs" ]
17+ [ "src/**/*.purs", "test/**/*.purs" ]
17}
18}
src/Literals.purs+1
@@ -11,3 +11,4 @@ import Literals.Int (class Digit, class Int, class Int', IntLit, intLit) as Int
11import Literals.Literal (Literal, toValue) as Literal
11import Literals.Literal (Literal, toValue) as Literal
12import Literals.Number (class Number, class Number', NumberLit, numberLit) as Number
12import Literals.Number (class Number, class Number', NumberLit, numberLit) as Number
13import Literals.String (StringLit, stringLit) as String
13import Literals.String (StringLit, stringLit) as String
14+
src/Literals/Int.purs+4−5
@@ -6,7 +6,7 @@ module Literals.Int
6 , class Int
6 , class Int
7 , class Int'
7 , class Int'
8 , intLit
8 , intLit
9− , IntPart
9+ , kind IntPart
10 ) where
10 ) where
11
11
12import Prelude
12import Prelude
@@ -17,8 +17,7 @@ import Data.Symbol (class IsSymbol)
17import Literals.Literal (Literal)
17import Literals.Literal (Literal)
18import Partial.Unsafe (unsafePartial)
18import Partial.Unsafe (unsafePartial)
19import Prim.Symbol (class Cons)
19import Prim.Symbol (class Cons)
20−import Type.Prelude (reflectSymbol)
20+import Type.Prelude (SProxy(..), reflectSymbol)
21−import Type.Proxy (Proxy(..))
22import Unsafe.Coerce (unsafeCoerce)
21import Unsafe.Coerce (unsafeCoerce)
23
22
24class Digit (s :: Symbol)
23class Digit (s :: Symbol)
@@ -34,7 +33,7 @@ else instance digit7 :: Digit "7"
34else instance digit8 :: Digit "8"
33else instance digit8 :: Digit "8"
35else instance digit9 :: Digit "9"
34else instance digit9 :: Digit "9"
36
35
37−data IntPart
36+foreign import kind IntPart
38foreign import data Sign :: IntPart
37foreign import data Sign :: IntPart
39foreign import data IntegerPart :: IntPart
38foreign import data IntegerPart :: IntPart
40
39
@@ -51,4 +50,4 @@ else instance digitIntegerPart :: (Digit h, Cons h' t' t, Int' h' t' IntegerPart
51type IntLit sym = Literal Int sym
50type IntLit sym = Literal Int sym
52
51
53intLit :: forall sym. IsSymbol sym => Int sym => IntLit sym
52intLit :: forall sym. IsSymbol sym => Int sym => IntLit sym
54−intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
53+intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
src/Literals/Null.js+1−1
@@ -1 +1 @@
1−export _null = null;
1+exports.null = null;
src/Literals/Null.purs+2−14
@@ -1,17 +1,5 @@
1−module Literals.Null
1+module Literals.Null where
2− ( Null
3− , null
4− )
5−where
6−
7−import Prelude
8
2
9foreign import data Null :: Type
3foreign import data Null :: Type
10
4
11−foreign import _null :: Null
5+foreign import null :: Null
12−
13−null :: Null
14−null = _null
15−
16−instance showNull :: Show Null where
17− show _ = "null"
src/Literals/Number.purs+6−5
@@ -5,7 +5,7 @@ module Literals.Number
5 , Sign
5 , Sign
6 , class Number
6 , class Number
7 , class Number'
7 , class Number'
8− , NumberPart
8+ , kind NumberPart
9 , numberLit
9 , numberLit
10 ) where
10 ) where
11
11
@@ -13,19 +13,19 @@ import Prelude
13
13
14import Data.Maybe (fromJust)
14import Data.Maybe (fromJust)
15import Data.Number (fromString)
15import Data.Number (fromString)
16−import Data.Symbol (class IsSymbol)
16+import Data.Symbol (class IsSymbol, SProxy(..))
17import Literals.Int (class Digit)
17import Literals.Int (class Digit)
18import Literals.Literal (Literal)
18import Literals.Literal (Literal)
19import Partial.Unsafe (unsafePartial)
19import Partial.Unsafe (unsafePartial)
20import Prim.Symbol (class Cons)
20import Prim.Symbol (class Cons)
21−import Type.Prelude (reflectSymbol, Proxy(..))
21+import Type.Prelude (reflectSymbol)
22import Unsafe.Coerce (unsafeCoerce)
22import Unsafe.Coerce (unsafeCoerce)
23
23
24class Number (sym :: Symbol)
24class Number (sym :: Symbol)
25
25
26instance numberInstance :: (Number' h t Sign, Cons h t s) => Number s
26instance numberInstance :: (Number' h t Sign, Cons h t s) => Number s
27
27
28−data NumberPart
28+foreign import kind NumberPart
29foreign import data Sign :: NumberPart
29foreign import data Sign :: NumberPart
30foreign import data IntegerPart :: NumberPart
30foreign import data IntegerPart :: NumberPart
31foreign import data FractionalPart :: NumberPart
31foreign import data FractionalPart :: NumberPart
@@ -42,4 +42,5 @@ else instance digitFractionalPart :: (Digit h, Cons h' t' t, Number' h' t' Fract
42type NumberLit sym = Literal Number sym
42type NumberLit sym = Literal Number sym
43
43
44numberLit :: forall sym. IsSymbol sym => Number sym => NumberLit sym
44numberLit :: forall sym. IsSymbol sym => Number sym => NumberLit sym
45−numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
45+numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
46+
src/Literals/String.purs+4−3
@@ -3,12 +3,13 @@ module Literals.String
3 , StringLit
3 , StringLit
4 ) where
4 ) where
5
5
6−import Data.Symbol (class IsSymbol, reflectSymbol)
6+import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
7−import Type.Proxy (Proxy(..))
8import Literals.Literal (Literal)
7import Literals.Literal (Literal)
9import Unsafe.Coerce (unsafeCoerce)
8import Unsafe.Coerce (unsafeCoerce)
10
9
11type StringLit sym = Literal String sym
10type StringLit sym = Literal String sym
12
11
13stringLit :: forall sym. IsSymbol sym => StringLit sym
12stringLit :: forall sym. IsSymbol sym => StringLit sym
14−stringLit = unsafeCoerce (reflectSymbol (Proxy :: Proxy sym))
13+stringLit = unsafeCoerce (reflectSymbol (SProxy :: SProxy sym))
14+
15+
src/Literals/Undefined.js+1−1
@@ -1 +1 @@
1−export const _undefined = undefined;
1+exports.undefined = undefined;
src/Literals/Undefined.purs+2−9
@@ -1,17 +1,10 @@
1−module Literals.Undefined
1+module Literals.Undefined where
2− ( Undefined
3− , undefined
4− )
5−where
6
2
7import Prelude
3import Prelude
8
4
9foreign import data Undefined :: Type
5foreign import data Undefined :: Type
10
6
11−foreign import _undefined :: Undefined
12−
13−undefined :: Undefined
7+foreign import undefined :: Undefined
14−undefined = _undefined
15
8
16instance undefinedEq :: Eq Undefined where
9instance undefinedEq :: Eq Undefined where
17 eq _ _ = true
10 eq _ _ = true