Skip to content

Instantly share code, notes, and snippets.

Abdhesh Kumar abdheshkumar

Block or report user

Report or block abdheshkumar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
abdheshkumar / fpmax.scala
Created Jul 13, 2018 — forked from jdegoes/fpmax.scala
FP to the Max — Code Examples
View fpmax.scala
package fpmax
import scala.util.Try
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
abdheshkumar / Conversions.scala
Created Apr 11, 2018 — forked from SystemFw/Conversions.scala
Typed schema conversion with shapeless
View Conversions.scala
object Conversions {
import cats._, implicits._, data.ValidatedNel
import mouse._, string._, option._
import shapeless._, labelled._
private type Result[A] = ValidatedNel[ParseFailure, A]
case class ParseFailure(error: String)
trait Convert[V] {
abdheshkumar /
Created Jul 9, 2017 — forked from pathikrit/
My highly opinionated list of things needed to build an app in Scala
abdheshkumar / AnalyticsLeader.scala
Last active Aug 29, 2015 — forked from ryantanner/AnalyticsLeader.scala
Conspire's implementation of work pulling
View AnalyticsLeader.scala
class AnalyticsLeader(supervisor: ActorRef) extends Leader[ProcessUser, AnalyticsNode, AnalyticsMessage](supervisor)
View GridFSHelper.scala
package code.lib
import net.liftweb._
import http._
import util._
import Helpers._
import common._
import mongodb._
import com.mongodb._
View build.sbt
scalaVersion := "2.9.1"
resolvers += "typesafe" at ""
libraryDependencies ++= Seq(
"play" %% "anorm" % "2.0-RC4",
"com.github.seratch" %% "scalikejdbc" % "[0.5,)",
"org.hsqldb" % "hsqldb" % "[2,)"
View EmailService.scala
* Copyright (C) 2012 47 Degrees, LLC
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
View Mail.scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
You can’t perform that action at this time.