Skip to content

Instantly share code, notes, and snippets.

@dcsobral
dcsobral / README.md
Created April 15, 2020 23:40
Scala Configurable Warnings

Pull request #8373 implementing issue 333 (but please note differences).

Pull request description follows:

This PR adds a -Wconf compiler flag that allows filtering and configuring compiler warnings (silence them, or turn them into errors).

It also integrates the fantastic silencer compiler plugin by @ghik into the compiler, which allows suppressing warnings locally using the @nowarn annotation.

<!-- ADMIN ITEMS -->
<item id="3500" name="Admin_nailgun">
<property name="IsDeveloper" value="true"/>
<property name="Meshfile" value="Items/Tools/nailgunPrefab"/>
<property name="CustomIcon" value="nailgun"/>
<property name="CustomIconTint" value="FF0000"/>
<property name="Material" value="metal"/>
<property name="HoldType" value="37"/>
<property name="Stacknumber" value="1"/>
<property name="RepairTools" value="repairKit"/>
@buzzdecafe
buzzdecafe / ct_notes.txt
Last active January 24, 2022 12:17
Category Theory for Programmers: Notes
CATEGORY THEORY FOR PROGRAMMERS
Category Theory 1.1: Motivation and Philosophy
https://www.youtube.com/watch?v=I8LbkfSSR58&index=1&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_
Composability, Abstraction, Reusability
Category Theory is a higher-level language.
Not a practical, executable language.
@aloiscochard
aloiscochard / qsbt.sh
Last active March 5, 2018 21:34
QuickSBT - Launch SBT with support for generating /tmp/sbt.quickfix file for Vim
#!/usr/bin/env bash
############
# QuickSBT #
############
# Launch SBT with support for generating /tmp/sbt.quickfix file for Vim
# http://github.com/aloiscochard / https://gist.github.com/4698501
# Error format for SBT, and shortcut to open SBT quickfix file :
@poetix
poetix / builder.scala
Created January 15, 2013 12:26
Dynamic / Monadic object builder round 2
package com.youdevise.lofty
import org.specs2.mutable._
import scala.language.dynamics
import scala.language.reflectiveCalls
import scalaz._
import Scalaz._
import scala.reflect.runtime.universe._
trait Builder[T] {
@ymasory
ymasory / scala-irc
Last active August 30, 2017 21:16
List of all Scala-related IRC channels.
Please help compile a list of all Scala-related IRC rooms.
All of these channels are on Freenode.
#akka | concurrency & distribution framework
#argonaut | json library
#fp-in-scala | the book Functional Programming in Scala
#geotrellis | geoprocessing library
#indyscala | regional scala group
#json4s | json library
/** Constructing "singleton types" from compile-time literals
*
* val x = Example.foo(42)
* val y: x.T = 42 // compiles
* val z: x.T = 43 // doesn't
*
*/
package s
import scala.language.experimental.macros
19:07 ~/Projects/Kepler_typemacros/sandbox (topic/typemacros)$ scalac Macros.scala
19:07 ~/Projects/Kepler_typemacros/sandbox (topic/typemacros)$ scala -cp .
Welcome to Scala version 2.10.1-20121120-175733-b60f5bcf2c (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.
scala> class C extends AnyRef with Macros.Foo[Int]("2")
defined class C
scala> new C().hello
@tonymorris
tonymorris / ListZipper.scala
Created August 29, 2012 01:15
List Zipper
case class ListZipper[+A](lefts: List[A], x: A, rights: List[A]) {
def map[B](f: A => B): ListZipper[B] =
sys.error("todo")
// map with zipper context
def coFlatMap[B](f: ListZipper[A] => B): ListZipper[B] =
sys.error("todo")
def findRight(p: A => Boolean): Option[ListZipper[A]] =
sys.error("todo")
import scala.reflect.makro.Context
object Macros {
def trace[A](expr: A) = macro traceImpl[A]
def traceImpl[A: c.TypeTag](c: Context)(expr: c.Expr[A]): c.Expr[A] = {
import c.universe._
// stand-in for the real type of the traced sub expression.
// This lets us conveniently splice this type into the