Skip to content

Instantly share code, notes, and snippets.

View expr.cpp
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[]){
string in(argv[1]);
long res=0;
int pn = 0;
for(auto i=in.begin(); i!=in.end(); ++i){
View withdraw.hs
import Control.Monad.State.Lazy
import Control.Monad.Error
import Data.Char
type BalanceT e s m a = ErrorT e (StateT s m) a
type Balance a = BalanceT BalanceError Double IO a
data BalanceError = AmountIsNegative | NotEnoughBalance | InvalidCommand String | BalanceError String deriving Show
instance Error BalanceError where
View barrier.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[]){
MPI_Init(&argc, &argv);
int size, rank;
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
int data;
View pi.cpp
#include <math.h>
#include <mpich-devel-clang/mpi.h>
#include <iostream>
using namespace std;
int main(int argc, char* argv[]){
int n, rank, size, i;
// PI25DT is used for computing error
View haddock.py
import logging
import os
import errno
import shutil
from urlparse import urlparse, urlunparse
from bs4 import BeautifulSoup
from . import types
from .base import _BaseParser
import re
View fp.cpp
#include <iostream>
int doAdd(int (*call)(int,int)) {
return call(1,2);
}
int main() {
struct Add {
static int add(int a, int b) {
return a + b;
View issues.txt
fficxx issues:
1. simpleBuilder hard coded snappy specific code. -- Patched but not tested
2. resource management issue in C shim code(returned objects and references are converted to pointers, then use ForeignPtr on the Haskell), this probably will cause a critical bug.
3. fficxx currently doesn't deal with global variables
4. Multiple packages for one C++ project
5. enumeration and class support is not implemented (in swig branch)
6. interface to C++ in the C shim code is not fully implemented
7. need to support function pointers
8. finish top-level functions
View class.diff
*** Class2.hs 2013-07-30 17:30:58.000000000 -0400
--- Class.hs 2013-07-09 13:30:42.000000000 -0400
*************** import System.FilePath
*** 24,186 ****
import FFICXX.Generate.Util
-- | C types
! data PrimitiveTypes c = CPTChar
! | CPTInt
! | CPTLong