Skip to content

Instantly share code, notes, and snippets.

View lock-s.diff
< subq $16, %rsp
> subq $32, %rsp
< movl $0, (%rax)
> movq %rax, -16(%rbp)
> movl $0, -20(%rbp)
> movl -20(%rbp), %eax
mjhoy / 0_GSet.hs
Last active February 28, 2019 01:48
View 0_GSet.hs
module GSet where
import Prelude hiding (lookup)
import Test.Hspec
data GSet a = GSet [a]
emptySet :: GSet a
emptySet = GSet []
View Composition.hs
{-# LANGUAGE NoImplicitPrelude #-}
module Composition where
import Prelude (undefined, String, Show)
data Airport = Airport
{ iata :: String
, timezone :: String
} deriving (Show)
View oddity.purs
mapSpec = do
describe "foo" $ do
it "should be foo" $ do
let m = insert "duration" "4" $
insert "durationUnit" "Hour(s)" $
insert "lat" "44.97" $
insert "lng" "-93.265" $
insert "loc" "Minneapolis" $
insert "sortBy" "cheapest" Map.empty
m1 = Map.fromFoldable (Map.toUnfoldable m :: Array (Tuple String String))
View ghc-error.txt
<no location info>: error:
ghc: panic! (the 'impossible' happened)
(GHC version 8.0.2 for x86_64-apple-darwin):
Simplifier ticks exhausted
When trying UnfoldingDone pokeN_XpTQ
To increase the limit, use -fsimpl-tick-factor=N (default 100)
If you need to do this, let GHC HQ know, and what factor you needed
To see detailed counts use -ddump-simpl-stats
Total ticks: 77963
View loop.purs
module TestTime where
import Prelude
import Thermite as T
import Control.Monad.Aff (later')
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (log, CONSOLE)
import Control.Monad.Eff.Now (NOW, nowDateTime)
import Control.Monad.Maybe.Trans (runMaybeT)
import Control.Monad.Rec.Class (forever)
View liftEff.purs
module Test where
import Prelude
import Thermite as T
import Control.Monad.Eff.Class (liftEff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Trans (lift)
type State = { i :: Int }
data Action = MyAction
View pulp build output thermite
[mjhoy@mjh-air-2 client]$ pulp build
* Building project in /Users/mjhoy/proj/frootloop/client
Error found:
in module Control.Monad.Aff.Console
at /Users/mjhoy/proj/frootloop/client/bower_components/purescript-aff/src/Control/Monad/Aff/Console.purs line 36, column 1 - line 36, column 34
No type class instance was found for
Control.Monad.Eff.Class.MonadEff ( console :: CONSOLE
View pulp server output
[mjhoy@mjh-air-2 client]$ pulp server
* Server listening on http://localhost:1337/
* Invalid option `--require-path=../'
Usage: psc [FILE] [-o|--output ARG] [--no-tco] [--no-magic-do] [--no-opts]
[-v|--verbose-errors] [-c|--comments] [--source-maps] [--dump-corefn]
[-p|--no-prefix] [--json-errors]
Hash: 3ef54b8f9609f9e9c044
mjhoy / if-bound.hs
Created November 11, 2015 18:47
View if-bound.hs
ifBound :: SnapletISplice b
ifBound = do
inp <- getParamNode
let t = X.getAttribute "tag" inp
case t of
Nothing -> return mempty
Just t' -> do
st <- getHS
let s = lookupSplice t' st
case s of