Skip to content

Instantly share code, notes, and snippets.

View hdgarrood's full-sized avatar
💭
All of my personal repos are unmaintained

Harry Garrood hdgarrood

💭
All of my personal repos are unmaintained
View GitHub Profile
{"purescript-ace":["0.10.1","0.9.0"],"purescript-ace-halogen":["0.4.0"],"purescript-aff":["0.11.0","0.11.1","0.11.2","0.11.3","0.12.0","0.13.0","0.13.1","0.14.0"],"purescript-aff-coroutines":["0.2.1","0.3.0","0.4.0","0.4.1","0.4.2"],"purescript-affjax":["0.10.0","0.10.1","0.5.0","0.5.1","0.5.2","0.5.3","0.5.4","0.6.0","0.7.0","0.8.0","0.8.1","0.9.0"],"purescript-ansi":["0.1.0","0.1.1","0.1.2","0.1.3"],"purescript-apparch":["0.1.0"],"purescript-argonaut-codecs":["0.5.0","0.5.1","0.5.2","0.6.0","0.6.1"],"purescript-argonaut-core":["0.2.2","0.2.3"],"purescript-argonaut-traversals":["0.6.0","0.7.0"],"purescript-arrays":["0.4.0","0.4.1","0.4.2","0.4.3","0.4.4"],"purescript-arrows":["0.6.0","0.6.1","0.6.2"],"purescript-assert":["0.1.0","0.1.1"],"purescript-base64":["2.0.1","2.0.2"],"purescript-batteries":["0.2.2","0.2.3","0.2.4","0.2.5","0.3.0","0.4.0","0.5.0","0.5.1"],"purescript-behaviors":["0.1.0"],"purescript-benchotron":["2.1.0","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4"],"purescript-bifunctors":["0.4.0"],"puresc
purescript-aff 0.11.0
purescript-batteries 0.2.2
purescript-batteries 0.2.3
purescript-batteries 0.2.4
purescript-batteries 0.2.5
purescript-batteries 0.3.0
purescript-batteries 0.4.0
purescript-batteries 0.5.0
purescript-batteries 0.5.1
purescript-behaviors 0.1.0
@hdgarrood
hdgarrood / Main.purs
Last active February 16, 2016 15:37
`*>` is not `flip <*`!
module Main where
import Prelude
import Data.Monoid
import Control.Apply as Apply
import Control.Monad.Writer
import Control.Monad.Eff.Console (log, print)
main = do
print (runWriter (f "hi" Apply.<* f " world"))

The following packages use operator aliases and appear to have been generated with version 0.8.0 of the compiler. Since the encoding for operator aliases changed in 0.8.1, these need to be regenerated:

  • flare 0.4.3
  • flare 0.5.0
  • difflists 3.0.1-pursuit
  • difflists 3.0.1
  • neon 0.4.0
  • neon 0.4.1
  • nonempty 0.2.0
  • rationals 0.3.1
module Main where
import Prelude
import Data.Maybe (Maybe)
import Data.List (List)
import Control.Monad.Eff.Console (print)
import Control.Comonad.Cofree (Cofree, mkCofree, head, tail)
import Control.Alternative (class Alternative)
import Control.Plus (empty)
module Main where
import Prelude
import Data.Either
import Data.Functor.Compose
import Control.Monad.Eff.Console (print)
class Convert a b where
convert :: a -> b
module Main where
import
Prelude
Data.List (List)
Data.List as List
Control.Monad as Monad
Control.Monad.Eff.Console as Console
main = Console.log (show "hello world")

Dependencies

First you'll need a docker install: https://docs.docker.com/installation/

psci

After installing Docker, we'll run a PureScript psci session by running the 0.6.1.1 image. The -it flags allocate a pseudo tty and make it interactive. We're pulling the image from the default docker hub, so the images are here and the code that builds them is on GitHub

docker run -it biscarch/purescript:0.6.1.1
a9d20f4 Add test for generic deriving with awkward records (Harry Garrood, 54 seconds ago)
diff --git a/examples/passing/RecordLabels.purs b/examples/passing/RecordLabels.purs
new file mode 100644
index 0000000..b58a4bd
--- /dev/null
+++ b/examples/passing/RecordLabels.purs
@@ -0,0 +1,5 @@
+module Main where
+
@hdgarrood
hdgarrood / simplex.py
Last active May 16, 2017 15:50
An extremely naive implementation of the simplex algorithm.
from collections import namedtuple
import numpy as np
# This is an implementation of the version of the simplex algorithm we are
# expected to execute by hand in LPMS. There is just one important difference:
# because python and numpy use zero-based indexing, this does too. So for
# example you need to subtract 1 from each element of your basic and nonbasic
# sets.
LPState = namedtuple("LPState", ["basic", "nonbasic"])