Skip to content

Commit

Permalink
cats effect IO whenA
Browse files Browse the repository at this point in the history
  • Loading branch information
kaichaosun committed May 6, 2019
1 parent dfbd812 commit d227bc6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -71,6 +71,12 @@ This book is aimed to be the first place when you starting functional programmin
* [Why variance](#why-variance)
* [References](#references)

## Functional Programming Introduction

### Whats FP

### Why FP

## Setup

### Install Java 8 JDK
Expand Down
@@ -0,0 +1,6 @@
import cats.effect.IO
import cats.implicits._

val program = IO{ println("hello") }.whenA(false)

program.unsafeRunSync()
@@ -0,0 +1,11 @@
import fs2.Chunk
import fs2.Stream

val s1c = Stream.chunk(Chunk.doubles(Array(1.0, 2.0, 3.0)))

s1c.mapChunks{
chunk =>
val doubles = chunk.toDoubles
println(doubles.values.size)
doubles
}

0 comments on commit d227bc6

Please sign in to comment.