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 PackageImports #-} | |
| import "mtl" Control.Monad.State | |
| data BinTree a = Tip | Node (BinTree a) a (BinTree a) deriving Show | |
| conv :: Int -> State [a] (BinTree a) | |
| conv 0 = return Tip | |
| conv len = liftM3 Node leftTree pop rightTree | |
| where leftTree = conv mid | 
  
    
      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
    
  
  
    
  | A quick TCP log of a local MPD server chatting it up with Theremin. | |
| ~: socat -v tcp4-l:12345 tcp4:localhost:6600 | |
| < 2011/03/10 23:04:28.238351 length=14 from=0 to=13 | |
| OK MPD 0.15.0 | |
| > 2011/03/10 23:04:28.238800 length=9 from=0 to=8 | |
| commands | |
| < 2011/03/10 23:04:28.239075 length=1176 from=14 to=1189 | |
| command: add | |
| command: addid | 
  
    
      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
    
  
  
    
  | from gevent import monkey | |
| monkey.patch_all() | |
| from gevent import Greenlet | |
| from gevent.queue import Queue | |
| from gevent.pool import Group | |
| def merge_generators(*args): | |
| def enqueue(generator): | |
| for item in generator(): | 
  
    
      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
    
  
  
    
  | jsc = require('jsverify'); | |
| (function() { | |
| arbitraryPositiveInteger = jsc.nat.smap( | |
| function (n) {return n + 1;}, | |
| function (n) {return n - 1;} | |
| ); | |
| describe('test with arbitrary array and two smapped arbitrary params', | |
| function() { | 
  
    
      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
    
  
  
    
  | -- based on "FizzBuzz in Haskell by Embedding a Domain-Specific Language" | |
| -- by Maciej Piróg | |
| -- https://themonadreader.files.wordpress.com/2014/04/fizzbuzz.pdf | |
| -- and "skiphaltprint" by Mathias Verraes | |
| -- https://github.com/mathiasverraes/skiphaltprint | |
| module Main where | |
| import Prelude | |
| import Control.Monad.Eff (Eff, forE) | |
| import Control.Monad.Eff.Console (CONSOLE, log) |