Haskell
# ghci
GHCi tip: import Module
and :load Module
do very different things!
import
brings the exports of Module
into scope.
:load
puts you in the context of that module, including language extensions, everything imported in that module, and non-exported terms from the module
# modelling errors as data types
http://lambdafoo.com/blog/2018/06/22/transformers-either/
# pattern matching
When you see a constructor on the left hand side that’s pattern matching
|
|
Alternatively you can use case of
|
|
# the tick convention
similar to klass
in Java. Used to escape variable bindings
|
|
# polymorphism
Polmrophic types in haskell always start with a lower case letter. A lower case type means polymorphic [generic]
|
|
Gentle reminder to any #haskell learners out there still trying to wrap their heads around Functor/Applicative/Monads:
— Brian Jones (@mojobojo) May 16, 2018
1. Just write code
2. Read https://t.co/3ISK3zLjoc
3. Repeat until it clicks
Pretty sure I wasted a year by not doing exactly this. It really is that simple.
https://qnikst.github.io/posts/2018-10-29-metrics-haskell.html
# profiling
https://medium.com/e-bot7-tech/improving-performance-of-your-haskell-code-with-profiteur-8d2e025b6779 http://neilmitchell.blogspot.com/2018/10/announcing-profiterole-ghc-profile.html?m=1
# Handling Failure
- https://hackage.haskell.org/package/transformers-either
- https://github.com/expression-oriented/failing-gracefully
- https://hackage.haskell.org/package/hoist-error
- https://github.com/alephcloud/hs-hoist-error
# Maintainability of Haskell Code
- https://abailly.github.io/posts/haskell-reliability.html
- http://www.parsonsmatt.org/2018/03/22/three_layer_haskell_cake.html
# structured logging
# Event Sourcing
# Input Validation
# Configuration Management
# Infrastructure and DevOps Tooling
- https://abailly.github.io/posts/cm-infra-1.html
- https://abailly.github.io/posts/cm-infra-2.html
- https://propellor.branchable.com/
# Website Application Architecture
# Software Transactional Memory
- http://blog.akii.de/posts/2018-02-19-geoip-lookup-part-1.html
- https://abailly.github.io/posts/note-on-stm.html
# Concurrent Programming
# GHC Internals
# Recommended Reading
# Isomorphic Haskell
# Domain Driven Design
- https://abailly.github.io/posts/cm-arch-design.html
- http://blog.akii.de/posts/2017-06-04-eventsourcing-in-haskell.html
- https://abailly.github.io/posts/dependent-types-ddd.html
# HTTP Clients
# Existential Types
applications.md
# Full Websites
# Webserver and API
-
https://haskell-servant.github.io/posts/2016-02-06-servant-swagger.html
-
http://www.parsonsmatt.org/2016/12/18/servant_in_yesod_-_yo_dawg.html c9.md
,—–.,–. ,–. ,—. ,–.,——. ,——. ' .–./| | ,—. ,–.,–. ,-| || o \ | || .-. \ | .—' | | | || .-. || || |' .-. |
..' | | || | \ :|
–, ' ‘–'| |’ ‘-’ '' '' ‘\-' | .' / | || '--' /|
—.-----'
–’---'
—-'---'
–'--'
——-' `——'
Setting up haskell-vim-now
on a Cloud9 workspace:
- Start with a Blank workspace.
- Increase resources (use at least
7GB
for disk and2GB
for ram, but more is better). - Edit
styles.css
to use a powerline font:
|
|
- Update
apt
:
|
|
- Install the Haskell stack:
|
|
- Install
haskell-vim-now
:
|
|
- Enjoy!
# Optional
Switch to a newer version of node
with nvm
:
|
|
Uninstall any older versions:
|
|
data61.md
Execute nix-shell
to bootstrap the environment
Create hello.hs
|
|
|
|
# Lists
cons :: https://en.wikipedia.org/wiki/Cons
cons - head and tail
|
|
|
|
The word “cons” and expressions like “to cons onto” are also part of a more general functional programming jargon. Sometimes operators that have a similar purpose, especially in the context of list processing, are pronounced “cons”. (A good example is the :: operator in ML, Scala, F# and Elm or the : operator in Haskell, which adds an element to the beginning of a list.)
# Rosetta
generics :: type variables cons :: https://en.wikipedia.org/wiki/Cons
cons - head and tail
|
|
# Pattern Matching
Can enable warnings when not all patterns are matched set fwarn-incomplete-patterns
see https://stackoverflow.com/questions/31866379/haskell-non-exhaustive-pattern-matching-in-haskell
# Resources
# Lists
const
https://en.wikipedia.org/wiki/Unary_function https://hackage.haskell.org/package/base-4.10.1.0/docs/Prelude.html#v:const
# Point Free
sum' xs = foldr (+) 0 xs
# Workflow
Look at the signature and write down what you have (tm) and write down what you need to get to (tm)
|
|
|
|
# People
- David
- Tim
# Day 1
src/Optional.hs
src/List.hs
# Determining file location of a type
|
|
education.md
# Videos
# GC
https://tech-blog.capital-match.com/posts/2-cpu-credits.html
https://github.com/ezyang/compact/blob/master/README.md
# Patterns
https://www.fpcomplete.com/blog/2017/06/readert-design-pattern
# date time
https://hackage.haskell.org/package/auto-update-0.1.4/docs/Control-AutoUpdate.html
# hot paths
https://www.yesodweb.com/blog/2014/08/announcing-auto-update
# compilation
https://rybczak.net/2016/03/26/how-to-reduce-compilation-times-of-haskell-projects/
packages.md
# Caching
https://github.com/SumAll/haskell-cached-io README.md http://blog.wuzzeb.org/full-stack-web-haskell/ tooling.md
# IDE
- Comparision of IDE’s - https://github.com/rainbyte/haskell-ide-chart
# Misc
https://begriffs.com/posts/2015-07-27-haskell-source-navigation.html vim.md. https://github.com/begriffs/haskell-vim-now
https://gist.github.com/gatlin/7754289