@@ -1,1068 +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
14− , Semigroupoid, (<<<), (>>>)
16− , Functor, (<$>), (<#>), void
18− , Applicative, pure, liftA1
20− , Monad, return, liftM1, ap
21− , Semigroup, (<>), (++)
22− , Semiring, (+), zero, (*), one
23− , ModuloSemiring, (/), mod
28− , Ordering(..), Ord, compare, (<), (>), (<=), (>=)
29− , Bounded, top, bottom
30− , Lattice, sup, inf, (||), (&&)
32− , ComplementedLattice, not
33− , DistributiveLattice
38− newtype Unit = Unit {}
46− ($) :: forall a b. (a -> b) -> a -> b
49− (#) :: forall a b. a -> (a -> b) -> b
52− flip :: forall a b c. (a -> b -> c) -> b -> a -> c
55− const :: forall a b. a -> b -> a
58− asTypeOf :: forall a. a -> a -> a
68− return [e].concat(l);
71− """ :: forall a. a -> Array a -> Array a
75− (:) :: forall a. a -> Array a -> Array a
81− class Semigroupoid a where
82− (<<<) :: forall b c d. a c d -> a b c -> a b d
84− instance semigroupoidArr :: Semigroupoid (->) where
85− (<<<) f g x = f (g x)
87− (>>>) :: forall a b c d. (Semigroupoid a) => a b c -> a c d -> a b d
90− class (Semigroupoid a) <= Category a where
91− id :: forall t. a t t
93− instance categoryArr :: Category (->) where
99− class Functor f where
100− (<$>) :: forall a b. (a -> b) -> f a -> f b
102− instance functorArr :: Functor ((->) r) where
105− (<#>) :: forall f a b. (Functor f) => f a -> (a -> b) -> f b
106− (<#>) fa f = f <$> fa
108− void :: forall f a. (Functor f) => f a -> f Unit
109− void fa = const unit <$> fa
113− class (Functor f) <= Apply f where
114− (<*>) :: forall a b. f (a -> b) -> f a -> f b
116− instance applyArr :: Apply ((->) r) where
117− (<*>) f g x = f x (g x)
119− class (Apply f) <= Applicative f where
120− pure :: forall a. a -> f a
122− instance applicativeArr :: Applicative ((->) r) where
125− return :: forall m a. (Applicative m) => a -> m a
128− liftA1 :: forall f a b. (Applicative f) => (a -> b) -> f a -> f b
129− liftA1 f a = pure f <*> a
133− class (Apply m) <= Bind m where
134− (>>=) :: forall a b. m a -> (a -> m b) -> m b
136− instance bindArr :: Bind ((->) r) where
137− (>>=) m f x = f (m x) x
139− class (Applicative m, Bind m) <= Monad m
141− instance monadArr :: Monad ((->) r)
143− liftM1 :: forall m a b. (Monad m) => (a -> b) -> m a -> m b
148− ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
157− class Semigroup a where
160− (++) :: forall s. (Semigroup s) => s -> s -> s
163− instance semigroupString :: Semigroup String where
166− instance semigroupUnit :: Semigroup Unit where
169− instance semigroupArr :: (Semigroup s') => Semigroup (s -> s') where
170− (<>) f g = \x -> f x <> g x
172− instance semigroupOrdering :: Semigroup Ordering where
177− foreign import concatString
179− function concatString(s1) {
180− return function(s2) {
184− """ :: String -> String -> String
189− class Semiring a where
195− instance semiringNumber :: Semiring Number where
201− instance semiringUnit :: Semiring Unit where
209− class (Semiring a) <= Ring a where
212− instance ringNumber :: Ring Number where
215− instance ringUnit :: Ring Unit where
218− negate :: forall a. (Ring a) => a -> a
223− class (Semiring a) <= ModuloSemiring a where
227− instance moduloSemiringNumber :: ModuloSemiring Number where
231− instance moduloSemiringUnit :: ModuloSemiring Unit where
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
249− function numAdd(n1) {
250− return function(n2) {
254− """ :: Number -> Number -> Number
256− foreign import numMul
258− function numMul(n1) {
259− return function(n2) {
263− """ :: Number -> Number -> Number
265− foreign import numDiv
267− function numDiv(n1) {
268− return function(n2) {
272− """ :: Number -> Number -> Number
274− foreign import numSub
276− function numSub(n1) {
277− return function(n2) {
281− """ :: Number -> Number -> Number
287− (==) :: a -> a -> Boolean
288− (/=) :: a -> a -> Boolean
290− instance eqBoolean :: Eq Boolean where
294− instance eqNumber :: Eq Number where
298− instance eqString :: Eq String where
302− instance eqUnit :: Eq Unit where
306− instance eqArray :: (Eq a) => Eq (Array a) where
307− (==) = eqArrayImpl (==)
308− (/=) xs ys = not (xs == ys)
310− instance eqOrdering :: Eq Ordering where
315− (/=) x y = not (x == y)
317− foreign import refEq
319− function refEq(r1) {
320− return function(r2) {
324− """ :: forall a. a -> a -> Boolean
326− foreign import refIneq
328− function refIneq(r1) {
329− return function(r2) {
333− """ :: forall a. a -> a -> Boolean
335− foreign import eqArrayImpl
337− function eqArrayImpl(f) {
338− return function(xs) {
339− return function(ys) {
340− if (xs.length !== ys.length) return false;
341− for (var i = 0; i < xs.length; i++) {
342− if (!f(xs[i])(ys[i])) return false;
348− """ :: forall a. (a -> a -> Boolean) -> Array a -> Array a -> Boolean
350− data Ordering = LT | GT | EQ
352− class (Eq a) <= Ord a where
353− compare :: a -> a -> Ordering
355− instance ordBoolean :: Ord Boolean where
356− compare false false = EQ
357− compare false true = LT
358− compare true true = EQ
359− compare true false = GT
361− instance ordNumber :: Ord Number where
362− compare = unsafeCompare
364− instance ordString :: Ord String where
365− compare = unsafeCompare
367− instance ordUnit :: Ord Unit where
370− instance ordArray :: (Ord a) => Ord (Array a) where
371− compare xs ys = compare 0.0 $ ordArrayImpl (\x y -> case compare x y of
376− foreign import ordArrayImpl """
377− function ordArrayImpl(f) {
378− return function (ys) {
379− return function (ys) {
381− while (i < xs.length && i < ys.length) {
389− if (xs.length == ys.length) {
391− } else if (xs.length > ys.length) {
399− """ :: forall a. (a -> a -> Number) -> Array a -> Array a -> Number
401− instance ordOrdering :: Ord Ordering where
415− (<) :: forall a. (Ord a) => a -> a -> Boolean
416− (<) a1 a2 = case a1 `compare` a2 of
420− (>) :: forall a. (Ord a) => a -> a -> Boolean
421− (>) a1 a2 = case a1 `compare` a2 of
425− (<=) :: forall a. (Ord a) => a -> a -> Boolean
426− (<=) a1 a2 = case a1 `compare` a2 of
430− (>=) :: forall a. (Ord a) => a -> a -> Boolean
431− (>=) a1 a2 = case a1 `compare` a2 of
435− unsafeCompare :: forall a. a -> a -> Ordering
436− unsafeCompare = unsafeCompareImpl LT EQ GT
438− foreign import unsafeCompareImpl
440− function unsafeCompareImpl(lt) {
441− return function(eq) {
442− return function(gt) {
443− return function(x) {
444− return function(y) {
445− return x < y ? lt : x > y ? gt : eq;
451− """ :: forall a. Ordering -> Ordering -> Ordering -> a -> a -> Ordering
453− class (Ord a) <= Bounded a where
457− instance boundedBoolean :: Bounded Boolean where
461− instance boundedUnit :: Bounded Unit where
465− instance boundedOrdering :: Bounded Ordering where
469− class (Ord a) <= Lattice a where
473− instance latticeBoolean :: Lattice Boolean where
477− instance latticeUnit :: Lattice Unit where
484− (||) :: forall a. (Lattice a) => a -> a -> a
487− (&&) :: forall a. (Lattice a) => a -> a -> a
490− class (Bounded a, Lattice a) <= BoundedLattice a
492− instance boundedLatticeBoolean :: BoundedLattice Boolean
494− instance boundedLatticeUnit :: BoundedLattice Unit
496− class (BoundedLattice a) <= ComplementedLattice a where
499− instance complementedLatticeBoolean :: ComplementedLattice Boolean where
502− instance complementedLatticeUnit :: ComplementedLattice Unit where
505− class (Lattice a) <= DistributiveLattice a
507− instance distributiveLatticeBoolean :: DistributiveLattice Boolean
509− instance distributiveLatticeUnit :: DistributiveLattice Unit
511− class (ComplementedLattice a, DistributiveLattice a) <= BooleanAlgebra a
513− instance booleanAlgebraBoolean :: BooleanAlgebra Boolean
515− instance booleanAlgebraUnit :: BooleanAlgebra Unit
517− foreign import boolOr
519− function boolOr(b1) {
520− return function(b2) {
524− """ :: Boolean -> Boolean -> Boolean
526− foreign import boolAnd
528− function boolAnd(b1) {
529− return function(b2) {
533− """ :: Boolean -> Boolean -> Boolean
535− foreign import boolNot
537− function boolNot(b) {
540− """ :: Boolean -> Boolean
545− instance showBoolean :: Show Boolean where
547− show false = "false"
549− instance showNumber :: Show Number where
550− show = showNumberImpl
552− instance showString :: Show String where
553− show = showStringImpl
555− instance showUnit :: Show Unit where
558− instance showArray :: (Show a) => Show (Array a) where
559− show = showArrayImpl show
561− instance showOrdering :: Show Ordering where
566− foreign import showNumberImpl
568− function showNumberImpl(n) {
569− return n.toString();
571− """ :: Number -> String
573− foreign import showStringImpl
575− function showStringImpl(s) {
576− return JSON.stringify(s);
578− """ :: String -> String
580− foreign import showArrayImpl
582− function showArrayImpl(f) {
583− return function(xs) {
585− for (var i = 0, l = xs.length; i < l; i++) {
588− return '[' + ss.join(',') + ']';
591− """ :: forall a. (a -> String) -> Array a -> String
593−module Data.Function where
595− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
596− on f g x y = g x `f` g y
598− foreign import data Fn0 :: * -> *
600− foreign import data Fn1 :: * -> * -> *
602− foreign import data Fn2 :: * -> * -> * -> *
604− foreign import data Fn3 :: * -> * -> * -> * -> *
606− foreign import data Fn4 :: * -> * -> * -> * -> * -> *
608− foreign import data Fn5 :: * -> * -> * -> * -> * -> * -> *
610− foreign import data Fn6 :: * -> * -> * -> * -> * -> * -> * -> *
612− foreign import data Fn7 :: * -> * -> * -> * -> * -> * -> * -> * -> *
614− foreign import data Fn8 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> *
616− foreign import data Fn9 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
618− foreign import data Fn10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
620− foreign import mkFn0
622− function mkFn0(fn) {
627− """ :: forall a. (Unit -> a) -> Fn0 a
629− foreign import mkFn1
631− function mkFn1(fn) {
632− return function(a) {
636− """ :: forall a b. (a -> b) -> Fn1 a b
638− foreign import mkFn2
640− function mkFn2(fn) {
641− return function(a, b) {
645− """ :: forall a b c. (a -> b -> c) -> Fn2 a b c
647− foreign import mkFn3
649− function mkFn3(fn) {
650− return function(a, b, c) {
654− """ :: forall a b c d. (a -> b -> c -> d) -> Fn3 a b c d
656− foreign import mkFn4
658− function mkFn4(fn) {
659− return function(a, b, c, d) {
660− return fn(a)(b)(c)(d);
663− """ :: forall a b c d e. (a -> b -> c -> d -> e) -> Fn4 a b c d e
665− foreign import mkFn5
667− function mkFn5(fn) {
668− return function(a, b, c, d, e) {
669− return fn(a)(b)(c)(d)(e);
672− """ :: forall a b c d e f. (a -> b -> c -> d -> e -> f) -> Fn5 a b c d e f
674− foreign import mkFn6
676− function mkFn6(fn) {
677− return function(a, b, c, d, e, f) {
678− return fn(a)(b)(c)(d)(e)(f);
681− """ :: forall a b c d e f g. (a -> b -> c -> d -> e -> f -> g) -> Fn6 a b c d e f g
683− foreign import mkFn7
685− function mkFn7(fn) {
686− return function(a, b, c, d, e, f, g) {
687− return fn(a)(b)(c)(d)(e)(f)(g);
690− """ :: 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
692− foreign import mkFn8
694− function mkFn8(fn) {
695− return function(a, b, c, d, e, f, g, h) {
696− return fn(a)(b)(c)(d)(e)(f)(g)(h);
699− """ :: 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
701− foreign import mkFn9
703− function mkFn9(fn) {
704− return function(a, b, c, d, e, f, g, h, i) {
705− return fn(a)(b)(c)(d)(e)(f)(g)(h)(i);
708− """ :: 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
710− foreign import mkFn10
712− function mkFn10(fn) {
713− return function(a, b, c, d, e, f, g, h, i, j) {
714− return fn(a)(b)(c)(d)(e)(f)(g)(h)(i)(j);
717− """ :: 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
719− foreign import runFn0
721− function runFn0(fn) {
724− """ :: forall a. Fn0 a -> a
726− foreign import runFn1
728− function runFn1(fn) {
729− return function(a) {
733− """ :: forall a b. Fn1 a b -> a -> b
735− foreign import runFn2
737− function runFn2(fn) {
738− return function(a) {
739− return function(b) {
744− """ :: forall a b c. Fn2 a b c -> a -> b -> c
746− foreign import runFn3
748− function runFn3(fn) {
749− return function(a) {
750− return function(b) {
751− return function(c) {
757− """ :: forall a b c d. Fn3 a b c d -> a -> b -> c -> d
759− foreign import runFn4
761− function runFn4(fn) {
762− return function(a) {
763− return function(b) {
764− return function(c) {
765− return function(d) {
766− return fn(a, b, c, d);
772− """ :: forall a b c d e. Fn4 a b c d e -> a -> b -> c -> d -> e
774− foreign import runFn5
776− function runFn5(fn) {
777− return function(a) {
778− return function(b) {
779− return function(c) {
780− return function(d) {
781− return function(e) {
782− return fn(a, b, c, d, e);
789− """ :: forall a b c d e f. Fn5 a b c d e f -> a -> b -> c -> d -> e -> f
791− foreign import runFn6
793− function runFn6(fn) {
794− return function(a) {
795− return function(b) {
796− return function(c) {
797− return function(d) {
798− return function(e) {
799− return function(f) {
800− return fn(a, b, c, d, e, f);
808− """ :: forall a b c d e f g. Fn6 a b c d e f g -> a -> b -> c -> d -> e -> f -> g
810− foreign import runFn7
812− function runFn7(fn) {
813− return function(a) {
814− return function(b) {
815− return function(c) {
816− return function(d) {
817− return function(e) {
818− return function(f) {
819− return function(g) {
820− return fn(a, b, c, d, e, f, g);
829− """ :: 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
831− foreign import runFn8
833− function runFn8(fn) {
834− return function(a) {
835− return function(b) {
836− return function(c) {
837− return function(d) {
838− return function(e) {
839− return function(f) {
840− return function(g) {
841− return function(h) {
842− return fn(a, b, c, d, e, f, g, h);
852− """ :: 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
854− foreign import runFn9
856− function runFn9(fn) {
857− return function(a) {
858− return function(b) {
859− return function(c) {
860− return function(d) {
861− return function(e) {
862− return function(f) {
863− return function(g) {
864− return function(h) {
865− return function(i) {
866− return fn(a, b, c, d, e, f, g, h, i);
877− """ :: 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
879− foreign import runFn10
881− function runFn10(fn) {
882− return function(a) {
883− return function(b) {
884− return function(c) {
885− return function(d) {
886− return function(e) {
887− return function(f) {
888− return function(g) {
889− return function(h) {
890− return function(i) {
891− return function(j) {
892− return fn(a, b, c, d, e, f, g, h, i, j);
904− """ :: 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
906−module Prelude.Unsafe where
908− foreign import unsafeIndex
910− function unsafeIndex(xs) {
911− return function(n) {
915− """ :: forall a. Array a -> Number -> a
917−module Control.Monad.Eff
924− foreign import data Eff :: # ! -> * -> *
926− foreign import returnE
928− function returnE(a) {
933− """ :: forall e a. a -> Eff e a
935− foreign import bindE
938− return function(f) {
944− """ :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
946− type Pure a = forall e. Eff e a
948− foreign import runPure
950− function runPure(f) {
953− """ :: forall a. Pure a -> a
955− instance functorEff :: Functor (Eff e) where
958− instance applyEff :: Apply (Eff e) where
961− instance applicativeEff :: Applicative (Eff e) where
964− instance bindEff :: Bind (Eff e) where
967− instance monadEff :: Monad (Eff e)
969− foreign import untilE
971− function untilE(f) {
977− """ :: forall e. Eff e Boolean -> Eff e Unit
979− foreign import whileE
981− function whileE(f) {
982− return function(a) {
991− """ :: forall e a. Eff e Boolean -> Eff e a -> Eff e Unit
993−module Debug.Trace where
995− import Control.Monad.Eff
997− foreign import data Trace :: !
999− foreign import trace
1001− function trace(s) {
1002− return function() {
1007− """ :: forall r. String -> Eff (trace :: Trace | r) Unit
1009− print :: forall a r. (Show a) => a -> Eff (trace :: Trace | r) Unit
1010− print o = trace (show o)
1012−module Control.Monad.ST where
1014− import Control.Monad.Eff
1016− foreign import data ST :: * -> !
1018− foreign import data STRef :: * -> * -> *
1020− foreign import newSTRef
1022− function newSTRef(val) {
1023− return function() {
1024− return { value: val };
1027− """ :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
1029− foreign import readSTRef
1031− function readSTRef(ref) {
1032− return function() {
1036− """ :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
1038− foreign import modifySTRef
1040− function modifySTRef(ref) {
1041− return function(f) {
1042− return function() {
1043− return ref.value = f(ref.value);
1047− """ :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
1049− foreign import writeSTRef
1051− function writeSTRef(ref) {
1052− return function(a) {
1053− return function() {
1054− return ref.value = a;
1058− """ :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
1060− foreign import runST
1062− function runST(f) {
1065− """ :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
1067− pureST :: forall a. (forall h r. Eff (st :: ST h | r) a) -> a
1068− pureST st = runPure (runST st)