- Don't use partial functions (head, read, tail, fromJust, fail (in IO), error, undefined ... )
- Functions are your friend, use lots of them and keep them small.
- Serialization errors are the most common error in our codebase. When you are creating a JSON, Binary or Serialize instance try and avoid the standard "generator" functions.
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 MultiWayIf #-} | |
module Main where | |
import Control.Monad.IO.Class (liftIO) | |
import Data.Conduit (($$), (=$=), (=$) | |
, Conduit, Sink, Source | |
, await, yield) | |
import qualified Data.Conduit.List as CL | |
import Data.Sequence |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Add leaflet css --> | |
<link | |
rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" | |
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" | |
crossorigin="" | |
/> |
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
module Main | |
data Free : (f : Type -> Type) -> (a : Type) -> Type where | |
Pure : a -> Free f a | |
Bind : f (Free f a) -> Free f a | |
instance Functor f => Functor (Free f) where | |
map f (Pure x) = Pure (f x) | |
map f (Bind x) = assert_total (Bind (map (map f) x)) |
- General Background and Overview
- Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
- Models and Issues in Data Stream Systems
- Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
- Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
- [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep
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
module Promise where | |
import Control.Applicative (Applicative(..)) | |
import Data.Monoid (Monoid(..)) | |
newtype Error = Error { unString :: String } deriving (Eq, Ord, Read, Show) | |
data Promise a = Failed Error | Deferred | Fulfilled a | |
deriving (Eq, Ord, Read, Show) |
CAUTION: this rant has not been proof-read to any extent at all
The condenscension police are here, with their double-standards and unquestionable claim to a moral high-ground. Persistently engaged in disgusting conduct, I ask, "do they ever look at themselves?"
I know the answer to this question. I tested it. At one point in time, I was concerned that the charge directed at me had merit. Were they right? Were they a bit wrong, but mostly right? I wanted to know the answer to this question. No, I really really wanted to know it. So I invested some effort toward answering
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 RankNTypes #-} | |
module Functor where | |
import Prelude( | |
foldr | |
, (.) | |
, Maybe(Nothing, Just) | |
, maybe | |
) |
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 #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# OPTIONS_GHC -fwarn-missing-methods #-} | |
module Err where | |
import Control.Lens | |
import Control.Monad.Error | |
import Control.Monad.Error.Lens | |
-- Here is a fairly typical situation, where we have low level errors in certain |
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
module queue | |
import Data.Vect | |
-- Here's the port of the Liquid Haskell blog post on amortized | |
-- queues. The tricksy bit is that the "amortized" bit depends on | |
-- laziness. This means that while in the REPL (where Idris is lazy) | |
-- this is reasonably efficient. It compiles absolutely horribly | |
-- though because each time push or pop something we rotate the whole | |
-- damned thing. |