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
-- | |
-- Play a song and flash LEDs on alternate notes. | |
-- Lee Pike <lee pike @ gmail . com> (remove spaces) | |
-- See http://leepike.wordpress.com/?p=427 | |
-- BSD3 License | |
-- | |
-- Note timing issues: http://www.arduino.cc/en/Tutorial/PlayMelody | |
-- | |
module CopilotSing where |
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
#include <stdbool.h> | |
#include <stdint.h> | |
#include "WProgram.h" | |
int32_t notes[47] = {1519,1519,1519,1519,1519,1519,1519,1275,1915,1700,1519,1432,1432,1432,1432,1432,1519,1519,1519,1700,1700,1519,1700,1275,1519,1519,1519,1519,1519,1519,1519,1275,1915,1700,1519,1432,1432,1432,1432,1432,1519,1519,1275,1275,1432,1700,1915}; | |
int32_t beats[47] = {1,1,2,1,1,2,1,1,1,1,4,1,1,1,1,1,1,2,1,1,1,1,2,2,1,1,2,1,1,2,1,1,1,1,4,1,1,1,1,1,1,2,1,1,1,1,4}; | |
void playtone(int32_t , int32_t , int32_t); |
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
#include <stdbool.h> | |
#include <stdint.h> | |
void CopilotSing(); | |
extern struct { /* copilotStateCopilotSing */ | |
struct { /* CopilotSing */ | |
int32_t prophVal__idx[2]; | |
bool playNote; | |
int32_t odd; |
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
-- | Takes a .ics file (generated by iCal), finds all the incomplete TODO items, | |
-- and changes them into a format that can be imported into rememberthemilk.com (RTM). | |
-- via email | |
-- <http://www.rememberthemilk.com/help/answers/sending/emailinbox.rtm>. | |
-- Lee Pike <[email protected]> (remove dashes) | |
-- BSD3 License | |
-- | |
-- NO WARRANTY : This program is incomplete and likely buggy. Your mileage my vary. | |
-- |
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
-- Lee Pike | |
-- Trying to understand sharing inside a DSL | |
-- BSD3 | |
module MyDSL where | |
import Data.List | |
import Control.Monad.Reader | |
import Control.Monad.State |
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
-- Odd behavior using stable names: polymorphism with type constraints causes | |
-- non-termination (see the tests at the bottom). | |
module Test where | |
import System.Mem.StableName (StableName, makeStableName) | |
--------------------------------------------------------------------------------- | |
type Map a = [StableName (Expr a)] |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
-- | Ensure constraints are correct for testing for underflow/overflow for | |
-- signed ints. Verified via SMT. | |
-- author : Lee Pike | |
-- date : Jan 2014 | |
-- license: BSD3 | |
--import Data.SBV.Bridge.CVC4 |
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
# swith out a cabal sandbox for one version of a compiler for another. | |
#!/bin/bash | |
set -e | |
if [ -z "$2" ]; then | |
echo usage: $0 ghc-version-from ghc-version-to | |
exit 1 | |
fi |
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
-- Search solution in Haskell to the puzzle | |
-- | |
-- See: http://www.nytimes.com/2015/04/15/science/a-math-problem-from-singapore-goes-viral-when-is-cheryls-birthday.html | |
-- | |
-- Code modified from Levent Erkok's SBV solution | |
-- | |
-- https://gist.github.com/LeventErkok/654a86a3ec7d3799b624 | |
-- | |
-- This code (like Levent's) is in the public domain. | |
-- |
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
module Lib where | |
import Control.Monad | |
import Language.Atom -- (bool, value, atom, E, Atom) | |
import Language.Atom.Elaboration (StateHierarchy(..)) | |
genAtom :: IO () | |
genAtom = do | |
let config = defaults --{ cRuleCoverage = False } |
OlderNewer