@@ -1,631 +0,0 @@
1−-- | This snapshot is provided for the purposes of running the test suite.
2−-- | It is not necessarily kept up to date with the official PureScript Prelude,
3−-- | and should not be used in user code.
4−-- | The official Prelude can be found at https://github.com/purescript/purescript-prelude
15− , Semigroupoid, (<<<), (>>>)
17− , Functor, (<$>), (<#>), void
19− , Applicative, pure, liftA1
21− , Monad, return, liftM1, ap
22− , Semigroup, (<>), (++)
23− , Semiring, (+), zero, (*), one
24− , ModuloSemiring, (/), mod, jsMod, (%)
29− , Ordering(..), Ord, compare, (<), (>), (<=), (>=)
30− , Bounded, top, bottom
31− , Lattice, sup, inf, (||), (&&)
33− , ComplementedLattice, not
34− , DistributiveLattice
39− newtype Unit = Unit {}
44− foreign import length :: forall a. Array a -> Number
49− ($) :: forall a b. (a -> b) -> a -> b
52− (#) :: forall a b. a -> (a -> b) -> b
55− flip :: forall a b c. (a -> b -> c) -> b -> a -> c
58− const :: forall a b. a -> b -> a
61− asTypeOf :: forall a. a -> a -> a
67− foreign import cons :: forall a. a -> Array a -> Array a
71− (:) :: forall a. a -> Array a -> Array a
74− foreign import concat :: forall a. Array a -> Array a -> Array a
79− class Semigroupoid a where
80− (<<<) :: forall b c d. a c d -> a b c -> a b d
82− instance semigroupoidArr :: Semigroupoid (->) where
83− (<<<) f g x = f (g x)
85− (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
88− class (Semigroupoid a) <= Category a where
89− id :: forall t. a t t
91− instance categoryArr :: Category (->) where
97− class Functor f where
98− (<$>) :: forall a b. (a -> b) -> f a -> f b
100− instance functorArr :: Functor ((->) r) where
103− (<#>) :: forall f a b. (Functor f) => f a -> (a -> b) -> f b
104− (<#>) fa f = f <$> fa
106− void :: forall f a. (Functor f) => f a -> f Unit
107− void fa = const unit <$> fa
111− class (Functor f) <= Apply f where
112− (<*>) :: forall a b. f (a -> b) -> f a -> f b
114− instance applyArr :: Apply ((->) r) where
115− (<*>) f g x = f x (g x)
117− class (Apply f) <= Applicative f where
118− pure :: forall a. a -> f a
120− instance applicativeArr :: Applicative ((->) r) where
123− return :: forall m a. (Applicative m) => a -> m a
126− liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
127− liftA1 f a = pure f <*> a
131− (>>=) :: forall m a b. (Bind m) => m a -> (a -> m b) -> m b
134− class (Apply m) <= Bind m where
135− bind :: forall a b. m a -> (a -> m b) -> m b
137− instance bindArr :: Bind ((->) r) where
138− bind m f x = f (m x) x
140− class (Applicative m, Bind m) <= Monad m
142− instance monadArr :: Monad ((->) r)
144− liftM1 :: forall m a b. (Monad m) => (a -> b) -> m a -> m b
149− ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
158− class Semigroup a where
161− (++) :: forall s. (Semigroup s) => s -> s -> s
164− instance semigroupString :: Semigroup String where
167− instance semigroupUnit :: Semigroup Unit where
170− instance semigroupArr :: (Semigroup s') => Semigroup (s -> s') where
171− (<>) f g = \x -> f x <> g x
173− instance semigroupOrdering :: Semigroup Ordering where
178− foreign import concatString :: String -> String -> String
183− class Semiring a where
189− instance semiringNumber :: Semiring Number where
195− instance semiringUnit :: Semiring Unit where
203− class (Semiring a) <= Ring a where
206− instance ringNumber :: Ring Number where
209− instance ringUnit :: Ring Unit where
212− negate :: forall a. (Ring a) => a -> a
217− class (Semiring a) <= ModuloSemiring a where
221− instance moduloSemiringNumber :: ModuloSemiring Number where
225− instance moduloSemiringUnit :: ModuloSemiring Unit where
229− foreign import jsMod :: Number -> Number -> Number
235− class (Ring a, ModuloSemiring a) <= DivisionRing a
237− instance divisionRingNumber :: DivisionRing Number
239− instance divisionRingUnit :: DivisionRing Unit
241− class (DivisionRing a) <= Num a
243− instance numNumber :: Num Number
245− instance numUnit :: Num Unit
247− foreign import numAdd :: Number -> Number -> Number
249− foreign import numMul :: Number -> Number -> Number
251− foreign import numDiv :: Number -> Number -> Number
253− foreign import numSub :: Number -> Number -> Number
259− (==) :: a -> a -> Boolean
260− (/=) :: a -> a -> Boolean
262− instance eqBoolean :: Eq Boolean where
266− instance eqNumber :: Eq Number where
270− instance eqInt :: Eq Int where
274− instance eqChar :: Eq Char where
278− instance eqString :: Eq String where
282− instance eqUnit :: Eq Unit where
286− instance eqArray :: (Eq a) => Eq (Array a) where
287− (==) = eqArrayImpl (==)
288− (/=) xs ys = not (xs == ys)
290− instance eqOrdering :: Eq Ordering where
295− (/=) x y = not (x == y)
297− foreign import refEq :: forall a. a -> a -> Boolean
299− foreign import refIneq :: forall a. a -> a -> Boolean
301− foreign import eqArrayImpl :: forall a. (a -> a -> Boolean) -> Array a -> Array a -> Boolean
303− data Ordering = LT | GT | EQ
305− class (Eq a) <= Ord a where
306− compare :: a -> a -> Ordering
308− instance ordBoolean :: Ord Boolean where
309− compare false false = EQ
310− compare false true = LT
311− compare true true = EQ
312− compare true false = GT
314− instance ordNumber :: Ord Number where
315− compare = unsafeCompare
317− instance ordString :: Ord String where
318− compare = unsafeCompare
320− instance ordUnit :: Ord Unit where
323− instance ordArray :: (Ord a) => Ord (Array a) where
324− compare xs ys = compare 0.0 $ ordArrayImpl (\x y -> case compare x y of
329− foreign import ordArrayImpl :: forall a. (a -> a -> Number) -> Array a -> Array a -> Number
331− instance ordOrdering :: Ord Ordering where
345− (<) :: forall a. (Ord a) => a -> a -> Boolean
346− (<) a1 a2 = case a1 `compare` a2 of
350− (>) :: forall a. (Ord a) => a -> a -> Boolean
351− (>) a1 a2 = case a1 `compare` a2 of
355− (<=) :: forall a. (Ord a) => a -> a -> Boolean
356− (<=) a1 a2 = case a1 `compare` a2 of
360− (>=) :: forall a. (Ord a) => a -> a -> Boolean
361− (>=) a1 a2 = case a1 `compare` a2 of
365− unsafeCompare :: forall a. a -> a -> Ordering
366− unsafeCompare = unsafeCompareImpl LT EQ GT
368− foreign import unsafeCompareImpl :: forall a. Ordering -> Ordering -> Ordering -> a -> a -> Ordering
370− class (Ord a) <= Bounded a where
374− instance boundedBoolean :: Bounded Boolean where
378− instance boundedUnit :: Bounded Unit where
382− instance boundedOrdering :: Bounded Ordering where
386− class (Ord a) <= Lattice a where
390− instance latticeBoolean :: Lattice Boolean where
394− instance latticeUnit :: Lattice Unit where
401− (||) :: forall a. (Lattice a) => a -> a -> a
404− (&&) :: forall a. (Lattice a) => a -> a -> a
407− class (Bounded a, Lattice a) <= BoundedLattice a
409− instance boundedLatticeBoolean :: BoundedLattice Boolean
411− instance boundedLatticeUnit :: BoundedLattice Unit
413− class (BoundedLattice a) <= ComplementedLattice a where
416− instance complementedLatticeBoolean :: ComplementedLattice Boolean where
419− instance complementedLatticeUnit :: ComplementedLattice Unit where
422− class (Lattice a) <= DistributiveLattice a
424− instance distributiveLatticeBoolean :: DistributiveLattice Boolean
426− instance distributiveLatticeUnit :: DistributiveLattice Unit
428− class (ComplementedLattice a, DistributiveLattice a) <= BooleanAlgebra a
430− instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
432− instance booleanAlgebraUnit :: BooleanAlgebra Unit
434− foreign import boolOr :: Boolean -> Boolean -> Boolean
436− foreign import boolAnd :: Boolean -> Boolean -> Boolean
438− foreign import boolNot :: Boolean -> Boolean
443− instance showBoolean :: Show Boolean where
445− show false = "false"
447− instance showNumber :: Show Number where
448− show = showNumberImpl
450− instance showString :: Show String where
451− show = showStringImpl
453− instance showUnit :: Show Unit where
456− instance showArray :: (Show a) => Show (Array a) where
457− show = showArrayImpl show
459− instance showOrdering :: Show Ordering where
464− foreign import showNumberImpl :: Number -> String
466− foreign import showStringImpl :: String -> String
468− foreign import showArrayImpl :: forall a. (a -> String) -> Array a -> String
470−module Data.Function where
474− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
475− on f g x y = g x `f` g y
477− foreign import data Fn0 :: * -> *
479− foreign import data Fn1 :: * -> * -> *
481− foreign import data Fn2 :: * -> * -> * -> *
483− foreign import data Fn3 :: * -> * -> * -> * -> *
485− foreign import data Fn4 :: * -> * -> * -> * -> * -> *
487− foreign import data Fn5 :: * -> * -> * -> * -> * -> * -> *
489− foreign import data Fn6 :: * -> * -> * -> * -> * -> * -> * -> *
491− foreign import data Fn7 :: * -> * -> * -> * -> * -> * -> * -> * -> *
493− foreign import data Fn8 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> *
495− foreign import data Fn9 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
497− foreign import data Fn10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
499− foreign import mkFn0 :: forall a. (Unit -> a) -> Fn0 a
501− foreign import mkFn1 :: forall a b. (a -> b) -> Fn1 a b
503− foreign import mkFn2 :: forall a b c. (a -> b -> c) -> Fn2 a b c
505− foreign import mkFn3 :: forall a b c d. (a -> b -> c -> d) -> Fn3 a b c d
507− foreign import mkFn4 :: forall a b c d e. (a -> b -> c -> d -> e) -> Fn4 a b c d e
509− foreign import mkFn5 :: forall a b c d e f. (a -> b -> c -> d -> e -> f) -> Fn5 a b c d e f
511− foreign import mkFn6 :: forall a b c d e f g. (a -> b -> c -> d -> e -> f -> g) -> Fn6 a b c d e f g
513− foreign import mkFn7 :: forall a b c d e f g h. (a -> b -> c -> d -> e -> f -> g -> h) -> Fn7 a b c d e f g h
515− foreign import mkFn8 :: forall a b c d e f g h i. (a -> b -> c -> d -> e -> f -> g -> h -> i) -> Fn8 a b c d e f g h i
517− foreign import mkFn9 :: forall a b c d e f g h i j. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> Fn9 a b c d e f g h i j
519− foreign import mkFn10 :: forall a b c d e f g h i j k. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k) -> Fn10 a b c d e f g h i j k
521− foreign import runFn0 :: forall a. Fn0 a -> a
523− foreign import runFn1 :: forall a b. Fn1 a b -> a -> b
525− foreign import runFn2 :: forall a b c. Fn2 a b c -> a -> b -> c
527− foreign import runFn3 :: forall a b c d. Fn3 a b c d -> a -> b -> c -> d
529− foreign import runFn4 :: forall a b c d e. Fn4 a b c d e -> a -> b -> c -> d -> e
531− foreign import runFn5 :: forall a b c d e f. Fn5 a b c d e f -> a -> b -> c -> d -> e -> f
533− foreign import runFn6 :: forall a b c d e f g. Fn6 a b c d e f g -> a -> b -> c -> d -> e -> f -> g
535− foreign import runFn7 :: forall a b c d e f g h. Fn7 a b c d e f g h -> a -> b -> c -> d -> e -> f -> g -> h
537− foreign import runFn8 :: forall a b c d e f g h i. Fn8 a b c d e f g h i -> a -> b -> c -> d -> e -> f -> g -> h -> i
539− foreign import runFn9 :: forall a b c d e f g h i j. Fn9 a b c d e f g h i j -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j
541− foreign import runFn10 :: forall a b c d e f g h i j k. Fn10 a b c d e f g h i j k -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k
546− import Control.Monad.Eff
548− foreign import data Assert :: !
550− foreign import error :: forall a. String -> a
552− foreign import assertPartial :: forall e a. (Unit -> a) -> Eff (assert :: Assert | e) Unit
554− assert :: forall e. Boolean -> Eff (assert :: Assert | e) Unit
555− assert true = return unit
556− assert false = error "Assertion failed!"
558−module Prelude.Unsafe where
560− foreign import unsafeIndex :: forall a. Array a -> Number -> a
562−module Control.Monad.Eff
571− foreign import data Eff :: # ! -> * -> *
573− foreign import returnE :: forall e a. a -> Eff e a
575− foreign import bindE :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
577− type Pure a = forall e. Eff e a
579− foreign import runPure :: forall a. Pure a -> a
581− instance functorEff :: Functor (Eff e) where
584− instance applyEff :: Apply (Eff e) where
587− instance applicativeEff :: Applicative (Eff e) where
590− instance bindEff :: Bind (Eff e) where
593− instance monadEff :: Monad (Eff e)
595− foreign import untilE :: forall e. Eff e Boolean -> Eff e Unit
597− foreign import whileE :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
599−module Debug.Trace where
602− import Control.Monad.Eff
604− foreign import data Trace :: !
606− foreign import trace :: forall r. String -> Eff (trace :: Trace | r) Unit
608− print :: forall a r. (Show a) => a -> Eff (trace :: Trace | r) Unit
609− print o = trace (show o)
611−module Control.Monad.ST where
614− import Control.Monad.Eff
616− foreign import data ST :: * -> !
618− foreign import data STRef :: * -> * -> *
620− foreign import newSTRef :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
622− foreign import readSTRef :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
624− foreign import modifySTRef :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
626− foreign import writeSTRef :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
628− foreign import runST :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
630− pureST :: forall a. (forall h r. Eff (st :: ST h | r) a) -> a
631− pureST st = runPure (runST st)