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
:- %say | |
|= $: * | |
[ben=?(%put %vip %get %bot %del) ~] | |
[min=(list (pair @ @)) mit=(pry @ _~) nit=_| ~] | |
== | |
:- %noun | |
:: +up benchmarks | |
:: | |
=/ pi (up @ _~) | |
:: |
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
worker_send_replace 47276 hole | |
worker_send_replace 47276 crud | |
%hole event failed: | |
bail: exit | |
/:<[18.151 15].[18.169 27]> | |
/:<[18.152 15].[18.169 27]> | |
/:<[18.153 15].[18.169 27]> | |
/:<[18.153 31].[18.153 46]> | |
/:<[18.224 3].[18.237 13]> | |
/:<[18.225 3].[18.237 13]> |
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 DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Applicative.Free | |
import Control.Monad | |
import Control.Monad.Free | |
import Control.Monad.Primitive | |
import System.Random.MWC.Probability (Prob) | |
import qualified System.Random.MWC.Probability as MWC |
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
-- see: http://matt.might.net/articles/cps-conversion | |
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import Data.Monoid | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Data.Unique | |
import qualified Text.PrettyPrint.Leijen.Text as PP |
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 DeriveFunctor #-} | |
import Data.List.Ordered (merge) | |
import Data.Functor.Foldable | |
import Prelude hiding (Foldable, succ) | |
data NatF r = | |
ZeroF | |
| SuccF r | |
deriving (Show, Functor) |
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 LambdaCase #-} | |
{-# LANGUAGE TypeFamilies #-} | |
import Control.Comonad.Cofree | |
import Control.Monad.Free | |
import Data.Functor.Foldable | |
oddIndices :: [a] -> [a] | |
oddIndices = histo $ \case | |
Nil -> [] |
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 BangPatterns #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE RecordWildCards #-} | |
import Control.Comonad | |
import Control.Comonad.Cofree | |
import Control.Monad | |
import Control.Monad.ST |
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 DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Monad | |
import Control.Monad.Free | |
import qualified System.Random.MWC.Probability as MWC | |
data ModelF r = | |
BernoulliF Double (Bool -> r) | |
| BetaF Double Double (Double -> r) |
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 DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Prelude hiding (succ) | |
newtype Fix f = Fix (f (Fix f)) | |
deriving instance (Show (f (Fix f))) => Show (Fix f) |
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 Metropolis where | |
import Control.Monad | |
import Control.Monad.Primitive | |
import System.Random.MWC as MWC | |
import System.Random.MWC.Distributions as MWC | |
propose :: [Double] -> Gen RealWorld -> IO [Double] | |
propose location gen = traverse (perturb gen) location where |
NewerOlder