blob: 2cc234ac5e63b3f9c8301bc28d8a46e7b75e674b (
plain) (
tree)
|
|
<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-keyword"
>module</span
><span
> </span
><span class="hs-identifier"
>Constructors</span
><span
> </span
><span class="hs-keyword"
>where</span
><span
>
</span
><span id="line-2"
></span
><span
>
</span
><span id="line-3"
></span
><span
>
</span
><span id="line-4"
></span
><span class="hs-keyword"
>data</span
><span
> </span
><span id="Foo"
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-var"
>Foo</span
></a
></span
></span
><span
>
</span
><span id="line-5"
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span id="Bar"
><span class="annot"
><a href="Constructors.html#Bar"
><span class="hs-identifier hs-var"
>Bar</span
></a
></span
></span
><span
>
</span
><span id="line-6"
></span
><span
> </span
><span class="hs-glyph"
>|</span
><span
> </span
><span id="Baz"
><span class="annot"
><a href="Constructors.html#Baz"
><span class="hs-identifier hs-var"
>Baz</span
></a
></span
></span
><span
>
</span
><span id="line-7"
></span
><span
> </span
><span class="hs-glyph"
>|</span
><span
> </span
><span id="Quux"
><span class="annot"
><a href="Constructors.html#Quux"
><span class="hs-identifier hs-var"
>Quux</span
></a
></span
></span
><span
> </span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Int</span
></span
><span
>
</span
><span id="line-8"
></span
><span
>
</span
><span id="line-9"
></span
><span class="hs-keyword"
>newtype</span
><span
> </span
><span id="Norf"
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-var"
>Norf</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span id="Norf"
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-var"
>Norf</span
></a
></span
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span class="hs-special"
>]</span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span class="hs-special"
>)</span
><span
>
</span
><span id="line-10"
></span
><span
>
</span
><span id="line-11"
></span
><span
>
</span
><span id="line-12"
></span
><span class="annot"
><a href="Constructors.html#bar"
><span class="hs-identifier hs-type"
>bar</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="Constructors.html#baz"
><span class="hs-identifier hs-type"
>baz</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><a href="Constructors.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="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span
>
</span
><span id="line-13"
></span
><span id="bar"
><span class="annot"
><span class="annottext"
>bar :: Foo
</span
><a href="Constructors.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"
>Foo
</span
><a href="Constructors.html#Bar"
><span class="hs-identifier hs-var"
>Bar</span
></a
></span
><span
>
</span
><span id="line-14"
></span
><span id="baz"
><span class="annot"
><span class="annottext"
>baz :: Foo
</span
><a href="Constructors.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"
>Foo
</span
><a href="Constructors.html#Baz"
><span class="hs-identifier hs-var"
>Baz</span
></a
></span
><span
>
</span
><span id="line-15"
></span
><span id="quux"
><span class="annot"
><span class="annottext"
>quux :: Foo
</span
><a href="Constructors.html#quux"
><span class="hs-identifier hs-var hs-var"
>quux</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int -> Foo
</span
><a href="Constructors.html#Quux"
><span class="hs-identifier hs-var"
>Quux</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#quux"
><span class="hs-identifier hs-var"
>quux</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><span class="hs-number"
>0</span
></span
><span
>
</span
><span id="line-16"
></span
><span
>
</span
><span id="line-17"
></span
><span
>
</span
><span id="line-18"
></span
><span class="annot"
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-type"
>unfoo</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Int</span
></span
><span
>
</span
><span id="line-19"
></span
><span id="unfoo"
><span class="annot"
><span class="annottext"
>unfoo :: Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var hs-var"
>unfoo</span
></a
></span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Bar"
><span class="hs-identifier hs-var"
>Bar</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><span class="hs-number"
>0</span
></span
><span
>
</span
><span id="line-20"
></span
><span class="annot"
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Baz"
><span class="hs-identifier hs-var"
>Baz</span
></a
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><span class="hs-number"
>0</span
></span
><span
>
</span
><span id="line-21"
></span
><span class="annot"
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Quux"
><span class="hs-identifier hs-type"
>Quux</span
></a
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>foo</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>n</span
></a
></span
></span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><span class="hs-number"
>42</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>*</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>n</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>+</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>foo</span
></a
></span
><span
>
</span
><span id="line-22"
></span
><span
>
</span
><span id="line-23"
></span
><span
>
</span
><span id="line-24"
></span
><span class="annot"
><a href="Constructors.html#unnorf"
><span class="hs-identifier hs-type"
>unnorf</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-type"
>Norf</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="hs-special"
>[</span
><span class="annot"
><a href="Constructors.html#Foo"
><span class="hs-identifier hs-type"
>Foo</span
></a
></span
><span class="hs-special"
>]</span
><span
>
</span
><span id="line-25"
></span
><span id="unnorf"
><span class="annot"
><span class="annottext"
>unnorf :: Norf -> [Foo]
</span
><a href="Constructors.html#unnorf"
><span class="hs-identifier hs-var hs-var"
>unnorf</span
></a
></span
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-type"
>Norf</span
></a
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Bar"
><span class="hs-identifier hs-var"
>Bar</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>[Foo]
</span
><a href="#"
><span class="hs-identifier hs-var"
>xs</span
></a
></span
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Bar"
><span class="hs-identifier hs-var"
>Bar</span
></a
></span
><span class="hs-special"
>)</span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[Foo]
</span
><a href="#"
><span class="hs-identifier hs-var"
>xs</span
></a
></span
><span
>
</span
><span id="line-26"
></span
><span class="annot"
><a href="Constructors.html#unnorf"
><span class="hs-identifier hs-var"
>unnorf</span
></a
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-type"
>Norf</span
></a
></span
><span
> </span
><span class="hs-special"
>(</span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Baz"
><span class="hs-identifier hs-var"
>Baz</span
></a
></span
><span class="hs-special"
>,</span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>[Foo]
</span
><a href="#"
><span class="hs-identifier hs-var"
>xs</span
></a
></span
></span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="Constructors.html#Baz"
><span class="hs-identifier hs-var"
>Baz</span
></a
></span
><span class="hs-special"
>)</span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[Foo] -> [Foo]
forall a. [a] -> [a]
</span
><span class="hs-identifier hs-var"
>reverse</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>[Foo]
</span
><a href="#"
><span class="hs-identifier hs-var"
>xs</span
></a
></span
><span
>
</span
><span id="line-27"
></span
><span class="annot"
><a href="Constructors.html#unnorf"
><span class="hs-identifier hs-var"
>unnorf</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Norf
</span
><span class="hs-identifier"
>_</span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[Foo]
forall a. HasCallStack => a
</span
><span class="hs-identifier hs-var"
>undefined</span
></span
><span
>
</span
><span id="line-28"
></span
><span
>
</span
><span id="line-29"
></span
><span
>
</span
><span id="line-30"
></span
><span class="annot"
><a href="Constructors.html#unnorf%27"
><span class="hs-identifier hs-type"
>unnorf'</span
></a
></span
><span
> </span
><span class="hs-glyph"
>::</span
><span
> </span
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-type"
>Norf</span
></a
></span
><span
> </span
><span class="hs-glyph"
>-></span
><span
> </span
><span class="annot"
><span class="hs-identifier hs-type"
>Int</span
></span
><span
>
</span
><span id="line-31"
></span
><span id="unnorf%27"
><span class="annot"
><span class="annottext"
>unnorf' :: Norf -> Int
</span
><a href="Constructors.html#unnorf%27"
><span class="hs-identifier hs-var hs-var"
>unnorf'</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>x :: Norf
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
></span
><span class="hs-glyph"
>@</span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Norf"
><span class="hs-identifier hs-type"
>Norf</span
></a
></span
><span
> </span
><span class="hs-special"
>(</span
><span id=""
><span class="annot"
><span class="annottext"
>f1 :: Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f1</span
></a
></span
></span
><span class="hs-glyph"
>@</span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Quux"
><span class="hs-identifier hs-type"
>Quux</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><span class="hs-identifier"
>_</span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>n</span
></a
></span
></span
><span class="hs-special"
>)</span
><span class="hs-special"
>,</span
><span
> </span
><span class="annot"
><span class="annottext"
>[Foo]
</span
><span class="hs-identifier"
>_</span
></span
><span class="hs-special"
>,</span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>f2 :: Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f2</span
></a
></span
></span
><span class="hs-glyph"
>@</span
><span class="hs-special"
>(</span
><span class="annot"
><a href="Constructors.html#Quux"
><span class="hs-identifier hs-type"
>Quux</span
></a
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f3</span
></a
></span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><span class="hs-identifier"
>_</span
></span
><span class="hs-special"
>)</span
><span class="hs-special"
>)</span
><span class="hs-special"
>)</span
><span
> </span
><span class="hs-glyph"
>=</span
><span
>
</span
><span id="line-32"
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>x'</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>+</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>n</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>*</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f1</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>+</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="#"
><span class="hs-identifier hs-var"
>aux</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f3</span
></a
></span
><span
>
</span
><span id="line-33"
></span
><span
> </span
><span class="hs-keyword"
>where</span
><span
>
</span
><span id="line-34"
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>aux :: Foo -> Int
</span
><a href="#"
><span class="hs-identifier hs-var hs-var"
>aux</span
></a
></span
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>fx</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f2</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>*</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>fx</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Int -> Int -> Int
forall a. Num a => a -> a -> a
</span
><span class="hs-operator hs-var"
>*</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo
</span
><a href="#"
><span class="hs-identifier hs-var"
>f3</span
></a
></span
><span
>
</span
><span id="line-35"
></span
><span
> </span
><span id=""
><span class="annot"
><span class="annottext"
>x' :: Int
</span
><a href="#"
><span class="hs-identifier hs-var hs-var"
>x'</span
></a
></span
></span
><span
> </span
><span class="hs-glyph"
>=</span
><span
> </span
><span class="annot"
><span class="annottext"
>[Int] -> Int
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
</span
><span class="hs-identifier hs-var"
>sum</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>([Int] -> Int) -> (Norf -> [Int]) -> Norf -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
</span
><span class="hs-operator hs-var"
>.</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>(Foo -> Int) -> [Foo] -> [Int]
forall a b. (a -> b) -> [a] -> [b]
</span
><span class="hs-identifier hs-var"
>map</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Foo -> Int
</span
><a href="Constructors.html#unfoo"
><span class="hs-identifier hs-var"
>unfoo</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>([Foo] -> [Int]) -> (Norf -> [Foo]) -> Norf -> [Int]
forall b c a. (b -> c) -> (a -> b) -> a -> c
</span
><span class="hs-operator hs-var"
>.</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Norf -> [Foo]
</span
><a href="Constructors.html#unnorf"
><span class="hs-identifier hs-var"
>unnorf</span
></a
></span
><span
> </span
><span class="annot"
><span class="annottext"
>(Norf -> Int) -> Norf -> Int
forall a b. (a -> b) -> a -> b
</span
><span class="hs-operator hs-var"
>$</span
></span
><span
> </span
><span class="annot"
><span class="annottext"
>Norf
</span
><a href="#"
><span class="hs-identifier hs-var"
>x</span
></a
></span
><span
>
</span
><span id="line-36"
></span
></pre
></body
></html
>
|