normal
The normal plane.
Change the current normal. Integral arguments are converted to floating-point with a linear mapping that maps the most positive representable integer value to 1.0, and the most negative representable integer value to -1.0.
Normals specified with normal or normalv need not have unit length. If normalize is enabled, then normals of any length specified with normal or normalv are normalized after transformation. If rescaleNormal is enabled, normals are scaled by a scaling factor derived from the modelview matrix. rescaleNormal requires that the originally specified normals were of unit length, and that the modelview matrix contains only uniform scales for proper results. Normalization is initially disabled.
> f p { = e }
> C Int a
The class of all types which can be used as a component of a normal.
This purpose of this library is to have a simple API and no dependencies beyond Haskell 98 in order to let you produce normally distributed random values with a minimum of fuss. This library does not attempt to be blazingly fast nor to pass stringent tests of randomness. It attempts to be very easy to install and use while being "good enough" for many applications (simulations, games, etc.). The API builds upon and is largely analogous to that of the Haskell 98 Random module (more recently System.Random).
Pure:
> (sample,g) = normal myRandomGen -- using a Random.RandomGen
> samples = normals myRandomGen -- infinite list
> samples2 = mkNormals 10831452 -- infinite list using a seed
In the IO monad:
> sample <- normalIO
> samples <- normalsIO -- infinite list
With custom mean and standard deviation:
> (sample,g) = normal' (mean,sigma) myRandomGen
> samples = normals' (mean,sigma) myRandomGen
> samples2 = mkNormals' (mean,sigma) 10831452
> sample <- normalIO' (mean,sigma)
> samples <- normalsIO' (mean,sigma)
Internally the library uses the Box-Muller method to generate normally distributed values from uniformly distributed random values. If more than one sample is needed taking samples off an infinite list (created by e.g. normals) will be roughly twice as efficient as repeatedly generating individual samples with e.g. normal.
Version 1.1.0.3
Normalise a file
* // outside of the drive can be made blank
* / -> pathSeparator
* ./ -> ""
> Posix: normalise "/file/\\test////" == "/file/\\test/"
> Posix: normalise "/file/./test" == "/file/test"
> Posix: normalise "/test/file/../bob/fred/" == "/test/file/../bob/fred/"
> Posix: normalise "../bob/fred/" == "../bob/fred/"
> Posix: normalise "./bob/fred/" == "bob/fred/"
> Windows: normalise "c:\\file/bob\\" == "C:\\file\\bob\\"
> Windows: normalise "c:\\" == "C:\\"
> Windows: normalise "\\\\server\\test" == "\\\\server\\test"
> Windows: normalise "c:/file" == "C:\\file"
> normalise "." == "."
> Posix: normalise "./" == "./"
> Posix: normalise "./." == "./"
> Posix: normalise "/" == "/"
> Posix: normalise "bob/fred/." == "bob/fred/"
Case normalization; cf. RFC3986 section 6.2.2.1 NOTE: authority case normalization is not performed
Encoding normalization; cf. RFC3986 section 6.2.2.2
Show more results