- pure functions, no side effects, good for reasoning
- IO system separates pure functions from side-effects
- Hello world, various ways to run it
putStrLn
andgetLine
, do notation- Types of
IO ()
andIO String
- Reverse example, with IF and recursive call
import scalaz.stream.{Exchange, Process, Sink} | |
import scalaz.stream.async.topic | |
import scalaz.concurrent.Task | |
import scalaz.stream.async.mutable.Topic | |
object TopicExplore { | |
case class Message(value: String) |
package foo | |
import scalaz.stream.{Exchange, Process, Sink} | |
import scalaz.stream.async.topic | |
import scalaz.concurrent.Task | |
import scalaz.stream.async.mutable.Topic | |
// Useful: | |
// - https://gist.github.com/djspiewak/d93a9c4983f63721c41c |
find . -name \*.scala -exec sed -E -i.bak 's| <> \((.*).tupled, .*\)|.mapTo[\1]|' {} + |
import slick.driver.H2Driver.api._ | |
import java.sql.Timestamp | |
import java.util.Date | |
object Gender extends Enumeration { | |
type Gender = Value | |
val MALE = Value("MALE") | |
val FEMALE = Value("FEMALE") | |
} |
Podcast: http://www.collaborationsuperpowers.com/116-10-tips-for-working-with-multiple-time-zones/
Enevitably someone will be getting up early or working late. Don't let it just be one team all the time. Share the pain around.
Prelude> let (|>) = flip (.) | |
Prelude> let hh = (*2) |> (+1) |> (+0.1) | |
Prelude> :t hh | |
hh :: Fractional c => c -> c | |
Prelude> hh 50 | |
101.1 | |
Prelude> :q | |
Leaving GHCi. |
import scala.util.{Either, Right, Left} | |
object MarkerExample { | |
case class Error(msg: String) | |
sealed trait Success // or "NoValue" or "SuccessWithNoValue"? | |
object success extends Success { | |
override def toString: String = "success" | |
} |
-
We disagree over code formatting of plurals. I think we should only code format types and values that the reader could lookup. E.g.,
Hlist
s vs.HLists
. Ditto for function names (flatMapping
isn't a method I could find). I could drone on about this, but I'll spare you. -
For links, we should settle on a house style: do we hyperlink the number in "Chapter 5" or the whole phrase. Looks like you have consistently used the number. So ignore this for now.
BTW, I've worked from the PDF. I have pasted text from the PDF: that sometimes goes wonky, but tried to fix this gist when I spot it.