git.iko.soy/purescript-literals
on main help sign in
Merge pull request #12 from klntsky/klntsky/updates-for-v0.15
2c40dcaJan Vincent Liwanag
packages.dhall+2−1
@@ -117,7 +117,8 @@ let additions =
117-------------------------------
117-------------------------------
118-}
118-}
119let upstream =
119let 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.0-20220513/packages.dhall
121+ sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa
121
122
122let overrides = {=}
123let overrides = {=}
123
124
spago.dhall+3−3
@@ -4,13 +4,13 @@
4, dependencies =
4, dependencies =
5 [ "assert"
5 [ "assert"
6 , "effect"
6 , "effect"
7− , "console"
8 , "integers"
7 , "integers"
8+ , "maybe"
9 , "numbers"
9 , "numbers"
10 , "partial"
10 , "partial"
11− , "psci-support"
11+ , "prelude"
12− , "unsafe-coerce"
13 , "typelevel-prelude"
12 , "typelevel-prelude"
13+ , "unsafe-coerce"
14 ]
14 ]
15, packages = ./packages.dhall
15, packages = ./packages.dhall
16, sources = [ "src/**/*.purs", "test/**/*.purs" ]
16, sources = [ "src/**/*.purs", "test/**/*.purs" ]
src/Literals/Int.purs+3−2
@@ -17,7 +17,8 @@ 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 (SProxy(..), reflectSymbol)
20+import Type.Prelude (reflectSymbol)
21+import Type.Proxy (Proxy(..))
21import Unsafe.Coerce (unsafeCoerce)
22import Unsafe.Coerce (unsafeCoerce)
22
23
23class Digit (s :: Symbol)
24class Digit (s :: Symbol)
@@ -50,4 +51,4 @@ else instance digitIntegerPart :: (Digit h, Cons h' t' t, Int' h' t' IntegerPart
50type IntLit sym = Literal Int sym
51type IntLit sym = Literal Int sym
51
52
52intLit :: forall sym. IsSymbol sym => Int sym => IntLit sym
53intLit :: 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+9−2
@@ -1,10 +1,17 @@
1−module Literals.Null where
1+module Literals.Null
2+ ( Null
3+ , null
4+ )
5+where
2
6
3import Prelude
7import Prelude
4
8
5foreign import data Null :: Type
9foreign import data Null :: Type
6
10
7−foreign import null :: Null
11+foreign import _null :: Null
12+
13+null :: Null
14+null = _null
8
15
9instance showNull :: Show Null where
16instance showNull :: Show Null where
10 show _ = "null"
17 show _ = "null"
src/Literals/Number.purs+3−3
@@ -13,12 +13,12 @@ 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, SProxy(..))
16+import Data.Symbol (class IsSymbol)
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)
21+import Type.Prelude (reflectSymbol, Proxy(..))
22import Unsafe.Coerce (unsafeCoerce)
22import Unsafe.Coerce (unsafeCoerce)
23
23
24class Number (sym :: Symbol)
24class Number (sym :: Symbol)
@@ -42,4 +42,4 @@ 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 (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
3 , StringLit
3 , StringLit
4 ) where
4 ) where
5
5
6−import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
6+import Data.Symbol (class IsSymbol, reflectSymbol)
7+import Type.Proxy (Proxy(..))
7import Literals.Literal (Literal)
8import Literals.Literal (Literal)
8import Unsafe.Coerce (unsafeCoerce)
9import Unsafe.Coerce (unsafeCoerce)
9
10
10type StringLit sym = Literal String sym
11type StringLit sym = Literal String sym
11
12
12stringLit :: forall sym. IsSymbol sym => StringLit sym
13stringLit :: forall sym. IsSymbol sym => StringLit sym
13−stringLit = unsafeCoerce (reflectSymbol (SProxy :: SProxy sym))
14+stringLit = unsafeCoerce (reflectSymbol (Proxy :: Proxy sym))
14−
15−
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
2
6
3import Prelude
7import Prelude
4
8
5foreign import data Undefined :: Type
9foreign import data Undefined :: Type
6
10
11+foreign import _undefined :: Undefined
12+
7−foreign import undefined :: Undefined
13+undefined :: Undefined
14+undefined = _undefined
8
15
9instance undefinedEq :: Eq Undefined where
16instance undefinedEq :: Eq Undefined where
10 eq _ _ = true
17 eq _ _ = true