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
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
View haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md

#Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started Upon completion you will have a sane, productive Haskell environment adhering to best practices.

Basics

  • Haskell is a programming language.
  • Stack is tool for Haskell projects. (similar tools for other languages include Maven, Gradle, npm, RubyGems etc)
  • Intellij IDEA IDE is a popular IDE.

Download and extract Stack

Don't install Haskell, Stack, Cabal or any other Haskell tool or library using your OS package manager or using Cabal.

You can’t perform that action at this time.