CheatSheet 1.2 → 1.3
raw patch · 3 files changed
+24/−17 lines, 3 files
Files
- CheatSheet.cabal +1/−1
- CheatSheet.lhs +23/−16
- CheatSheet.pdf binary
CheatSheet.cabal view
@@ -1,7 +1,7 @@ Name: CheatSheet License: BSD3 License-File: LICENSE-Version: 1.2+Version: 1.3 Author: Justin Bailey Homepage: http://blog.codeslower.com/2008/10/The-Haskell-Cheatsheet Maintainer: jgbailey _ codeslower _ com
CheatSheet.lhs view
@@ -21,13 +21,11 @@ \begin{document} \begin{multicols}{3} \section*{\textsf{\LARGE Haskell Cheat Sheet\normalsize}}-This cheat sheet attempts to lay out the fundamental elements of the Haskell-language and libraries. It should serve as a reference to both those learning-Haskell and those who are familiar with it, but maybe can't remember all-the varieties of syntax and functionality. -It is presented as both an executable Haskell file and a printable document. Load-the source into your favorite interpreter to play with code samples shown.+This cheat sheet lays out the fundamental elements of the Haskell language:+syntax, keywords and other elements. It is presented as both an executable+Haskell file and a printable document. Load the source into your favorite+interpreter to play with code samples shown. \begin{comment} @@ -35,7 +33,7 @@ > > module CheatSheet where >-> import Data.Char (isUpper, isLower, toUpper, toLower, isSpace)+> import Data.Char (isUpper, isLower, toUpper, toLower, isSpace, GeneralCategory(..)) > import System.IO (readFile) > import System.Directory (doesFileExist) > import qualified Data.Set as Set@@ -98,14 +96,23 @@ \shd{Numbers} @1@ - Integer\\- @1.0, 1e10@ - Floating point\\- @[1..10]@ -- List of numbers -- $1, 2, ... 10$\\- @[100..]@ -- Infinite list of numbers -- $100, 101, 102, ... $\\+ @1.0, 1e10@ - Floating point++\shd{Enumerations} + @[1..10]@ -- List of numbers -- \texttt{1, 2, {\ensuremath\mathellipsis}, 10}.\\+ @[100..]@ -- Infinite list of numbers -- \texttt{100, 101, 102, {\ensuremath\mathellipsis}\ }.\\ @[110..100]@ -- Empty list; ranges only go forwards.\\ @[0, -1 ..]@ -- Negative integers.\\- @[-100..-110]@ -- Syntax error; need [-100.. -110] for negatives.\\- @[1,3..100], [-1,3..100]@ -- List from 1 to 100 by 2, -1 to 100 by 4.+ @[-100..-110]@ -- Syntax error; need @[-100.. -110]@ for negatives.\\+ @[1,3..100], [-1,3..100]@ -- List from 1 to 100 by 2, -1 to 100 by 4.\\ + \noindent In fact, any value which is in the @Enum@ class can be used. E.g.,:+ +\smallskip\noindent+ @['a' .. 'z']@ -- List of characters -- \texttt{a, b, {\ensuremath\mathellipsis}, z}.\\+ @[1.0, 1.5 .. 2]@ -- @[1.0,1.5,2.0]@.\\+ @[UppercaseLetter ..]@ -- List of @GeneralCategory@ values (from @Data.Char@).+ \shd{Lists \& Tuples} @[]@ -- Empty list.\\ @[1,2,3]@ -- List of three numbers.\\@@ -1351,15 +1358,15 @@ \hd{Contributors} My thanks to those who contributed patches and useful suggestions:- Stephen Hicks, Kurt Hutchinson, Adrian Neumann, Holger Siegel, and Jeff Zaroyko.+ Stephen Hicks, Kurt Hutchinson, Adrian Neumann, Markus Roberts, Holger Siegel, and Jeff Zaroyko. \hd{Version} - This is version 1.2. The source can - be found at \url{git://github.com/m4dc4p/cheatsheet.git}. The latest+ This is version 1.3. The source can + be found at GitHub\footnote{\url{git://github.com/m4dc4p/cheatsheet.git}}. The latest released version of the PDF can be downloaded from Hackage\footnote{\url{http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CheatSheet}}. Visit- \url{http://blog.codeslower.com} for other projects and writings. + CodeSlower.com\footnote{\url{http://blog.codeslower.com}} for other projects and writings. \end{multicols} \end{document}
CheatSheet.pdf view
binary file changed (158441 → 159710 bytes)