|
<html xmlns="http://www.w3.org/1999/xhtml"
><head
><link rel="stylesheet" type="text/css" href="style.css"
/><script type="text/javascript" src="highlight.js"
></script
></head
><body
><pre
><span class="hs-pragma"
>{-# LANGUAGE Haskell2010 #-}</span
><span
>
</span
><span id="line-2"
></span
><span class="hs-pragma"
>{-# LANGUAGE RankNTypes #-}</span
><span
>
</span
><span id="line-3"
></span
><span class="hs-pragma"
>{-# LANGUAGE ScopedTypeVariables #-}</span
><span
>
</span
><span id="line-4"
></span
><span
>
</span
><span id="line-5"
></span
><span
>
</span
><span id="line-6"
></span
><span class="hs-keyword"
>module</span
><span
> </span
><span class="hs-identifier"
>Polymorphism</span
><span
> </span
><span class="hs-keyword"
>where</span
><span
>
</span
><span id="line-7"
></span
><span
>
</span
><span id="line-8"
></span
><span
>
</span
><span id="line-9"
></span
><span id=""
><span class="annot"
><a href="Polymorphism.html#foo"
><span class="hs-identifier hs-type"
>foo</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
>
</span
><span id="line-10"
></span
><span id="foo"
><span class="annot"
><span class="annottext"
>foo :: forall a. a -> a -> a
</span
><a href="Polymorphism.html#foo"
><span class="hs-identifier hs-var hs-var"
>foo</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a -> a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-11"
></span
><span
>
</span
><span id="line-12"
></span
><span class="annot"
><a href="Polymorphism.html#foo%27"
><span class="hs-identifier hs-type"
>foo'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-13"
></span
><span id="foo%27"
><span class="annot"
><span class="annottext"
>foo' :: forall a. a -> a -> a
</span
><a href="Polymorphism.html#foo%27"
><span class="hs-identifier hs-var hs-var"
>foo'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a -> a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-14"
></span
><span
>
</span
><span id="line-15"
></span
><span id=""
><span id=""
><span class="annot"
><a href="Polymorphism.html#bar"
><span class="hs-identifier hs-type"
>bar</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
></span
></span
><span
>
</span
><span id="line-16"
></span
><span id="bar"
><span class="annot"
><span class="annottext"
>bar :: forall a b. a -> b -> (a, b)
</span
><a href="Polymorphism.html#bar"
><span class="hs-identifier hs-var hs-var"
>bar</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> b -> (a, b)
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-17"
></span
><span
>
</span
><span id="line-18"
></span
><span class="annot"
><a href="Polymorphism.html#bar%27"
><span class="hs-identifier hs-type"
>bar'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
>
</span
><span id="line-19"
></span
><span id="bar%27"
><span class="annot"
><span class="annottext"
>bar' :: forall a b. a -> b -> (a, b)
</span
><a href="Polymorphism.html#bar%27"
><span class="hs-identifier hs-var hs-var"
>bar'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> b -> (a, b)
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-20"
></span
><span
>
</span
><span id="line-21"
></span
><span id=""
><span id=""
><span class="annot"
><a href="Polymorphism.html#baz"
><span class="hs-identifier hs-type"
>baz</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
></span
></span
><span
>
</span
><span id="line-22"
></span
><span id="baz"
><span class="annot"
><span class="annottext"
>baz :: forall a b. a -> (a -> [a -> a] -> b) -> b
</span
><a href="Polymorphism.html#baz"
><span class="hs-identifier hs-var hs-var"
>baz</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> (a -> [a -> a] -> b) -> b
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-23"
></span
><span
>
</span
><span id="line-24"
></span
><span class="annot"
><a href="Polymorphism.html#baz%27"
><span class="hs-identifier hs-type"
>baz'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span
>
</span
><span id="line-25"
></span
><span id="baz%27"
><span class="annot"
><span class="annottext"
>baz' :: forall a b. a -> (a -> [a -> a] -> b) -> b
</span
><a href="Polymorphism.html#baz%27"
><span class="hs-identifier hs-var hs-var"
>baz'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> (a -> [a -> a] -> b) -> b
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-26"
></span
><span
>
</span
><span id="line-27"
></span
><span id=""
><span class="annot"
><a href="Polymorphism.html#quux"
><span class="hs-identifier hs-type"
>quux</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
>
</span
><span id="line-28"
></span
><span id="quux"
><span class="annot"
><span class="annottext"
>quux :: forall a. a -> (forall a. a -> a) -> a
</span
><a href="Polymorphism.html#quux"
><span class="hs-identifier hs-var hs-var"
>quux</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>forall a. a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a
forall a. a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
>
</span
><span id="line-29"
></span
><span
>
</span
><span id="line-30"
></span
><span class="annot"
><a href="Polymorphism.html#quux%27"
><span class="hs-identifier hs-type"
>quux'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-31"
></span
><span id="quux%27"
><span class="annot"
><span class="annottext"
>quux' :: forall a. a -> (forall a. a -> a) -> a
</span
><a href="Polymorphism.html#quux%27"
><span class="hs-identifier hs-var hs-var"
>quux'</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>forall a. a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a
forall a. a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
>
</span
><span id="line-32"
></span
><span
>
</span
><span id="line-33"
></span
><span
>
</span
><span id="line-34"
></span
><span id=""
><span class="annot"
><a href="Polymorphism.html#num"
><span class="hs-identifier hs-type"
>num</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Num</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
>
</span
><span id="line-35"
></span
><span id="num"
><span class="annot"
><span class="annottext"
>num :: forall a. Num a => a -> a -> a
</span
><a href="Polymorphism.html#num"
><span class="hs-identifier hs-var hs-var"
>num</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a -> a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-36"
></span
><span
>
</span
><span id="line-37"
></span
><span class="annot"
><a href="Polymorphism.html#num%27"
><span class="hs-identifier hs-type"
>num'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Num</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-38"
></span
><span id="num%27"
><span class="annot"
><span class="annottext"
>num' :: forall a. Num a => a -> a -> a
</span
><a href="Polymorphism.html#num%27"
><span class="hs-identifier hs-var hs-var"
>num'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a -> a -> a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-39"
></span
><span
>
</span
><span id="line-40"
></span
><span id=""
><span id=""
><span class="annot"
><a href="Polymorphism.html#eq"
><span class="hs-identifier hs-type"
>eq</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="hs-identifier hs-type"
>Eq</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Eq</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
></span
></span
><span
>
</span
><span id="line-41"
></span
><span id="eq"
><span class="annot"
><span class="annottext"
>eq :: forall a b. (Eq a, Eq b) => [a] -> [b] -> (a, b)
</span
><a href="Polymorphism.html#eq"
><span class="hs-identifier hs-var hs-var"
>eq</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[a] -> [b] -> (a, b)
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-42"
></span
><span
>
</span
><span id="line-43"
></span
><span class="annot"
><a href="Polymorphism.html#eq%27"
><span class="hs-identifier hs-type"
>eq'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="hs-identifier hs-type"
>Eq</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Eq</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>]</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
>
</span
><span id="line-44"
></span
><span id="eq%27"
><span class="annot"
><span class="annottext"
>eq' :: forall a b. (Eq a, Eq b) => [a] -> [b] -> (a, b)
</span
><a href="Polymorphism.html#eq%27"
><span class="hs-identifier hs-var hs-var"
>eq'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[a] -> [b] -> (a, b)
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-45"
></span
><span
>
</span
><span id="line-46"
></span
><span id=""
><span id=""
><span class="annot"
><a href="Polymorphism.html#mon"
><span class="hs-identifier hs-type"
>mon</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Monad</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
></span
><span
>
</span
><span id="line-47"
></span
><span id="mon"
><span class="annot"
><span class="annottext"
>mon :: forall (m :: * -> *) a. Monad m => (a -> m a) -> m a
</span
><a href="Polymorphism.html#mon"
><span class="hs-identifier hs-var hs-var"
>mon</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>(a -> m a) -> m a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-48"
></span
><span
>
</span
><span id="line-49"
></span
><span class="annot"
><a href="Polymorphism.html#mon%27"
><span class="hs-identifier hs-type"
>mon'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Monad</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>m</span
></a
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-50"
></span
><span id="mon%27"
><span class="annot"
><span class="annottext"
>mon' :: forall (m :: * -> *) a. Monad m => (a -> m a) -> m a
</span
><a href="Polymorphism.html#mon%27"
><span class="hs-identifier hs-var hs-var"
>mon'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>(a -> m a) -> m a
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-51"
></span
><span
>
</span
><span id="line-52"
></span
><span
>
</span
><span id="line-53"
></span
><span id=""
><span class="annot"
><a href="Polymorphism.html#norf"
><span class="hs-identifier hs-type"
>norf</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Ord</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
>
</span
><span id="line-54"
></span
><span id="norf"
><span class="annot"
><span class="annottext"
>norf :: forall a. a -> (forall a. Ord a => a -> a) -> a
</span
><a href="Polymorphism.html#norf"
><span class="hs-identifier hs-var hs-var"
>norf</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>forall a. Ord a => a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
>
</span
><span id="line-55"
></span
><span
>
</span
><span id="line-56"
></span
><span class="annot"
><a href="Polymorphism.html#norf%27"
><span class="hs-identifier hs-type"
>norf'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Ord</span
></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-57"
></span
><span id="norf%27"
><span class="annot"
><span class="annottext"
>norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a
</span
><a href="Polymorphism.html#norf%27"
><span class="hs-identifier hs-var hs-var"
>norf'</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>forall a. Ord a => a -> a
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
>
</span
><span id="line-58"
></span
><span
>
</span
><span id="line-59"
></span
><span
>
</span
><span id="line-60"
></span
><span class="annot"
><a href="Polymorphism.html#plugh"
><span class="hs-identifier hs-type"
>plugh</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-61"
></span
><span id="plugh"
><span class="annot"
><span class="annottext"
>plugh :: forall a. a -> a
</span
><a href="Polymorphism.html#plugh"
><span class="hs-identifier hs-var hs-var"
>plugh</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
>
</span
><span id="line-62"
></span
><span
>
</span
><span id="line-63"
></span
><span class="annot"
><a href="Polymorphism.html#thud"
><span class="hs-identifier hs-type"
>thud</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-keyword"
>forall</span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
></span
><span class="hs-operator"
>.</span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
>
</span
><span id="line-64"
></span
><span id="thud"
><span class="annot"
><span class="annottext"
>thud :: forall a b. (a -> b) -> a -> (a, b)
</span
><a href="Polymorphism.html#thud"
><span class="hs-identifier hs-var hs-var"
>thud</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a -> b
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
>
</span
><span id="line-65"
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="annottext"
>b
</span
><a href="#"
><span class="hs-identifier hs-var"
>y</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
>
</span
><span id="line-66"
></span
><span
> </span
><span class="hs-keyword"
>where</span
><span
>
</span
><span id="line-67"
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>y :: b
</span
><a href="#"
><span class="hs-identifier hs-var hs-var"
>y</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="annottext"
>a -> b
</span
><a href="#"
><span class="hs-identifier hs-var"
>f</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>a</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="annot"
><span class="annottext"
>a
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="#"
><span class="hs-identifier hs-type"
>b</span
></a
></span
><span
>
</span
><span id="line-68"
></span
></pre
></body
></html
>
|