diff --git a/notebooks/IHaskell.ipynb b/notebooks/IHaskell.ipynb index 24c8c5cd..34ad0c35 100644 --- a/notebooks/IHaskell.ipynb +++ b/notebooks/IHaskell.ipynb @@ -2000,7 +2000,6 @@ "zip _|_ [] = _|_\n", "\n", "\n", - "zip ∷ [a] → [b] → [(a, b)]
\n", "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", "If one input list is short, excess elements of the longer list are\n", "discarded.\n", @@ -2054,6 +2053,16 @@ "zip [] _|_ = []\n", "\n", "
\n", + "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded.\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "
\n", + "
\n", "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", "If one input list is short, excess elements of the longer list are\n", "discarded.\n", @@ -2087,27 +2096,6 @@ "zip _|_ [] = _|_\n", "\n", "
\n", - "zip ∷ [a] → [b] → [(a, b)]
\n", - "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", - "If one input list is short, excess elements of the longer list are\n", - "discarded.\n", - "\n", - "zip is right-lazy:\n", - "\n", - "
\n",
-       "zip [] _|_ = []\n",
-       "
\n", - "
\n", - "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", - "If one input list is short, excess elements of the longer list are\n", - "discarded.\n", - "\n", - "zip is right-lazy:\n", - "\n", - "
\n",
-       "zip [] _|_ = []\n",
-       "
\n", - "
\n", "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", "\n", "
\n",
@@ -2181,6 +2169,16 @@
        "zip [] _|_ = []\n",
        "
\n", "
\n", + "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded.\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "
\n", + "
\n", "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", "\n", "
\n",
@@ -2202,6 +2200,27 @@
        "zip _|_ [] = _|_\n",
        "
\n", "
\n", + "zip ∷ () ⇒ [a] → [b] → [(a, b)]
zip takes two lists and returns a list of corresponding pairs.\n", + "\n", + "
\n",
+       "zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]\n",
+       "
\n", + "\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded:\n", + "\n", + "
\n",
+       "zip [1] ['a', 'b'] = [(1, 'a')]\n",
+       "zip [1, 2] ['a'] = [(1, 'a')]\n",
+       "
\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "zip _|_ [] = _|_\n",
+       "
\n", + "
\n", "zipLazy ∷ [a] → [b] → [(a, b)]
zipLazy is a kind of zip that is lazy in the second list\n", "(observe the ~)\n", "
\n", @@ -2220,28 +2239,6 @@ "\n", "concurrently ∷ MonadUnliftIO m ⇒ m a → m b → m (a, b)
Unlifted concurrently.\n", "
\n", - "zip ∷ Sequence s ⇒ s a → s b → s (a, b)
Combine two sequences into a sequence of pairs. If the sequences are\n", - "different lengths, the excess elements of the longer sequence is\n", - "discarded.\n", - "\n", - "
\n",
-       "zip <x0,...,xn-1> <y0,...,ym-1> = <(x0,y0),...,(xj-1,yj-1)>\n",
-       "where j = min {n,m}\n",
-       "
\n", - "\n", - "Axioms:\n", - "\n", - "\n", - "\n", - "This function is always unambiguous.\n", - "\n", - "Default running time: O( min( n1, n2 ) )\n", - "
\n", - "zipUsingLview ∷ Sequence s ⇒ s a → s b → s (a, b)
\n", - "zipUsingLists ∷ Sequence s ⇒ s a → s b → s (a, b)
\n", - "mzipRep ∷ Representable f ⇒ f a → f b → f (a, b)
\n", "concurrently ∷ MonadConc m ⇒ m a → m b → m (a, b)
Run two MonadConc actions concurrently, and return both\n", "results. If either action throws an exception at any time, then the\n", "other action is cancelled, and the exception is re-thrown by\n", @@ -2254,6 +2251,7 @@ "waitBoth a b\n", "\n", "
\n", + "mzipRep ∷ Representable f ⇒ f a → f b → f (a, b)
\n", "divided ∷ Divisible f ⇒ f a → f b → f (a, b)
\n",
        "divided = divide id\n",
        "
\n", @@ -2329,6 +2327,9 @@ "
\n", "contrazip2 ∷ Divisible f ⇒ f a1 → f a2 → f (a1, a2)
\n", "contrazip2 ∷ ∀ f a1 a2 . Divisible f ⇒ f a1 → f a2 → f (a1, a2)
\n", + "zip ∷ List l ⇒ l a → l b → l (a, b)
\n", + "pair ∷ Sized f ⇒ f a → f b → f (a, b)
Default: pair a b = (,) $ a * b.\n", + "
\n", "zip ∷ (Vector v a, Vector v b, Vector v (a, b)) ⇒ v a → v b → v (a, b)
O(min(m,n)) Zip two vectors\n", "
\n", "pair ∷ (Vector v a, Vector v b, Vector v (a, b)) ⇒ v a → v b → v (a, b)
Pair two samples. It's like zip but requires that both samples\n", @@ -2336,8 +2337,10 @@ "
\n", "zip ∷ (Vector v a, Vector v b, Vector v (a, b)) ⇒ v a → v b → v (a, b)
O(min(m,n)) Zip two vectors\n", "
\n", - "pair ∷ Sized f ⇒ f a → f b → f (a, b)
Default: pair a b = (,) $ a * b.\n", - "
\n", + "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", + "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", + "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", + "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", "(>*<) ∷ Monoidal f ⇒ f a → f b → f (a, b)
A pairing/concatenation operator for builder primitives, both bounded\n", "and fixed size.\n", "\n", @@ -2357,11 +2360,6 @@ "(>*<) ∷ Monoidal f ⇒ f a → f b → f (a, b)
Merge two functors into a tuple, analogous to liftA2\n", "(,). (Sometimes known as **.)\n", "
\n", - "zip ∷ List l ⇒ l a → l b → l (a, b)
\n", - "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", - "zip ∷ (Zip f) ⇒ f a → f b → f (a, b)
\n", - "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", - "zip ∷ Zip f ⇒ f a → f b → f (a, b)
\n", "mzip ∷ MonadZip m ⇒ m a → m b → m (a, b)
\n", "projectZip ∷ ProductIsoApplicative p ⇒ p a → p b → p (a, b)
Zipping projections.\n", "
\n", @@ -2373,15 +2371,7 @@ "
\n", "(><) ∷ ProductIsoApplicative p ⇒ p a → p b → p (a, b)
Binary operator the same as projectZip.\n", "
\n", - "biunfold ∷ (Biunfoldable t, Unfolder f) ⇒ f a → f b → f (t a b)
Given a way to generate elements, return a way to generate structures\n", - "containing those elements.\n", - "
\n", - "biunfoldBF ∷ (Biunfoldable t, Unfolder f) ⇒ f a → f b → f (t a b)
Breadth-first unfold, which orders the result by the number of\n", - "choose calls.\n", - "
\n", "deserializeWith2 ∷ (Serial2 f, MonadGet m) ⇒ m a → m b → m (f a b)
\n", - "biunfoldRestrict ∷ (BiunfoldableR predA predB t, predA a, predB b, Unfolder f) ⇒ f a → f b → f (t a b)
\n", - "biunfoldRestrictBF ∷ (BiunfoldableR p q t, Unfolder f, p a, q b) ⇒ f a → f b → f (t a b)
\n", "mesh ∷ Graph g ⇒ [a] → [b] → g (a, b)
Construct a mesh graph from two lists of vertices. Complexity:\n", "O(L1 * L2) time, memory and size, where L1 and L2\n", "are the lengths of the given lists.\n", @@ -2651,9 +2641,6 @@ "zip _|_ [] = _|_\n", "\n", "\n", - "zip :: [a] -> [b] -> [(a, b)]\n", - "URL: https://hackage.haskell.org/package/fay-base/docs/Prelude.html#v:zip\n", - "\n", "zip :: () => [a] -> [b] -> [(a, b)]\n", "URL: https://hackage.haskell.org/package/rebase/docs/Rebase-Prelude.html#v:zip\n", "zip takes two lists and returns a list of corresponding pairs.\n", @@ -2718,6 +2705,18 @@ "\n", "\n", "zip :: () => [a] -> [b] -> [(a, b)]\n", + "URL: https://hackage.haskell.org/package/xmonad-contrib/docs/XMonad-Config-Prime.html#v:zip\n", + "zip takes two lists and returns a list of corresponding pairs.\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded.\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "
\n", + "\n", + "zip :: () => [a] -> [b] -> [(a, b)]\n", "URL: https://hackage.haskell.org/package/haxl/docs/Haxl-Prelude.html#v:zip\n", "zip takes two lists and returns a list of corresponding pairs.\n", "If one input list is short, excess elements of the longer list are\n", @@ -2758,33 +2757,6 @@ "zip _|_ [] = _|_\n", "\n", "\n", - "zip :: [a] -> [b] -> [(a, b)]\n", - "URL: https://hackage.haskell.org/package/EdisonAPI/docs/Data-Edison-Seq-ListSeq.html#v:zip\n", - "\n", - "zip :: () => [a] -> [b] -> [(a, b)]\n", - "URL: https://hackage.haskell.org/package/LambdaHack/docs/Game-LambdaHack-Common-Prelude.html#v:zip\n", - "zip takes two lists and returns a list of corresponding pairs.\n", - "If one input list is short, excess elements of the longer list are\n", - "discarded.\n", - "\n", - "zip is right-lazy:\n", - "\n", - "
\n",
-       "zip [] _|_ = []\n",
-       "
\n", - "\n", - "zip :: () => [a] -> [b] -> [(a, b)]\n", - "URL: https://hackage.haskell.org/package/LambdaHack/docs/Game-LambdaHack-Common-Prelude.html#v:zip\n", - "zip takes two lists and returns a list of corresponding pairs.\n", - "If one input list is short, excess elements of the longer list are\n", - "discarded.\n", - "\n", - "zip is right-lazy:\n", - "\n", - "
\n",
-       "zip [] _|_ = []\n",
-       "
\n", - "\n", "zip :: () => [a] -> [b] -> [(a, b)]\n", "URL: https://hackage.haskell.org/package/mixed-types-num/docs/Numeric-MixedTypes-PreludeHiding.html#v:zip\n", "zip takes two lists and returns a list of corresponding pairs.\n", @@ -2867,6 +2839,18 @@ "\n", "\n", "zip :: () => [a] -> [b] -> [(a, b)]\n", + "URL: https://hackage.haskell.org/package/distribution-opensuse/docs/OpenSuse-Prelude.html#v:zip\n", + "zip takes two lists and returns a list of corresponding pairs.\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded.\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "
\n", + "\n", + "zip :: () => [a] -> [b] -> [(a, b)]\n", "URL: https://hackage.haskell.org/package/hledger-web/docs/Hledger-Web-Import.html#v:zip\n", "zip takes two lists and returns a list of corresponding pairs.\n", "\n", @@ -2889,6 +2873,29 @@ "zip _|_ [] = _|_\n", "\n", "\n", + "zip :: () => [a] -> [b] -> [(a, b)]\n", + "URL: https://hackage.haskell.org/package/hsdev/docs/HsDev-Tools-Ghc-Prelude.html#v:zip\n", + "zip takes two lists and returns a list of corresponding pairs.\n", + "\n", + "
\n",
+       "zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]\n",
+       "
\n", + "\n", + "If one input list is short, excess elements of the longer list are\n", + "discarded:\n", + "\n", + "
\n",
+       "zip [1] ['a', 'b'] = [(1, 'a')]\n",
+       "zip [1, 2] ['a'] = [(1, 'a')]\n",
+       "
\n", + "\n", + "zip is right-lazy:\n", + "\n", + "
\n",
+       "zip [] _|_ = []\n",
+       "zip _|_ [] = _|_\n",
+       "
\n", + "\n", "zipLazy :: [a] -> [b] -> [(a, b)]\n", "URL: https://hackage.haskell.org/package/ghc/docs/Util.html#v:zipLazy\n", "zipLazy is a kind of zip that is lazy in the second list\n", @@ -2923,36 +2930,6 @@ "URL: https://hackage.haskell.org/package/yesod-websockets/docs/Yesod-WebSockets.html#v:concurrently\n", "Unlifted concurrently.\n", "\n", - "zip :: Sequence s => s a -> s b -> s (a, b)\n", - "URL: https://hackage.haskell.org/package/EdisonAPI/docs/Data-Edison-Seq.html#v:zip\n", - "Combine two sequences into a sequence of pairs. If the sequences are\n", - "different lengths, the excess elements of the longer sequence is\n", - "discarded.\n", - "\n", - "
\n",
-       "zip <x0,...,xn-1> <y0,...,ym-1> = <(x0,y0),...,(xj-1,yj-1)>\n",
-       "where j = min {n,m}\n",
-       "
\n", - "\n", - "Axioms:\n", - "\n", - "\n", - "\n", - "This function is always unambiguous.\n", - "\n", - "Default running time: O( min( n1, n2 ) )\n", - "\n", - "zipUsingLview :: Sequence s => s a -> s b -> s (a, b)\n", - "URL: https://hackage.haskell.org/package/EdisonCore/docs/Data-Edison-Seq-Defaults.html#v:zipUsingLview\n", - "\n", - "zipUsingLists :: Sequence s => s a -> s b -> s (a, b)\n", - "URL: https://hackage.haskell.org/package/EdisonCore/docs/Data-Edison-Seq-Defaults.html#v:zipUsingLists\n", - "\n", - "mzipRep :: Representable f => f a -> f b -> f (a, b)\n", - "URL: https://hackage.haskell.org/package/adjunctions/docs/Data-Functor-Rep.html#v:mzipRep\n", - "\n", "concurrently :: MonadConc m => m a -> m b -> m (a, b)\n", "URL: https://hackage.haskell.org/package/concurrency/docs/Control-Concurrent-Classy-Async.html#v:concurrently\n", "Run two MonadConc actions concurrently, and return both\n", @@ -2967,6 +2944,9 @@ "waitBoth a b\n", "\n", "\n", + "mzipRep :: Representable f => f a -> f b -> f (a, b)\n", + "URL: https://hackage.haskell.org/package/adjunctions/docs/Data-Functor-Rep.html#v:mzipRep\n", + "\n", "divided :: Divisible f => f a -> f b -> f (a, b)\n", "URL: https://hackage.haskell.org/package/contravariant/docs/Data-Functor-Contravariant-Divisible.html#v:divided\n", "
\n",
@@ -3056,6 +3036,13 @@
        "contrazip2 :: forall f a1 a2 . Divisible f => f a1 -> f a2 -> f (a1, a2)\n",
        "URL: https://hackage.haskell.org/package/contravariant-extras/docs/Contravariant-Extras-Contrazip.html#v:contrazip2\n",
        "\n",
+       "zip :: List l => l a -> l b -> l (a, b)\n",
+       "URL: https://hackage.haskell.org/package/List/docs/Data-List-Class.html#v:zip\n",
+       "\n",
+       "pair :: Sized f => f a -> f b -> f (a, b)\n",
+       "URL: https://hackage.haskell.org/package/size-based/docs/Control-Sized.html#v:pair\n",
+       "Default: pair a b = (,) $ a * b.\n",
+       "\n",
        "zip :: (Vector v a, Vector v b, Vector v (a, b)) => v a -> v b -> v (a, b)\n",
        "URL: https://hackage.haskell.org/package/vector/docs/Data-Vector-Generic.html#v:zip\n",
        "O(min(m,n)) Zip two vectors\n",
@@ -3069,9 +3056,17 @@
        "URL: https://hackage.haskell.org/package/rio/docs/RIO-Vector.html#v:zip\n",
        "O(min(m,n)) Zip two vectors\n",
        "\n",
-       "pair :: Sized f => f a -> f b -> f (a, b)\n",
-       "URL: https://hackage.haskell.org/package/size-based/docs/Control-Sized.html#v:pair\n",
-       "Default: pair a b = (,) $ a * b.\n",
+       "zip :: Zip f => f a -> f b -> f (a, b)\n",
+       "URL: https://hackage.haskell.org/package/classy-prelude/docs/ClassyPrelude.html#v:zip\n",
+       "\n",
+       "zip :: Zip f => f a -> f b -> f (a, b)\n",
+       "URL: https://hackage.haskell.org/package/non-empty/docs/Data-NonEmpty-Class.html#v:zip\n",
+       "\n",
+       "zip :: Zip f => f a -> f b -> f (a, b)\n",
+       "URL: https://hackage.haskell.org/package/keys/docs/Data-Key.html#v:zip\n",
+       "\n",
+       "zip :: Zip f => f a -> f b -> f (a, b)\n",
+       "URL: https://hackage.haskell.org/package/chunked-data/docs/Data-ChunkedZip.html#v:zip\n",
        "\n",
        "(>*<) :: Monoidal f => f a -> f b -> f (a, b)\n",
        "URL: https://hackage.haskell.org/package/bytestring/docs/Data-ByteString-Builder-Prim.html#v:-62--42--60-\n",
@@ -3096,21 +3091,6 @@
        "Merge two functors into a tuple, analogous to liftA2\n",
        "(,). (Sometimes known as **.)\n",
        "\n",
-       "zip :: List l => l a -> l b -> l (a, b)\n",
-       "URL: https://hackage.haskell.org/package/List/docs/Data-List-Class.html#v:zip\n",
-       "\n",
-       "zip :: Zip f => f a -> f b -> f (a, b)\n",
-       "URL: https://hackage.haskell.org/package/classy-prelude/docs/ClassyPrelude.html#v:zip\n",
-       "\n",
-       "zip :: (Zip f) => f a -> f b -> f (a, b)\n",
-       "URL: https://hackage.haskell.org/package/non-empty/docs/Data-NonEmpty-Class.html#v:zip\n",
-       "\n",
-       "zip :: Zip f => f a -> f b -> f (a, b)\n",
-       "URL: https://hackage.haskell.org/package/keys/docs/Data-Key.html#v:zip\n",
-       "\n",
-       "zip :: Zip f => f a -> f b -> f (a, b)\n",
-       "URL: https://hackage.haskell.org/package/chunked-data/docs/Data-ChunkedZip.html#v:zip\n",
-       "\n",
        "mzip :: MonadZip m => m a -> m b -> m (a, b)\n",
        "URL: https://hackage.haskell.org/package/base/docs/Control-Monad-Zip.html#v:mzip\n",
        "\n",
@@ -3134,25 +3114,9 @@
        "URL: https://hackage.haskell.org/package/relational-record/docs/Database-Relational-Documentation.html#v:-62--60-\n",
        "Binary operator the same as projectZip.\n",
        "\n",
-       "biunfold :: (Biunfoldable t, Unfolder f) => f a -> f b -> f (t a b)\n",
-       "URL: https://hackage.haskell.org/package/unfoldable/docs/Data-Biunfoldable.html#v:biunfold\n",
-       "Given a way to generate elements, return a way to generate structures\n",
-       "containing those elements.\n",
-       "\n",
-       "biunfoldBF :: (Biunfoldable t, Unfolder f) => f a -> f b -> f (t a b)\n",
-       "URL: https://hackage.haskell.org/package/unfoldable/docs/Data-Biunfoldable.html#v:biunfoldBF\n",
-       "Breadth-first unfold, which orders the result by the number of\n",
-       "choose calls.\n",
-       "\n",
        "deserializeWith2 :: (Serial2 f, MonadGet m) => m a -> m b -> m (f a b)\n",
        "URL: https://hackage.haskell.org/package/bytes/docs/Data-Bytes-Serial.html#v:deserializeWith2\n",
        "\n",
-       "biunfoldRestrict :: (BiunfoldableR predA predB t, predA a, predB b, Unfolder f) => f a -> f b -> f (t a b)\n",
-       "URL: https://hackage.haskell.org/package/unfoldable-restricted/docs/Data-Unfoldable-Restricted.html#v:biunfoldRestrict\n",
-       "\n",
-       "biunfoldRestrictBF :: (BiunfoldableR p q t, Unfolder f, p a, q b) => f a -> f b -> f (t a b)\n",
-       "URL: https://hackage.haskell.org/package/unfoldable-restricted/docs/Data-Unfoldable-Restricted.html#v:biunfoldRestrictBF\n",
-       "\n",
        "mesh :: Graph g => [a] -> [b] -> g (a, b)\n",
        "URL: https://hackage.haskell.org/package/algebraic-graphs/docs/Algebra-Graph-HigherKinded-Class.html#v:mesh\n",
        "Construct a mesh graph from two lists of vertices. Complexity:\n",