This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.asb.algos.playground; | |
import java.util.Arrays; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class Main { | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.asb.free | |
import cats.data.{EitherK, EitherT} | |
import cats.free.Free | |
import cats.free.Free.inject | |
import cats.{Id, InjectK, ~>} | |
/** | |
* Program With Errors. | |
* Created by arjun on 9/1/17. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FreeIO { | |
// CSV IO | |
sealed trait CSVIO[A] | |
case class ReadCSV(reader: Reader) extends CSVIO[Stream[CSVRecord]] | |
class CSVIOs[F[_]](implicit I: InjectK[CSVIO, F]) { | |
def readCSV(reader: Reader): Free[F, Stream[CSVRecord]] = | |
inject(ReadCSV(reader)) | |
} |