Skip to content

Instantly share code, notes, and snippets.

View pchiusano's full-sized avatar

Paul Chiusano pchiusano

View GitHub Profile
package com.spinoco
import scalaz.stream.{Exchange, process1, Process}
import scalaz.stream.Process._
import scalaz.concurrent.Task
import scalaz.{-\/, \/-, \/}
/**
* Created by pach on 18/01/14.
*/
@copumpkin
copumpkin / Mutable.hs
Last active December 23, 2015 14:09
Mutable buffered Iteratee-like things. Goal is to let me reuse the input "chunks" but to prevent users from hanging onto them and seeing data they shouldn't see. Does it work? You can leak the MVector reference in an existential but then you can't do anything with it, right?
{-# LANGUAGE RankNTypes, BangPatterns #-}
module Mutable where
import Control.Monad
import Control.Monad.ST
import Data.STRef
import Data.Vector.Mutable (MVector)
import qualified Data.Vector.Mutable as MV
-- A read-only view into an MVector or similar