Skip to content

Instantly share code, notes, and snippets.

@codecurve
codecurve / LensIsomorphism.hs
Last active August 29, 2015 14:07 — forked from Javran/gist:9593215
Isomorphism using Lens
{-# LANGUAGE DeriveFunctor, RankNTypes #-}
import Data.Char
import Data.List
import Control.Lens
type Invertible a b = Simple Iso a b
{- translation table
@codecurve
codecurve / One-to-many C++ Pattern
Last active August 29, 2015 14:07
One-to-many pattern in C++ 11 - Exploring std::reference_wrapper in the context of a pattern for a one-to-many relationship with ownership in C++. (See http://codereview.stackexchange.com/a/63821/53507)
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <iostream>
using namespace std;
class Question;
@codecurve
codecurve / CellML generated C++ header
Last active August 29, 2015 14:05
Example of IDL generated C++ header using modified version of CellML-API's simple c++ OmniIdl back-end.
/*
* Copyright (C) 2004-2014 by The Auckland Bioengineering Institute at the University
* of Auckland.
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Generated using: omniidl -bsimple_cpp -K -Iinterfaces -p/somepath/cellmlapi/simple_interface_generators/omniidl_be /somepath/cellmlapi/interfaces/CellML_APISPEC.idl