CheatSheet 2.2 → 2.3
raw patch · 3 files changed
+37/−25 lines, 3 files
Files
- CheatSheet.cabal +14/−5
- CheatSheet.lhs +23/−20
- CheatSheet.pdf binary
CheatSheet.cabal view
@@ -1,12 +1,12 @@ Name: CheatSheet License: BSD3 License-File: LICENSE-Version: 2.2+Version: 2.3 Homepage: http://cheatsheet.codeslower.com Maintainer: Justin Bailey <jgbailey@codeslower.com> Author: Justin Bailey <jgbailey@codeslower.com> Category: Help-Build-Depends: base >=3 && < 5, containers, directory+Cabal-Version: >= 1.6 Build-type: Simple Synopsis: A Haskell cheat sheet in PDF and literate formats. Description:@@ -16,7 +16,16 @@ Data-files: CheatSheet.pdf, CheatSheet.lhs Extra-Source-Files: CheatSheet.lhs, README -Executable: cheatsheet-Main-Is: Main.lhs-Hs-Source-Dirs: . +Executable cheatsheet+ Main-Is: Main.lhs+ Hs-Source-Dirs: . + Build-Depends: base >= 3 && < 5, containers, directory +Source-repository head+ Type: git+ location: git://github.com/m4dc4p/cheatsheet.git++Source-repository this+ Type: git+ location: git://github.com/m4dc4p/cheatsheet.git+ tag: v2.3
CheatSheet.lhs view
@@ -15,11 +15,12 @@ \usepackage{hyperref} \usepackage[all]{hypcap} % Must be after hyperref+% \usepackage{setspace} \hypersetup{colorlinks} \pagestyle{fancy} \fancyhf{}-\lfoot{\copyright\ 2009 Justin Bailey.}+\lfoot{\copyright\ 2010 Justin Bailey.} \cfoot{\thepage} \rfoot{\href{mailto:jgbailey@@codeslower.com}{\tt jgbailey@@codeslower.com}} \renewcommand\footrulewidth{0.4pt}@@ -38,6 +39,7 @@ \setlength{\columnsep}{18.0pt} \setlength{\columnseprule}{0.4pt} \begin{document}+% \doublespacing \begin{multicols}{3} \section*{\textsf{\LARGE Haskell Cheat Sheet\normalsize}}\label{preamble} @@ -1022,20 +1024,6 @@ Finally, as explained elsewhere, these names can be used for pattern matching, argument capture and ``updating.'' - \sshd{Class Constraints}\label{class-constraints}-- Data types can be declared with class constraints on the type variables, but- this practice is discouraged. It is better to hide the- ``raw'' data constructors using the module system and instead export ``smart''- constructors which apply appropriate constraints. In any case, the syntax used- is:--> data (Num a) => SomeNumber a = Two a a-> | Three a a a-- This declares a type @SomeNumber@ which has one type variable argument. Valid- types are those in the @Num@ class.- \sshd{Deriving}\label{deriving} Many types have common operations which are tedious to define yet necessary,@@ -1059,8 +1047,22 @@ > deriving (Read, Show) It is a syntax error to specify @deriving@ for any other classes besides the- six given above.+ seven given above. + \sshd{Class Constraints}\label{class-constraints}++ Data types can be declared with class constraints on the type variables, but+ this practice is discouraged. It is better to hide the+ ``raw'' data constructors using the module system and instead export ``smart''+ constructors which apply appropriate constraints. In any case, the syntax used+ is:++> data (Num a) => SomeNumber a = Two a a+> | Three a a a++ This declares a type @SomeNumber@ which has one type variable argument. Valid+ types are those in the @Num@ class.+ \shd{Deriving} See the section on \hyperref[deriving]{@deriving@} under the @data@ keyword on@@ -1522,13 +1524,14 @@ My thanks to those who contributed patches and useful suggestions: Dave Bayer, Paul Butler, Elisa Firth, Marc Fontaine, Brian- Gianforcaro, Cale Gibbard, Stephen Hicks, Kurt Hutchinson, Johan- Kiviniemi, Adrian Neumann, Barak Pearlmutter, Lanny Ripple, Markus- Roberts, Holger Siegel, Adam Vogt, Leif Warner, and Jeff Zaroyko.+ Gianforcaro, Cale Gibbard, Andrew Harris, Stephen Hicks, Kurt+ Hutchinson, Johan Kiviniemi, Adrian Neumann, Barak Pearlmutter,+ Lanny Ripple, Markus Roberts, Holger Siegel, Adam Vogt, Leif Warner,+ and Jeff Zaroyko. \hd{Version}\label{version} - This is version 2.2. The source can be found at GitHub+ This is version 2.3. The source can be found at GitHub (\url{http://github.com/m4dc4p/cheatsheet}). The latest released version of the PDF can be downloaded from \url{http://cheatsheet.codeslower.com}. Visit CodeSlower.com
CheatSheet.pdf view
binary file changed (166281 → 166196 bytes)