Skip to content

Instantly share code, notes, and snippets.

View mgttlinger's full-sized avatar

Merlin mgttlinger

  • FAU Erlangen-Nürnberg
  • Fichtelgebirge
View GitHub Profile
@hackwaly
hackwaly / unify.ml
Last active May 4, 2023 00:11
Unify algorithm implemented in ocaml according to Alin Suciu's "Yet Another Efficient Unification Algorithm"
module type TERM = sig
type t
type tvar
val var_opt : t -> tvar option
val compare_var : tvar -> tvar -> int
val same_functor : t -> t -> bool
val args : t -> t list
end
module Make (Term : TERM) = struct
@mandubian
mandubian / gist:0fd090c0f75a46346f5e7898eeac9e28
Last active September 15, 2017 15:11
Improving compile-time for structure based on implicits resolutions
@milessabin
milessabin / shapeless-session.txt
Created April 1, 2016 12:29
shapeless on the Ammonite REPL with no dependencies other than an installed JDK. Many thanks to @przemekpokrywka for the idea, @alxarchambault for Coursier and @li_haoyi for Ammonite.
miles@frege:~$ ./shapeless.sh
Loading...
Welcome to the Ammonite Repl 0.5.2
(Scala 2.11.7 Java 1.8.0_51)
@ val l = 23 :: "foo" :: true :: HNil
l: Int :: String :: Boolean :: HNil = ::(23, ::("foo", ::(true, HNil)))
@
// Define the following traits and companion object
// It's in Rapture Core (https://github.com/propensive/rapture-core) if you don't want to
trait LowPriorityDefaultsTo { implicit def fallback[T, S]: DefaultsTo[T, S] = null }
object DefaultsTo extends LowPriorityDefaultsTo { implicit def defaultDefaultsTo[T]: DefaultsTo[T, T] = null }
trait DefaultsTo[T, S]
// Then, assuming we want to specify a default for a type class like `Namer`,
case class Namer[T](name: String)
@viktorklang
viktorklang / dockless.sh
Created May 27, 2014 12:15
"Permanently" hide the Dock
#!/bin/bash
#########################################################################################################################
# MIT License
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.