<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--Rendered using the Haskell Html Library v0.2--> <HTML ><HEAD ><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" ><TITLE >ForSyDe.Shallow.Vector</TITLE ><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css" ><SCRIPT SRC="haddock-util.js" TYPE="text/javascript" ></SCRIPT ><SCRIPT TYPE="text/javascript" >window.onload = function () {setSynopsis("mini_ForSyDe-Shallow-Vector.html")};</SCRIPT ></HEAD ><BODY ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="topbar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" " ></TD ><TD CLASS="title" >ForSyDe-3.1.1: ForSyDe's Haskell-embedded Domain Specific Language.</TD ><TD CLASS="topbut" ><A HREF="src/ForSyDe-Shallow-Vector.html" >Source code</A ></TD ><TD CLASS="topbut" ><A HREF="index.html" >Contents</A ></TD ><TD CLASS="topbut" ><A HREF="doc-index.html" >Index</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="modulebar" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD ><FONT SIZE="6" >ForSyDe.Shallow.Vector</FONT ></TD ><TD ALIGN="right" ><TABLE CLASS="narrow" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="infohead" >Portability</TD ><TD CLASS="infoval" >portable</TD ></TR ><TR ><TD CLASS="infohead" >Stability</TD ><TD CLASS="infoval" >experimental</TD ></TR ><TR ><TD CLASS="infohead" >Maintainer</TD ><TD CLASS="infoval" >forsyde-dev@ict.kth.se</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Description</TD ></TR ><TR ><TD CLASS="doc" >This module defines the data type <TT ><A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A ></TT > and the corresponding functions. It is a development of the module defined by Reekie. Though the vector is modeled as a list, it should be viewed as an array, i.e. a vector has a fixed size. Unfortunately, it is not possible to have the size of the vector as a parameter of the vector data type, due to restrictions in Haskells type system. Still most operations are defined for vectors with the same size. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Synopsis</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" ><SPAN CLASS="keyword" >data</SPAN > <A HREF="#t%3AVector" >Vector</A > a </TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="decl" >= <A HREF="#v%3ANullV" >NullV</A ></TD ></TR ><TR ><TD CLASS="decl" >| a <A HREF="#v%3A%3A%3E" >:></A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ></TR ></TABLE ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3Avector" >vector</A > :: [a] -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfromVector" >fromVector</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> [a]</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AunitV" >unitV</A > :: a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AnullV" >nullV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AlengthV" >lengthV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A ></TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AatV" >atV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a -> b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AreplaceV" >replaceV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AheadV" >headV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AtailV" >tailV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AlastV" >lastV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AinitV" >initV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AtakeV" >takeV</A > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd" >Ord</A > a) => a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AdropV" >dropV</A > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd" >Ord</A > a) => a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AselectV" >selectV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgroupV" >groupV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3A%3C%2B%3E" >(<+>)</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3A%3C%3A" >(<:)</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AmapV" >mapV</A > :: (a -> b) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfoldlV" >foldlV</A > :: (a -> b -> a) -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfoldrV" >foldrV</A > :: (b -> a -> a) -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AzipWithV" >zipWithV</A > :: (a -> b -> c) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > c</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AfilterV" >filterV</A > :: (a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A >) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AzipV" >zipV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (a, b)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AunzipV" >unzipV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (a, b) -> (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a, <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b)</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AconcatV" >concatV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AreverseV" >reverseV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftlV" >shiftlV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AshiftrV" >shiftrV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArotrV" >rotrV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3ArotlV" >rotlV</A > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AgenerateV" >generateV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> (b -> b) -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AiterateV" >iterateV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> (b -> b) -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ><TR ><TD CLASS="s8" ></TD ></TR ><TR ><TD CLASS="decl" ><A HREF="#v%3AcopyV" >copyV</A > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="section1" >Documentation</TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><SPAN CLASS="keyword" >data</SPAN > <A NAME="t:Vector" ><A NAME="t%3AVector" ></A ></A ><B >Vector</B > a </TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#Vector" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0" ><TR ><TD CLASS="ndoc" ><P >The data type <TT ><A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A ></TT > is modeled similar to a list. It has two data type constructors. <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3ANullV" >NullV</A ></TT > constructs the empty vector, while ':>' constructsa vector by adding an value to an existing vector. Using the inheritance mechanism of Haskell we have declared <TT ><A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A ></TT > as an instance of the classes <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Read.html#t%3ARead" >Read</A ></TT > and <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow" >Show</A ></TT >. </P ><P >| This means that the vector 1:>2:>3:>NullV is shown as <A HREF="1,2,3" >1,2,3</A >. </P ></TD ></TR ><TR ><TD CLASS="section4" >Constructors</TD ></TR ><TR ><TD CLASS="body" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="arg" ><A NAME="v:NullV" ><A NAME="v%3ANullV" ></A ></A ><B >NullV</B ></TD ><TD CLASS="rdoc" ></TD ></TR ><TR ><TD CLASS="arg" >a <A NAME="v::>" ><A NAME="v%3A%3A%3E" ></A ></A ><B >:></B > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ><TD CLASS="rdoc" ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="section4" ><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Vector')" ALT="show/hide" > Instances</TD ></TR ><TR ><TD CLASS="body" ><DIV ID="i:Vector" STYLE="display:block;" ><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0" ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq" >Eq</A > a => <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq" >Eq</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Read.html#t%3ARead" >Read</A > a => <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Read.html#t%3ARead" >Read</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ></TR ><TR ><TD CLASS="decl" ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow" >Show</A > a => <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow" >Show</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:vector" ><A NAME="v%3Avector" ></A ></A ><B >vector</B > :: [a] -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#vector" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3Avector" >vector</A ></TT > converts a list into a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:fromVector" ><A NAME="v%3AfromVector" ></A ></A ><B >fromVector</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> [a]</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#fromVector" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AfromVector" >fromVector</A ></TT > converts a vector into a list. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:unitV" ><A NAME="v%3AunitV" ></A ></A ><B >unitV</B > :: a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#unitV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AunitV" >unitV</A ></TT > creates a vector with one element. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:nullV" ><A NAME="v%3AnullV" ></A ></A ><B >nullV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A ></TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#nullV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AnullV" >nullV</A ></TT > returns <TT ><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#v%3ATrue" >True</A ></TT > if a vector is empty. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:lengthV" ><A NAME="v%3AlengthV" ></A ></A ><B >lengthV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A ></TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#lengthV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AlengthV" >lengthV</A ></TT > returns the number of elements in a value. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:atV" ><A NAME="v%3AatV" ></A ></A ><B >atV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a -> b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#atV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AatV" >atV</A ></TT > returns the n-th element in a vector, starting from zero. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:replaceV" ><A NAME="v%3AreplaceV" ></A ></A ><B >replaceV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#replaceV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AreplaceV" >replaceV</A ></TT > replaces an element in a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:headV" ><A NAME="v%3AheadV" ></A ></A ><B >headV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#headV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The functions <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AheadV" >headV</A ></TT > returns the first element of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:tailV" ><A NAME="v%3AtailV" ></A ></A ><B >tailV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#tailV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The functions <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AtailV" >tailV</A ></TT > returns all, but the first element of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:lastV" ><A NAME="v%3AlastV" ></A ></A ><B >lastV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#lastV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AlastV" >lastV</A ></TT > returns the last element of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:initV" ><A NAME="v%3AinitV" ></A ></A ><B >initV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#initV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AinitV" >initV</A ></TT > returns all but the last elements of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:takeV" ><A NAME="v%3AtakeV" ></A ></A ><B >takeV</B > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd" >Ord</A > a) => a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#takeV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AtakeV" >takeV</A ></TT > returns the first n elements of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:dropV" ><A NAME="v%3AdropV" ></A ></A ><B >dropV</B > :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd" >Ord</A > a) => a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#dropV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AdropV" >dropV</A ></TT > drops the first n elements of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:selectV" ><A NAME="v%3AselectV" ></A ></A ><B >selectV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#selectV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AselectV" >selectV</A ></TT > selects elements in the vector. The first argument gives the initial element, starting from zero, the second argument gives the stepsize between elements and the last argument gives the number of elements. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:groupV" ><A NAME="v%3AgroupV" ></A ></A ><B >groupV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt" >Int</A > -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a)</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#groupV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AgroupV" >groupV</A ></TT > groups a vector into a vector of vectors of size n. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:<+>" ><A NAME="v%3A%3C%2B%3E" ></A ></A ><B >(<+>)</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#%3C%2B%3E" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The operator '(<A HREF="+" >+</A >)' concatinates two vectors. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:<:" ><A NAME="v%3A%3C%3A" ></A ></A ><B >(<:)</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#%3C%3A" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The operator '(<:)' adds an element at the end of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:mapV" ><A NAME="v%3AmapV" ></A ></A ><B >mapV</B > :: (a -> b) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#mapV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The higher-order function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AmapV" >mapV</A ></TT > applies a function on all elements of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:foldlV" ><A NAME="v%3AfoldlV" ></A ></A ><B >foldlV</B > :: (a -> b -> a) -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#foldlV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The higher-order functions <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AfoldlV" >foldlV</A ></TT > folds a function from the right to the left over a vector using an initial value. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:foldrV" ><A NAME="v%3AfoldrV" ></A ></A ><B >foldrV</B > :: (b -> a -> a) -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#foldrV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The higher-order functions <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AfoldrV" >foldrV</A ></TT > folds a function from the left to the right over a vector using an initial value. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:zipWithV" ><A NAME="v%3AzipWithV" ></A ></A ><B >zipWithV</B > :: (a -> b -> c) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > c</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#zipWithV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The higher-order function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AzipWithV" >zipWithV</A ></TT > applies a function pairwise on to vectors. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:filterV" ><A NAME="v%3AfilterV" ></A ></A ><B >filterV</B > :: (a -> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool" >Bool</A >) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#filterV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The higher-function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AfilterV" >filterV</A ></TT > takes a predicate function and a vector and creates a new vector with the elements for which the predicate is true. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:zipV" ><A NAME="v%3AzipV" ></A ></A ><B >zipV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (a, b)</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#zipV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AzipV" >zipV</A ></TT > zips two vectors into a vector of tuples. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:unzipV" ><A NAME="v%3AunzipV" ></A ></A ><B >unzipV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (a, b) -> (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a, <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b)</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#unzipV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AunzipV" >unzipV</A ></TT > unzips a vector of tuples into two vectors. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:concatV" ><A NAME="v%3AconcatV" ></A ></A ><B >concatV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > (<A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a) -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#concatV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AconcatV" >concatV</A ></TT > transforms a vector of vectors to a single vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:reverseV" ><A NAME="v%3AreverseV" ></A ></A ><B >reverseV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#reverseV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AreverseV" >reverseV</A ></TT > reverses the order of elements in a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftlV" ><A NAME="v%3AshiftlV" ></A ></A ><B >shiftlV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#shiftlV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AshiftlV" >shiftlV</A ></TT > shifts a value from the left into a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:shiftrV" ><A NAME="v%3AshiftrV" ></A ></A ><B >shiftrV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#shiftrV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AshiftrV" >shiftrV</A ></TT > shifts a value from the right into a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:rotrV" ><A NAME="v%3ArotrV" ></A ></A ><B >rotrV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#rotrV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3ArotrV" >rotrV</A ></TT > rotates a vector to the right. Note that this fuction does not change the size of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:rotlV" ><A NAME="v%3ArotlV" ></A ></A ><B >rotlV</B > :: <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > a</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#rotlV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3ArotlV" >rotlV</A ></TT > rotates a vector to the left. Note that this fuctions does not change the size of a vector. </TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:generateV" ><A NAME="v%3AgenerateV" ></A ></A ><B >generateV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> (b -> b) -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#generateV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AgenerateV" >generateV</A ></TT > behaves in the same way, but starts with the application of the supplied function to the supplied value. </P ><PRE > Vector> generateV 5 (+1) 1 </PRE ><PRE > <2,3,4,5,6> :: Vector Integer </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:iterateV" ><A NAME="v%3AiterateV" ></A ></A ><B >iterateV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> (b -> b) -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#iterateV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AiterateV" >iterateV</A ></TT > generates a vector with a given number of elements starting from an initial element using a supplied function for the generation of elements. </P ><PRE > Vector> iterateV 5 (+1) 1 </PRE ><PRE > <1,2,3,4,5> :: Vector Integer </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="topdecl" ><TABLE CLASS="declbar" ><TR ><TD CLASS="declname" ><A NAME="v:copyV" ><A NAME="v%3AcopyV" ></A ></A ><B >copyV</B > :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ANum" >Num</A > a => a -> b -> <A HREF="ForSyDe-Shallow-Vector.html#t%3AVector" >Vector</A > b</TD ><TD CLASS="declbut" ><A HREF="src/ForSyDe-Shallow-Vector.html#copyV" >Source</A ></TD ></TR ></TABLE ></TD ></TR ><TR ><TD CLASS="doc" ><P >The function <TT ><A HREF="ForSyDe-Shallow-Vector.html#v%3AcopyV" >copyV</A ></TT > generates a vector with a given number of copies of the same element. </P ><PRE > Vector> copyV 7 5 </PRE ><PRE > <5,5,5,5,5,5,5> :: Vector Integer </PRE ></TD ></TR ><TR ><TD CLASS="s15" ></TD ></TR ><TR ><TD CLASS="botbar" >Produced by <A HREF="http://www.haskell.org/haddock/" >Haddock</A > version 2.6.1</TD ></TR ></TABLE ></BODY ></HTML >