This file contains hidden or 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
#!/usr/bin/env stack | |
-- stack --resolver lts-8.0 --install-ghc runghc --package hspec -- -Wall -Werror | |
import Test.Hspec | |
import Data.IORef | |
-- * test should be isolated from other tests - Pass (expected: Pass) ✔ | |
main :: IO () | |
main = hspec $ do |
This file contains hidden or 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
# 1. tests should not leak to sibling describe blocks | |
describe "asdf" do | |
describe "inner 1" do | |
it "works" do | |
expect(defined? @foo).to eql nil | |
end | |
end | |
it "(mutation)" do | |
@foo = true | |
end |
This file contains hidden or 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
/* @flow */ | |
declare class Callable<A, B> { | |
(A): B | |
} | |
class WithFoo<A, B> extends Callable<A, B> { | |
foo() { | |
} | |
} |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import Data.Function ((&)) | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word8, Word32) | |
import Control.Monad.Writer.Lazy | |
import Data.String (fromString) | |
import Control.Arrow |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import Data.Function ((&)) | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word8, Word32) | |
import Control.Monad.Writer.Lazy | |
import Data.String (fromString) | |
import Control.Arrow |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word32) | |
import Data.String (fromString) | |
import Control.Arrow ((>>>)) | |
-- Runs computation once. Persists across ghci sessions. |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word32) | |
import Data.String (fromString) | |
import Control.Arrow ((>>>)) | |
-- Runs computation once. Persists across ghci sessions. |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word32) | |
import Data.String (fromString) | |
import Control.Arrow ((>>>)) | |
-- Runs computation once. Persists across ghci sessions. |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word32) | |
import Data.String (fromString) | |
import Control.Arrow ((>>>)) | |
-- Runs computation once. Persists across ghci sessions. |
This file contains hidden or 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 OverloadedStrings #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
import Prelude | |
import Sound.Tidal.Context | |
import qualified Foreign.Store as ForeignStore | |
import Data.Word (Word32) | |
import Data.String (fromString) | |
-- Runs computation once. Persists across ghci sessions. | |
runOnce :: Word32 -> IO a -> IO a |