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 QuasiQuotes, TemplateHaskell, ScopedTypeVariables #-} | |
module BakedVector where | |
import qualified Data.ByteString.Lazy as BSL | |
import Data.ByteString.Lazy (unpack) | |
import Data.ByteString.Builder (toLazyByteString) | |
import Data.ByteString.Builder.Prim | |
import Foreign.Storable | |
import qualified Data.Vector.Storable as VS |
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 reornament | |
-- Idris translation of Agda code: | |
-- https://gist.github.com/gallais/e507832abc6c91ac7cb9 | |
-- Which follows Conor McBride's Ornaments paper: | |
-- https://personal.cis.strath.ac.uk/conor.mcbride/pub/OAAO/Ornament.pdf | |
ListAlg : Type -> Type -> Type | |
ListAlg A B = (B, A -> B -> B) |
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 ActiveSupport::Concern | |
def append_features(base) | |
if base.instance_variable_defined?("@_dependencies") | |
base.instance_variable_get("@_dependencies") << { :module => self, :method => :include } | |
return false | |
else | |
return false if base < self | |
@_dependencies.each { |dep| base.send(dep[:method], dep[:module]) } | |
super | |
base.extend const_get("ClassMethods") if const_defined?("ClassMethods") |
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
// | |
// Fibonacci generator in C with Y-Combinator powered memoization. | |
// | |
// Written by Kenneth Ballenegger in 2013 | |
// | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <Block.h> |
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
#include <cassert> | |
#include <iostream> | |
template<typename T, typename R=void> | |
struct ExtMethod { | |
ExtMethod& operator - () { | |
return *this; | |
} | |
template<typename U> |
NewerOlder