This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
Day 1 | |
-} | |
{- | |
docker pull tweag/linear-types | |
docker run -it tweag/linear-types:latest | |
-} | |
{-# LANGUAGE LinearTypes #-} | |
{-# LANGUAGE UnicodeSyntax #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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) |