mirror of
https://github.com/rowtype-yoga/purescript-literals.git
synced 2024-11-25 07:22:41 +03:00
Updates for purs v0.15
This commit is contained in:
parent
006646ad1a
commit
560e83fa0b
@ -117,7 +117,8 @@ let additions =
|
||||
-------------------------------
|
||||
-}
|
||||
let upstream =
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210309/packages.dhall sha256:585332a8a11c6420d7287943f81bc2121746cdd352f2cf3f5ecf65053f2afcd3
|
||||
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall
|
||||
sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa
|
||||
|
||||
let overrides = {=}
|
||||
|
||||
|
@ -4,13 +4,13 @@
|
||||
, dependencies =
|
||||
[ "assert"
|
||||
, "effect"
|
||||
, "console"
|
||||
, "integers"
|
||||
, "maybe"
|
||||
, "numbers"
|
||||
, "partial"
|
||||
, "psci-support"
|
||||
, "unsafe-coerce"
|
||||
, "prelude"
|
||||
, "typelevel-prelude"
|
||||
, "unsafe-coerce"
|
||||
]
|
||||
, packages = ./packages.dhall
|
||||
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
|
||||
|
@ -17,7 +17,8 @@ import Data.Symbol (class IsSymbol)
|
||||
import Literals.Literal (Literal)
|
||||
import Partial.Unsafe (unsafePartial)
|
||||
import Prim.Symbol (class Cons)
|
||||
import Type.Prelude (SProxy(..), reflectSymbol)
|
||||
import Type.Prelude (reflectSymbol)
|
||||
import Type.Proxy (Proxy(..))
|
||||
import Unsafe.Coerce (unsafeCoerce)
|
||||
|
||||
class Digit (s :: Symbol)
|
||||
@ -50,4 +51,4 @@ else instance digitIntegerPart :: (Digit h, Cons h' t' t, Int' h' t' IntegerPart
|
||||
type IntLit sym = Literal Int sym
|
||||
|
||||
intLit :: forall sym. IsSymbol sym => Int sym => IntLit sym
|
||||
intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
|
||||
intLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
|
||||
|
@ -1 +1 @@
|
||||
exports.null = null;
|
||||
export _null = null;
|
||||
|
@ -1,10 +1,17 @@
|
||||
module Literals.Null where
|
||||
module Literals.Null
|
||||
( Null
|
||||
, null
|
||||
)
|
||||
where
|
||||
|
||||
import Prelude
|
||||
|
||||
foreign import data Null :: Type
|
||||
|
||||
foreign import null :: Null
|
||||
foreign import _null :: Null
|
||||
|
||||
null :: Null
|
||||
null = _null
|
||||
|
||||
instance showNull :: Show Null where
|
||||
show _ = "null"
|
||||
|
@ -13,12 +13,12 @@ import Prelude
|
||||
|
||||
import Data.Maybe (fromJust)
|
||||
import Data.Number (fromString)
|
||||
import Data.Symbol (class IsSymbol, SProxy(..))
|
||||
import Data.Symbol (class IsSymbol)
|
||||
import Literals.Int (class Digit)
|
||||
import Literals.Literal (Literal)
|
||||
import Partial.Unsafe (unsafePartial)
|
||||
import Prim.Symbol (class Cons)
|
||||
import Type.Prelude (reflectSymbol)
|
||||
import Type.Prelude (reflectSymbol, Proxy(..))
|
||||
import Unsafe.Coerce (unsafeCoerce)
|
||||
|
||||
class Number (sym :: Symbol)
|
||||
@ -42,4 +42,4 @@ else instance digitFractionalPart :: (Digit h, Cons h' t' t, Number' h' t' Fract
|
||||
type NumberLit sym = Literal Number sym
|
||||
|
||||
numberLit :: forall sym. IsSymbol sym => Number sym => NumberLit sym
|
||||
numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (SProxy :: SProxy sym)
|
||||
numberLit = unsafeCoerce $ unsafePartial $ fromJust $ fromString $ reflectSymbol (Proxy :: Proxy sym)
|
||||
|
@ -3,13 +3,12 @@ module Literals.String
|
||||
, StringLit
|
||||
) where
|
||||
|
||||
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
|
||||
import Data.Symbol (class IsSymbol, reflectSymbol)
|
||||
import Type.Proxy (Proxy(..))
|
||||
import Literals.Literal (Literal)
|
||||
import Unsafe.Coerce (unsafeCoerce)
|
||||
|
||||
type StringLit sym = Literal String sym
|
||||
|
||||
stringLit :: forall sym. IsSymbol sym => StringLit sym
|
||||
stringLit = unsafeCoerce (reflectSymbol (SProxy :: SProxy sym))
|
||||
|
||||
|
||||
stringLit = unsafeCoerce (reflectSymbol (Proxy :: Proxy sym))
|
||||
|
@ -1 +1 @@
|
||||
exports.undefined = undefined;
|
||||
export const _undefined = undefined;
|
||||
|
@ -1,10 +1,17 @@
|
||||
module Literals.Undefined where
|
||||
module Literals.Undefined
|
||||
( Undefined
|
||||
, undefined
|
||||
)
|
||||
where
|
||||
|
||||
import Prelude
|
||||
|
||||
foreign import data Undefined :: Type
|
||||
|
||||
foreign import undefined :: Undefined
|
||||
foreign import _undefined :: Undefined
|
||||
|
||||
undefined :: Undefined
|
||||
undefined = _undefined
|
||||
|
||||
instance undefinedEq :: Eq Undefined where
|
||||
eq _ _ = true
|
||||
|
Loading…
Reference in New Issue
Block a user