Skip to content

Instantly share code, notes, and snippets.

Avatar

Adil Akhter adilakhter

View GitHub Profile
View NaiveParMapN.scala
object Ex11 extends IOApp {
def naiveParMapN[A, B] (io1: IO[A], io2: IO[B]): IO[(A, B)] = {
io1.start.bracket { f1 =>
io2.start.bracket { f2 =>
for {
a <- f1.join
b <- f2.join
} yield (a, b)
}(_.cancel)
}(_.cancel)
View haskeller_competency_matrix.md
@adilakhter
adilakhter / must-watch-talks.md
Created Oct 8, 2016 — forked from ikhoon/must-watch-talks.md
Must watch talks - reddit /r/scala
View must-watch-talks.md
View haskell_getting_started.md
@adilakhter
adilakhter / KafkaReadAndWriteExample.scala
Last active Sep 21, 2018
Flink Kafka read and write example
View KafkaReadAndWriteExample.scala
package org.xiaon
import grizzled.slf4j.Logging
import org.apache.flink.api.common.typeinfo.TypeInformation
import org.apache.flink.api.java.utils.ParameterTool
import org.apache.flink.streaming.api.TimeCharacteristic
import org.apache.flink.streaming.api.functions.sink.SinkFunction
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.connectors.kafka.{FlinkKafkaConsumer011, FlinkKafkaProducer011}
@adilakhter
adilakhter / typeclass.scala
Last active Sep 3, 2018
refactoring to typeclass
View typeclass.scala
object typeclass extends App {
// Note: This domain model was given
// Simplified version is as follows:
sealed trait Attribute
case class PageLoad (e: String) extends Attribute
case class AdobeSinkableItem(e: String) extends Attribute
case class WebtrekkSinkableItem(e: Int) extends Attribute
@adilakhter
adilakhter / Json.scala
Created Dec 28, 2017 — forked from pchiusano/Json.scala
Simple JSON parser combinator library that does not use zippers
View Json.scala
// WARNING! totally untested, I have only compiled the code! :)
package json
import collection.immutable.Map
import scalaz.{\/, MonadPlus}
import scalaz.\/._
import scalaz.std.vector._
import scalaz.std.map._
import scalaz.std.list._
View keybase.md

Keybase proof

I hereby claim:

  • I am adilakhter on github.
  • I am adilakhter (https://keybase.io/adilakhter) on keybase.
  • I have a public key ASD6P7AcPLIIXV4C08q7BvryfkizCfnJejXOlBYaDWDhCAo

To claim this, I am signing this object:

@adilakhter
adilakhter / shapeless_example.scala
Last active May 24, 2017
Shapeless : Checking of the Type Constraints of Polymorphic Functions (lifted types)
View shapeless_example.scala
// details: https://stackoverflow.com/questions/44159203/shapeless-checking-of-the-type-constraints-of-polymorphic-functions-lifted-ty
import shapeless._
import ops.hlist._
import ops.function._
import syntax.std.function._
object ShapelessExample {
case class Place[A](a: A) extends AnyVal
View Source.scala
package test
import scala.collection.mutable
import scala.reflect.ClassTag
/**
* A Source of elements of type [[A]].
*
* [[Source]] is basically the inverse of
* a `scala.Iterator`: instead of the core functionality being the pull-based
You can’t perform that action at this time.