Skip to content

Instantly share code, notes, and snippets.

View adinapoli's full-sized avatar
🐘

Alfredo Di Napoli adinapoli

🐘
View GitHub Profile
@adinapoli
adinapoli / bug.md
Created January 6, 2015 14:22
ghc bug?
@adinapoli
adinapoli / stream.rs
Created December 18, 2014 09:34
rust simple streamer
fn main() {
const BUFSIZE: uint = 500000;
let buf = &mut[0u8, .. BUFSIZE]; //500k buffer
loop {
let read_bytes = std::io::stdin().lock().read(buf);
match read_bytes {
Ok(v) =>
if v == BUFSIZE {
@adinapoli
adinapoli / steps.md
Last active May 25, 2023 08:35
dyamic linking woes on Mac OS X Mavericks and GHC 7.8.3

Steps to reproduce

mkdir repro
cd repro
cabal get snappy
cd snappy-0.2.0.2
brew install snappy
cabal sandbox init
cabal install
{-# LANGUAGE RebindableSyntax, OverloadedStrings #-}
module Chronos.Foreign.Reflection where
import Fay.Text (Text, fromString)
import JQuery
import Prelude
import HTML
import qualified Fay.Text as T
import FFI
import qualified CodeMirror as CM
{-# LANGUAGE OverloadedStrings #-}
module Haste.JQuery where
import Haste.Foreign
import Haste.JSON
import Haste.Prim
import Haste hiding (Event)
--------------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
module Haste.JQuery where
import Haste.Foreign
import Haste.JSON
import Haste.Prim
import Haste hiding (Event)
--------------------------------------------------------------------------------
@adinapoli
adinapoli / default.nix
Created July 25, 2014 09:33
default.nix
let
pkgs = import <nixpkgs> {};
ghc = pkgs.ghc.ghc783;
myCabal = pkgs.haskellPackages.cabal.override {
extension = self : super : {
self.hyperlinkSource = false;
};
};
hsEnv = pkgs.haskellPackages.ghcWithPackages (hsPkgs : ([
myCabal
@adinapoli
adinapoli / gist:a08683a32412c8fddb43
Last active August 29, 2015 14:02
tentative (non-working) patch
From 68cebd2b5fc2ef449e725dfe08d857e43d61dd97 Mon Sep 17 00:00:00 2001
From: Alfredo Di Napoli <[email protected]>
Date: Thu, 19 Jun 2014 08:54:06 +0200
Subject: [PATCH] Tweaked docsym and Lexer as tentative fix for #8226
---
compiler/main/HeaderInfo.hs | 4 ----
compiler/parser/Lexer.x | 6 +-----
2 files changed, 1 insertion(+), 9 deletions(-)
@adinapoli
adinapoli / gist:7bce04c56325d5bd9c47
Last active August 29, 2015 14:01
Working shell
let
pkgs = import <nixpkgs> {};
ghc = pkgs.ghc.ghc782;
hsEnv = pkgs.haskellPackages.ghcWithPackages (hsPkgs : ([
hsPkgs.cabal
hsPkgs.happy
hsPkgs.alex
hsPkgs.cabalInstall_1_20_0_1
]));
-- Sources:
-- http://www.haskellforall.com/2012/09/the-functor-design-pattern.html
-- http://www.haskell.org/haskellwiki/Functor
-- http://learnyouahaskell.com/functors-applicative-functors-and-monoids
-- Hide pre-existing Maybe and map function from Prelude.
import Prelude hiding (Maybe (..), map)
-- Import the Monadic composition operator.