Skip to content

Instantly share code, notes, and snippets.

View matfournier's full-sized avatar

matfournier matfournier

View GitHub Profile
{-# LANGUAGE OverloadedStrings #-}
module Wrap where
import qualified Data.Text as T
import Prelude hiding (Word)
import Data.List
type LinePos = Int
@matfournier
matfournier / Example.scala
Created January 29, 2019 03:54
simple scala starter
package com.mfournier.pbp.example
class Example {
def square(x: Int): Int = x * x
}
name: parmf
version: 0.1.0.0
github: "githubuser/parallel"
license: BSD3
author: "Author name here"
maintainer: "[email protected]"
copyright: "2018 Author name here"
extra-source-files:
- README.md
@matfournier
matfournier / problem.hs
Last active October 30, 2018 05:17
Playing with haskell to solve a scala problem
-- so I have a problem where I had some ADT. I need to produce some FinalResult at a
-- much later time where the ADT is some input on the way to getting this final result
-- Each member of the ADT needs some different piece of missing information required to produce the final result
-- at some point we end up with this missing information
-- to get the final result, pattern match on the ADT and provide the correct bit of missing info
-- leads to a lot of pattern matching in Scala.
-- Typeclass looks nicer but feels just like moving the pattern match around
-- and looks 100x uglier in scala due to cruft/implicits
@matfournier
matfournier / desugar.hs
Created August 28, 2018 05:03
desugaring help
main = do
m <- newEmptyMVar
forkIO $ do
putMVar m 'x' -- child thread puts x into the mvar
putMVar m 'y'
r <- takeMVar m -- main thread takes the value out of the mvar
print r
r <- takeMVar m
print r
@matfournier
matfournier / desugar.hs
Created August 28, 2018 05:03
desugaring help
main = do
m <- newEmptyMVar
forkIO $ do
putMVar m 'x' -- child thread puts x into the mvar
putMVar m 'y'
r <- takeMVar m -- main thread takes the value out of the mvar
print r
r <- takeMVar m
print r
///// this is from https://gist.github.com/jdegoes/1b43f43e2d1e845201de853815ab3cb9
///// App2 ported to cats
//////
// build.sbt
// name := "finaltagless"
// version := "0.1"
// scalaVersion := "2.12.6"
;;; softerav1-theme.el --- Emacs theme with a light background.
;; Copyright (C) 2014 , mf
;; Author: mf
;;
;; Version: 0.1
;; Package-Requires: ((emacs "24"))
;; Created with emacs-theme-generator, https://github.com/mswift42/theme-creator.
@matfournier
matfournier / spacemacs.txt
Created September 6, 2017 04:08
spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
''' print out binary place value patterns '''
''' glitchy infinite scroll version '''
''' hit any key to exit '''
''' see https://github.com/mouse-reeve/placevalue_ascii '''
import math
import argparse
import time
import sys
import os