Skip to content

Instantly share code, notes, and snippets.

@monoidal
monoidal / Q.hs
Created October 10, 2022 11:43
Quines talk
-- Talk about quines, MuniHac 2022
-- https://www.youtube.com/watch?v=Rnji4rZT51s
{-# LANGUAGE DataKinds, TypeFamilies, UndecidableInstances #-}
module Q where
import Prelude hiding (print, putStrLn)
import qualified Prelude
import Language.Haskell.TH.Quote
import Language.Haskell.TH.Syntax
{-
Day 1
-}
{-
docker pull tweag/linear-types
docker run -it tweag/linear-types:latest
-}
{-# LANGUAGE LinearTypes #-}
{-# LANGUAGE UnicodeSyntax #-}
@monoidal
monoidal / gist:77c6dd7490f7c9398db35b35273cc030
Created August 18, 2018 15:16
DatatypeContexts occurrences
I used a copy of Hackage from Jul 26.
The affected packages, sorted by last upload date are:
2007-07-14 StrategyLib-4.0.0.0
2007-10-07 ProbabilityMonads-0.1.0
2008-03-07 HsJudy-0.2
2008-07-30 cedict-0.2.5
2008-08-26 riot-1.20080618
2008-10-11 frag-1.1.2
@monoidal
monoidal / mapgen.hs
Created June 5, 2012 20:32 — forked from splinterofchaos/mapgen.hs
A simple roguelike map generator. Uses naiive splatter pattern to create rooms.
-- based on https://gist.github.com/2874811
import System.Random
import System.Console.GetOpt
import System.Environment(getArgs, getProgName)
import Control.Monad.State
type Rand = State StdGen
rand m = do a <- state next
return (a `mod` m)