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 NoMonomorphismRestriction #-} | |
{-# OPTIONS_GHC -F -pgmF she #-} | |
import Control.Applicative hiding (empty) | |
import Control.Monad.Trans | |
import Control.Monad.Trans.Cont | |
import Control.Monad.Identity | |
import Data.Maybe | |
main :: IO () |
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 DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad | |
import Data.Aeson | |
import qualified Data.ByteString.Lazy as B | |
{- Generic Language extension -} | |
import GHC.Generics (Generic) | |
data Pull = Pull { |
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
Process 28432 attached with 28 threads - interrupt to quit | |
[pid 25696] futex(0xc2101a70e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25695] futex(0xc2109688e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25694] restart_syscall(<... resuming interrupted call ...> <unfinished ...> | |
[pid 25693] futex(0xc2106b88e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25678] restart_syscall(<... resuming interrupted call ...> <unfinished ...> | |
[pid 25677] futex(0xc21086f8e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25676] futex(0xc21086d0e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25675] futex(0xc2102948e8, FUTEX_WAIT, 0, NULL <unfinished ...> | |
[pid 25674] futex(0xc2102920e8, FUTEX_WAIT, 0, NULL <unfinished ...> |
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 ConstraintKinds #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# OPTIONS_GHC -Wall #-} |
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
{ | |
"folders": | |
[ | |
{ | |
"follow_symlinks": true, | |
"path": ".", | |
"file_exclude_patterns": [ | |
"cabal.sandbox.config", | |
"*.hi", | |
"*.o", |
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 PatternSynonyms #-} | |
module List where | |
import Control.Applicative | |
import Control.Monad.State | |
import Data.Foldable | |
import Data.Monoid | |
import System.Random | |
import Control.Monad.Free |
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
filter' : (a -> Bool) -> Vect n a -> (p ** Vect p a) | |
filter' _ Nil = (_ ** []) | |
filter' p (x :: xs) with (filter' p xs) | |
| (_ ** xs') = if (p x) then (_ ** x :: xs') else (_ ** xs') | |
{- | |
When elaborating right hand side of Main.filter': | |
Can't convert | |
Int |
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 ForeignFunctionInterface #-} | |
module Main where | |
import Foreign.C.Types | |
import Control.Monad (when) | |
main :: IO () | |
main = loop 10 | |
where | |
loop n = when (n > 0) $ do | |
putStr $ "loop #" ++ show n ++ ": " |
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
def command(cmd, &block) | |
puts "Running #{cmd}" | |
PTY.spawn(cmd) {|stdout, stdin, pid| | |
begin | |
block.yield(stdout) | |
rescue Errno::EIO | |
puts "Errno::EIO" | |
end | |
} | |
rescue PTY::ChildExited |
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
import Control.Applicative ((<$>), (<$)) | |
import Data.Monoid (Last(..), (<>)) | |
import Data.Sequence ((<|)) | |
import qualified Data.Foldable as Fold | |
import qualified Data.Sequence as Seq | |
import Data.AffineSpace (AffineSpace(..), (.-^)) | |
import FRP.Sodium |