git.iko.soy/purescript-literals
on main help sign in
10 files changed+76−60
since splitsnapshots
unifiedsplit
bower.json+25−28 packages.dhall+2−1 spago.dhall+15−16 src/Literals/Int.purs+3−2 src/Literals/Null.js+1−1 src/Literals/Null.purs+14−2 src/Literals/Number.purs+3−3 src/Literals/String.purs+3−4 src/Literals/Undefined.js+1−1 src/Literals/Undefined.purs+9−2
bower.json+25−28
@@ -1,30 +1,27 @@
11{
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": "",
9− "license": "MIT",
10− "repository": {
11− "type": "git",
12− "url": "https://github.com/jvliwanag/purescript-literals.git"
13− },
14− "ignore": [
15− "**/.*",
16− "node_modules",
17− "bower_components",
18− "test",
19− "tests"
20− ],
21− "dependencies": {
22− "purescript-unsafe-coerce": "^4.0.0",
23− "purescript-prelude": "^4.1.1",
24− "purescript-maybe": "^4.0.1",
25− "purescript-integers": "^4.0.0",
26− "purescript-typelevel-prelude": "^5.0.2",
27− "purescript-partial": "^2.0.1",
28− "purescript-numbers": "^7.0.0"
29− }
2+ "name": "purescript-literals",
3+ "license": [
4+ "MIT"
5+ ],
6+ "repository": {
7+ "type": "git",
8+ "url": "https://github.com/rowtype-yoga/purescript-literals.git"
9+ },
10+ "ignore": [
11+ "**/.*",
12+ "node_modules",
13+ "bower_components",
14+ "output"
15+ ],
16+ "dependencies": {
17+ "purescript-assert": "^v6.0.0",
18+ "purescript-effect": "^v4.0.0",
19+ "purescript-integers": "^v6.0.0",
20+ "purescript-maybe": "^v6.0.0",
21+ "purescript-numbers": "^v9.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+ }
3027}
packages.dhall+2−1
@@ -117,7 +117,8 @@ let additions =
117117-------------------------------
118118-}
119119let upstream =
120− https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210309/packages.dhall sha256:585332a8a11c6420d7287943f81bc2121746cdd352f2cf3f5ecf65053f2afcd3
120+ https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220530/packages.dhall
121+ sha256:15dd8041480502850e4043ea2977ed22d6ab3fc24d565211acde6f8c5152a799
121122
122123let overrides = {=}
123124
spago.dhall+15−16
@@ -1,18 +1,17 @@
1−{ name =
2− "literals"
1+{ name = "literals"
2+, license = "MIT"
3+, repository = "https://github.com/rowtype-yoga/purescript-literals.git"
34, dependencies =
4− [ "assert"
5− , "effect"
6− , "console"
7− , "integers"
8− , "numbers"
9− , "partial"
10− , "psci-support"
11− , "unsafe-coerce"
12− , "typelevel-prelude"
13− ]
14−, packages =
15− ./packages.dhall
16−, sources =
17− [ "src/**/*.purs", "test/**/*.purs" ]
5+ [ "assert"
6+ , "effect"
7+ , "integers"
8+ , "maybe"
9+ , "numbers"
10+ , "partial"
11+ , "prelude"
12+ , "typelevel-prelude"
13+ , "unsafe-coerce"
14+ ]
15+, packages = ./packages.dhall
16+, sources = [ "src/**/*.purs", "test/**/*.purs" ]
1817}
src/Literals/Int.purs+3−2
@@ -17,7 +17,8 @@ import Data.Symbol (class IsSymbol)
1717import Literals.Literal (Literal)
1818import Partial.Unsafe (unsafePartial)
1919import Prim.Symbol (class Cons)
20−import Type.Prelude (SProxy(..), reflectSymbol)
20+import Type.Prelude (reflectSymbol)
21+import Type.Proxy (Proxy(..))
2122import Unsafe.Coerce (unsafeCoerce)
2223
2324class Digit (s :: Symbol)
@@ -50,4 +51,4 @@ else instance digitIntegerPart :: (Digit h, Cons h' t' t, Int' h' t' IntegerPart
5051type IntLit sym = Literal Int sym
5152
5253intLit :: forall sym. IsSymbol sym => Int sym => IntLit sym
53−intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
54+intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
src/Literals/Null.js+1−1
@@ -1 +1 @@
1−exports.null = null;
1+export _null = null;
src/Literals/Null.purs+14−2
@@ -1,5 +1,17 @@
1−module Literals.Null where
1+module Literals.Null
2+ ( Null
3+ , null
4+ )
5+where
6+
7+import Prelude
28
39foreign import data Null :: Type
410
5−foreign import null :: Null
11+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+3−3
@@ -13,12 +13,12 @@ import Prelude
1313
1414import Data.Maybe (fromJust)
1515import Data.Number (fromString)
16−import Data.Symbol (class IsSymbol, SProxy(..))
16+import Data.Symbol (class IsSymbol)
1717import Literals.Int (class Digit)
1818import Literals.Literal (Literal)
1919import Partial.Unsafe (unsafePartial)
2020import Prim.Symbol (class Cons)
21−import Type.Prelude (reflectSymbol)
21+import Type.Prelude (reflectSymbol, Proxy(..))
2222import Unsafe.Coerce (unsafeCoerce)
2323
2424class Number (sym :: Symbol)
@@ -42,4 +42,4 @@ else instance digitFractionalPart :: (Digit h, Cons h' t' t, Number' h' t' Fract
4242type NumberLit sym = Literal Number sym
4343
4444numberLit :: forall sym. IsSymbol sym => Number sym => NumberLit sym
45−numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
45+numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
src/Literals/String.purs+3−4
@@ -3,13 +3,12 @@ module Literals.String
33 , StringLit
44 ) where
55
6−import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+import Data.Symbol (class IsSymbol, reflectSymbol)
7+import Type.Proxy (Proxy(..))
78import Literals.Literal (Literal)
89import Unsafe.Coerce (unsafeCoerce)
910
1011type StringLit sym = Literal String sym
1112
1213stringLit :: forall sym. IsSymbol sym => StringLit sym
13−stringLit = unsafeCoerce (reflectSymbol (SProxy :: SProxy sym))
14−
15−
14+stringLit = unsafeCoerce (reflectSymbol (Proxy :: Proxy sym))
src/Literals/Undefined.js+1−1
@@ -1 +1 @@
1−exports.undefined = undefined;
1+export const _undefined = undefined;
src/Literals/Undefined.purs+9−2
@@ -1,10 +1,17 @@
1−module Literals.Undefined where
1+module Literals.Undefined
2+ ( Undefined
3+ , undefined
4+ )
5+where
26
37import Prelude
48
59foreign import data Undefined :: Type
610
7−foreign import undefined :: Undefined
11+foreign import _undefined :: Undefined
12+
13+undefined :: Undefined
14+undefined = _undefined
815
916instance undefinedEq :: Eq Undefined where
1017 eq _ _ = true