Skip to content

Instantly share code, notes, and snippets.

View masaeedu's full-sized avatar

Asad Saeeduddin masaeedu

  • Montreal, QC, Canada
View GitHub Profile
@acowley
acowley / EmacsHaskellDemo.md
Last active May 18, 2023 17:31
Emacs Haskell Demo Show Notes

Org Editing in haskell-mode

The video opens with a regular Haskell source file in haskell-mode. We start off by adding headings that break the file into meaningful chunks. A section heading is indicated by an asterisk following Haskell single-line comment characters, i.e. -- *. These are top-level headings, sub-headings are indicated by adding more asterisks.

These section markers are given meaning by

@samhocevar
samhocevar / gist:00eec26d9e9988d080ac
Last active October 17, 2024 17:02
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <[email protected]>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@praeclarum
praeclarum / AlgorithmW.fs
Last active February 2, 2025 14:29
Algorithm W - or Hindley-Milner polymorphic type inference - in F#
module AlgorithmW
// HINDLEY-MILNER TYPE INFERENCE
// Based on http://catamorph.de/documents/AlgorithmW.pdf
// (Now at http://web.archive.org/web/20170704013532/http://catamorph.de/documents/AlgorithmW.pdf)
type Lit =
| LInt of int
| LBool of bool
// see also https://www.npmjs.com/package/subtractiontype.ts
// for literal unions
type Sub0<
O extends string,
D extends string,
> = {[K in O]: (Record<D, never> & Record<string, K>)[K]}
type Sub<
@gabejohnson
gabejohnson / infix.js
Last active December 19, 2018 16:52
Because I'm lazy and mixfix w/ proxies is slow
var isWrapper = Symbol('isWrapper');
function _(arg, args=[], ops=[]) {
const myArgs = args.concat([arg]);
const myOps = ops.slice(0);
const f = ([op]) => (
myOps.push(op),
wrap(arg2 => _(arg2, myArgs, myOps), myArgs, myOps)
);
@Brainiarc7
Brainiarc7 / clevo-p75xdm2-g-linux-install.md
Last active December 1, 2022 21:02
How to set up Ubuntu 18.04LTS on the Clevo P751/2DM2-G DTRs and workarounds to issues you may face.

Running Linux on the Clevo P750/1DM2-G DTR

Hello, brethren.

This post will detail how to successfully run Linux on the aforementioned notebook, with common traps and exceptions explained.

An overview:

This is an Intel Skylake-based laptop (upgradeable to a Kabylake-grade Desktop processor) with a desktop-class Pascal GPU, the GTX 1070. Switchable graphics (Optimus) is absent, which eliminates a significant burden of running Linux on this machine.

@Lysxia
Lysxia / F.hs
Created November 20, 2018 22:55
Replay with Freer
{-# LANGUAGE
RankNTypes,
ScopedTypeVariables,
KindSignatures,
GADTs
#-}
import Data.Foldable (for_)
import System.IO (hFlush, stdout)
@TOTBWF
TOTBWF / MTLDerivingVia.hs
Last active November 6, 2021 16:59
Deriving MTL classes using -XDerivingVia
-- |
-- Module : Lift
-- Copyright : (c) Reed Mullanix 2019
-- License : BSD-style
-- Maintainer : [email protected]
--
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE KindSignatures #-}
Parameter m w : Type -> Type.
Parameter fmap_w : forall {a b}, (a -> b) -> w a -> w b.
Parameter fmap_m : forall {a b}, (a -> b) -> m a -> m b.
Parameter pure : forall {a}, a -> m a.
Parameter subst : forall {a b}, (a -> m b) -> m a -> m b.
(* subst = flip (>>=) *)
Parameter extract : forall {a}, w a -> a.
title author date datePretty description tags
Intro to FP Through λ-Calc Part 1. - Motivating Laziness
Jonathan Lorimer
19/03/2020
Mar 19, 2020
Introduction to Functional Programming Through Lambda Calculus gave a thorough explanation of evaluation in lambda calculus, I found this helped motivate a better understanding of evaluation in haskell!
lambda-calculus

Table of Contents