This file contains 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
#! /usr/bin/env ocamlscript | |
Ocaml.ocamlflags := ["-thread"]; | |
Ocaml.packs := [ "core" ] | |
-- | |
open Core.Std | |
type term = | |
| Ident of string | |
| Lambda of string * term | |
| Apply of term * term |
This file contains 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
import Control.Monad | |
import Control.Monad.ST | |
import Data.Array.MArray | |
import Data.Array.ST | |
import Data.STRef | |
import Prelude hiding (id) | |
data UnionFind s = UnionFind { | |
ids:: STUArray s Int Int |
This file contains 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 CombinatorParser where | |
import Control.Monad | |
import Data.Char | |
-- FUNCTIONAL PEARLS: Monadic Parsing in Haskell | |
-- http://eprints.nottingham.ac.uk/223/1/pearl.pdf | |
newtype Parser a = Parser { parse :: (String -> [(a, String)]) } |
This file contains 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
odule Eval where | |
import Control.Monad.Identity | |
import Control.Monad.Error | |
import Control.Monad.Reader | |
import Control.Monad.State | |
import Control.Monad.Writer | |
import Data.Maybe | |
import qualified Data.Map as Map |
This file contains 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 EmptyDataDecls #-} | |
module Hello where | |
import FFI | |
data Http | |
data HttpServer | |
data Request | |
data Response |
This file contains 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
using System; | |
namespace Option | |
{ | |
public abstract class Option<T> | |
{ | |
public abstract T Value { get; } | |
public abstract bool IsSome { get; } |
This file contains 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
pub struct TransactionGroup { | |
/// Nonce. | |
pub nonce: U256, | |
/// Amount of CCC to be paid as a cost for distributing these transactions to the network. | |
pub fee: U256, | |
/// Transactions | |
pub transactions: Vec<Transaction>, | |
/// Mainnet or Testnet | |
pub network_id: u64, | |
} |
This file contains 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
pub struct AssetOutPoint { | |
pub transaction_hash: H256, | |
pub index: usize, | |
pub asset_type: H256, | |
pub amount: u64, | |
} |
This file contains 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 NamedFieldPuns #-} | |
import Control.Monad (when) | |
import qualified Data.ByteString.Char8 as BSC | |
import Data.Default.Class (def) | |
import Data.Monoid ((<>)) | |
import System.IO.Error (ioError, userError) | |
import Data.X509 (CertificateChain (..), HashALG(..)) | |
import Data.X509.CertificateStore (makeCertificateStore) |
This file contains 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 FlexibleInstances #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module Beard.DOM | |
( Element(..) | |
, Node(..) | |
, parseDOM | |
) where | |
import Control.Monad (when) |
NewerOlder