Haskel Notes For Professionals. 200+ pages of professional hints and tricks
✍ Scribed by GoalKicker.com
- Publisher
- GoalKicker.com
- Year
- 2018
- Tongue
- English
- Leaves
- 230
- Category
- Library
No coin nor oath required. For personal study only.
✦ Table of Contents
Content list
About
Chapter 1: Getting started with Haskell Language
Section 1.1: Getting started
Section 1.2: Hello, World!
Section 1.3: Factorial
Section 1.4: Fibonacci, Using Lazy Evaluation
Section 1.5: Primes
Section 1.6: Declaring Values
Chapter 2: Overloaded Literals
Section 2.1: Strings
Section 2.2: Floating Numeral
Section 2.3: Integer Numeral
Section 2.4: List Literals
Chapter 3: Foldable
Section 3.1: Definition of Foldable
Section 3.2: An instance of Foldable for a binary tree
Section 3.3: Counting the elements of a Foldable structure
Section 3.4: Folding a structure in reverse
Section 3.5: Flattening a Foldable structure into a list
Section 3.6: Performing a side-eect for each element of a Foldable structure
Section 3.7: Flattening a Foldable structure into a Monoid
Section 3.8: Checking if a Foldable structure is empty
Chapter 4: Traversable
Section 4.1: Definition of Traversable
Section 4.2: Traversing a structure in reverse
Section 4.3: An instance of Traversable for a binary tree
Section 4.4: Traversable structures as shapes with contents
Section 4.5: Instantiating Functor and Foldable for a Traversable structure
Section 4.6: Transforming a Traversable structure with the aid of an accumulating parameter
Section 4.7: Transposing a list of lists
Chapter 5: Lens
Section 5.1: Lenses for records
Section 5.2: Manipulating tuples with Lens
Section 5.3: Lens and Prism
Section 5.4: Stateful Lenses
Section 5.5: Lenses compose
Section 5.6: Writing a lens without Template Haskell
Section 5.7: Fields with makeFields
Section 5.8: Classy Lenses
Section 5.9: Traversals
Chapter 6: QuickCheck
Section 6.1: Declaring a property
Section 6.2: Randomly generating data for custom types
Section 6.3: Using implication (==>) to check properties with preconditions
Section 6.4: Checking a single property
Section 6.5: Checking all the properties in a file
Section 6.6: Limiting the size of test data
Chapter 7: Common GHC Language Extensions
Section 7.1: RankNTypes
Section 7.2: OverloadedStrings
Section 7.3: BinaryLiterals
Section 7.4: ExistentialQuantification
Section 7.5: LambdaCase
Section 7.6: FunctionalDependencies
Section 7.7: FlexibleInstances
Section 7.8: GADTs
Section 7.9: TupleSections
Section 7.10: OverloadedLists
Section 7.11: MultiParamTypeClasses
Section 7.12: UnicodeSyntax
Section 7.13: PatternSynonyms
Section 7.14: ScopedTypeVariables
Section 7.15: RecordWildCards
Chapter 8: Free Monads
Section 8.1: Free monads split monadic computations into data structures and interpreters
Section 8.2: The Freer monad
Section 8.3: How do foldFree and iterM work?
Section 8.4: Free Monads are like fixed points
Chapter 9: Type Classes
Section 9.1: Eq
Section 9.2: Monoid
Section 9.3: Ord
Section 9.4: Num
Section 9.5: Maybe and the Functor Class
Section 9.6: Type class inheritance: Ord type class
Chapter 10: IO
Section 10.1: Getting the 'a' "out of" 'IO a'
Section 10.2: IO defines your program's main action
Section 10.3: Checking for end-of-file conditions
Section 10.4: Reading all contents of standard input into a string
Section 10.5: Role and Purpose of IO
Section 10.6: Writing to stdout
Section 10.7: Reading words from an entire file
Section 10.8: Reading a line from standard input
Section 10.9: Reading from stdin
Section 10.10: Parsing and constructing an object from standard input
Section 10.11: Reading from file handles
Chapter 11: Record Syntax
Section 11.1: Basic Syntax
Section 11.2: Defining a data type with field labels
Section 11.3: RecordWildCards
Section 11.4: Copying Records while Changing Field Values
Section 11.5: Records with newtype
Chapter 12: Partial Application
Section 12.1: Sections
Section 12.2: Partially Applied Adding Function
Section 12.3: Returning a Partially Applied Function
Chapter 13: Monoid
Section 13.1: An instance of Monoid for lists
Section 13.2: Collapsing a list of Monoids into a single value
Section 13.3: Numeric Monoids
Section 13.4: An instance of Monoid for ()
Chapter 14: Category Theory
Section 14.1: Category theory as a system for organizing abstraction
Section 14.2: Haskell types as a category
Section 14.3: Definition of a Category
Section 14.4: Coproduct of types in Hask
Section 14.5: Product of types in Hask
Section 14.6: Haskell Applicative in terms of Category Theory
Chapter 15: Lists
Section 15.1: List basics
Section 15.2: Processing lists
Section 15.3: Ranges
Section 15.4: List Literals
Section 15.5: List Concatenation
Section 15.6: Accessing elements in lists
Section 15.7: Basic Functions on Lists
Section 15.8: Transforming with map
Section 15.9: Filtering with filter
Section 15.10: foldr
Section 15.11: Zipping and Unzipping Lists
Section 15.12: foldl
Chapter 16: Sorting Algorithms
Section 16.1: Insertion Sort
Section 16.2: Permutation Sort
Section 16.3: Merge Sort
Section 16.4: Quicksort
Section 16.5: Bubble sort
Section 16.6: Selection sort
Chapter 17: Type Families
Section 17.1: Datatype Families
Section 17.2: Type Synonym Families
Section 17.3: Injectivity
Chapter 18: Monads
Section 18.1: Definition of Monad
Section 18.2: No general way to extract value from a monadic computation
Section 18.3: Monad as a Subclass of Applicative
Section 18.4: The Maybe monad
Section 18.5: IO monad
Section 18.6: List Monad
Section 18.7: do-notation
Chapter 19: Stack
Section 19.1: Profiling with Stack
Section 19.2: Structure
Section 19.3: Build and Run a Stack Project
Section 19.4: Viewing dependencies
Section 19.5: Stack install
Section 19.6: Installing Stack
Section 19.7: Creating a simple project
Section 19.8: Stackage Packages and changing the LTS (resolver) version
Chapter 20: Generalized Algebraic Data Types
Section 20.1: Basic Usage
Chapter 21: Recursion Schemes
Section 21.1: Fixed points
Section 21.2: Primitive recursion
Section 21.3: Primitive corecursion
Section 21.4: Folding up a structure one layer at a time
Section 21.5: Unfolding a structure one layer at a time
Section 21.6: Unfolding and then folding, fused
Chapter 22: Data.Text
Section 22.1: Text Literals
Section 22.2: Checking if a Text is a substring of another Text
Section 22.3: Stripping whitespace
Section 22.4: Indexing Text
Section 22.5: Splitting Text Values
Section 22.6: Encoding and Decoding Text
Chapter 23: Using GHCi
Section 23.1: Breakpoints with GHCi
Section 23.2: Quitting GHCi
Section 23.3: Reloading a already loaded file
Section 23.4: Starting GHCi
Section 23.5: Changing the GHCi default prompt
Section 23.6: The GHCi configuration file
Section 23.7: Loading a file
Section 23.8: Multi-line statements
Chapter 24: Strictness
Section 24.1: Bang Patterns
Section 24.2: Lazy patterns
Section 24.3: Normal forms
Section 24.4: Strict fields
Chapter 25: Syntax in Functions
Section 25.1: Pattern Matching
Section 25.2: Using where and guards
Section 25.3: Guards
Chapter 26: Functor
Section 26.1: Class Definition of Functor and Laws
Section 26.2: Replacing all elements of a Functor with a single value
Section 26.3: Common instances of Functor
Section 26.4: Deriving Functor
Section 26.5: Polynomial functors
Section 26.6: Functors in Category Theory
Chapter 27: Testing with Tasty
Section 27.1: SmallCheck, QuickCheck and HUnit
Chapter 28: Creating Custom Data Types
Section 28.1: Creating a data type with value constructor parameters
Section 28.2: Creating a data type with type parameters
Section 28.3: Creating a simple data type
Section 28.4: Custom data type with record parameters
Chapter 29: Reactive-banana
Section 29.1: Injecting external events into the library
Section 29.2: Event type
Section 29.3: Actuating EventNetworks
Section 29.4: Behavior type
Chapter 30: Optimization
Section 30.1: Compiling your Program for Profiling
Section 30.2: Cost Centers
Chapter 31: Concurrency
Section 31.1: Spawning Threads with forkIO
Section 31.2: Communicating between Threads with MVar
Section 31.3: Atomic Blocks with Software Transactional Memory
Chapter 32: Function composition
Section 32.1: Right-to-left composition
Section 32.2: Composition with binary function
Section 32.3: Left-to-right composition
Chapter 33: Databases
Section 33.1: Postgres
Chapter 34: Data.Aeson - JSON in Haskell
Section 34.1: Smart Encoding and Decoding using Generics
Section 34.2: A quick way to generate a Data.Aeson.Value
Section 34.3: Optional Fields
Chapter 35: Higher-order functions
Section 35.1: Basics of Higher Order Functions
Section 35.2: Lambda Expressions
Section 35.3: Currying
Chapter 36: Containers - Data.Map
Section 36.1: Importing the Module
Section 36.2: Monoid instance
Section 36.3: Constructing
Section 36.4: Checking If Empty
Section 36.5: Finding Values
Section 36.6: Inserting Elements
Section 36.7: Deleting Elements
Chapter 37: Fixity declarations
Section 37.1: Associativity
Section 37.2: Binding precedence
Section 37.3: Example declarations
Chapter 38: Web Development
Section 38.1: Servant
Section 38.2: Yesod
Chapter 39: Vectors
Section 39.1: The Data.Vector Module
Section 39.2: Filtering a Vector
Section 39.3: Mapping (map) and Reducing (fold) a Vector
Section 39.4: Working on Multiple Vectors
Chapter 40: Cabal
Section 40.1: Working with sandboxes
Section 40.2: Install packages
Chapter 41: Type algebra
Section 41.1: Addition and multiplication
Section 41.2: Functions
Section 41.3: Natural numbers in type algebra
Section 41.4: Recursive types
Section 41.5: Derivatives
Chapter 42: Arrows
Section 42.1: Function compositions with multiple channels
Chapter 43: Typed holes
Section 43.1: Syntax of typed holes
Section 43.2: Semantics of typed holes
Section 43.3: Using typed holes to define a class instance
Chapter 44: Rewrite rules (GHC)
Section 44.1: Using rewrite rules on overloaded functions
Chapter 45: Date and Time
Section 45.1: Finding Today's Date
Section 45.2: Adding, Subtracting and Comparing Days
Chapter 46: List Comprehensions
Section 46.1: Basic List Comprehensions
Section 46.2: Do Notation
Section 46.3: Patterns in Generator Expressions
Section 46.4: Guards
Section 46.5: Parallel Comprehensions
Section 46.6: Local Bindings
Section 46.7: Nested Generators
Chapter 47: Streaming IO
Section 47.1: Streaming IO
Chapter 48: Google Protocol Buers
Section 48.1: Creating, building and using a simple .proto file
Chapter 49: Template Haskell & QuasiQuotes
Section 49.1: Syntax of Template Haskell and Quasiquotes
Section 49.2: The Q type
Section 49.3: An n-arity curry
Chapter 50: Phantom types
Section 50.1: Use Case for Phantom Types: Currencies
Chapter 51: Modules
Section 51.1: Defining Your Own Module
Section 51.2: Exporting Constructors
Section 51.3: Importing Specific Members of a Module
Section 51.4: Hiding Imports
Section 51.5: Qualifying Imports
Section 51.6: Hierarchical module names
Chapter 52: Tuples (Pairs, Triples, ...)
Section 52.1: Extract tuple components
Section 52.2: Strictness of matching a tuple
Section 52.3: Construct tuple values
Section 52.4: Write tuple types
Section 52.5: Pattern Match on Tuples
Section 52.6: Apply a binary function to a tuple (uncurrying)
Section 52.7: Apply a tuple function to two arguments (currying)
Section 52.8: Swap pair components
Chapter 53: Graphics with Gloss
Section 53.1: Installing Gloss
Section 53.2: Getting something on the screen
Chapter 54: State Monad
Section 54.1: Numbering the nodes of a tree with a counter
Chapter 55: Pipes
Section 55.1: Producers
Section 55.2: Connecting Pipes
Section 55.3: Pipes
Section 55.4: Running Pipes with runEect
Section 55.5: Consumers
Section 55.6: The Proxy monad transformer
Section 55.7: Combining Pipes and Network communication
Chapter 56: Infix operators
Section 56.1: Prelude
Section 56.2: Finding information about infix operators
Section 56.3: Custom operators
Chapter 57: Parallelism
Section 57.1: The Eval Monad
Section 57.2: rpar
Section 57.3: rseq
Chapter 58: Parsing HTML with taggy-lens and lens
Section 58.1: Filtering elements from the tree
Section 58.2: Extract the text contents from a div with a particular id
Chapter 59: Foreign Function Interface
Section 59.1: Calling C from Haskell
Section 59.2: Passing Haskell functions as callbacks to C code
Chapter 60: Gtk3
Section 60.1: Hello World in Gtk
Chapter 61: Monad Transformers
Section 61.1: A monadic counter
Chapter 62: Bifunctor
Section 62.1: Definition of Bifunctor
Section 62.2: Common instances of Bifunctor
Section 62.3: first and second
Chapter 63: Proxies
Section 63.1: Using Proxy
Section 63.2: The "polymorphic proxy" idiom
Section 63.3: Proxy is like ()
Chapter 64: Applicative Functor
Section 64.1: Alternative definition
Section 64.2: Common instances of Applicative
Chapter 65: Common monads as free monads
Section 65.1: Free Empty ~~ Identity
Section 65.2: Free Identity ~~ (Nat,) ~~ Writer Nat
Section 65.3: Free Maybe ~~ MaybeT (Writer Nat)
Section 65.4: Free (Writer w) ~~ Writer [w]
Section 65.5: Free (Const c) ~~ Either c
Section 65.6: Free (Reader x) ~~ Reader (Stream x)
Chapter 66: Common functors as the base of cofree comonads
Section 66.1: Cofree Empty ~~ Empty
Section 66.2: Cofree (Const c) ~~ Writer c
Section 66.3: Cofree Identity ~~ Stream
Section 66.4: Cofree Maybe ~~ NonEmpty
Section 66.5: Cofree (Writer w) ~~ WriterT w Stream
Section 66.6: Cofree (Either e) ~~ NonEmptyT (Writer e)
Section 66.7: Cofree (Reader x) ~~ Moore x
Chapter 67: Arithmetic
Section 67.1: Basic examples
Section 67.2: Could not deduce (Fractional Int) ...
Section 67.3: Function examples
Chapter 68: Role
Section 68.1: Nominal Role
Section 68.2: Representational Role
Section 68.3: Phantom Role
Chapter 69: Arbitrary-rank polymorphism with RankNTypes
Section 69.1: RankNTypes
Chapter 70: GHCJS
Section 70.1: Running "Hello World!" with Node.js
Chapter 71: XML
Section 71.1: Encoding a record using the xml library
Chapter 72: Reader / ReaderT
Section 72.1: Simple demonstration
Chapter 73: Function call syntax
Section 73.1: Partial application - Part 1
Section 73.2: Partial application - Part 2
Section 73.3: Parentheses in a basic function call
Section 73.4: Parentheses in embedded function calls
Chapter 74: Logging
Section 74.1: Logging with hslogger
Chapter 75: Attoparsec
Section 75.1: Combinators
Section 75.2: Bitmap - Parsing Binary Data
Chapter 76: zipWithM
Section 76.1: Calculatings sales prices
Chapter 77: Profunctor
Section 77.1: (->) Profunctor
Chapter 78: Type Application
Section 78.1: Avoiding type annotations
Section 78.2: Type applications in other languages
Section 78.3: Order of parameters
Section 78.4: Interaction with ambiguous types
Credits
You may also like
📜 SIMILAR VOLUMES