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
| #!/bin/bash | |
| #----- | |
| # Test to see if drip picks up classpath changes. | |
| # | |
| # NB: For safety, create a new directory in which to execute this script! | |
| # | |
| # The drip utility (https://github.com/flatland/drip) is a way to launch a JVM | |
| # quickly. It works by keeping "a fresh JVM spun up in reserve with the | |
| # correct classpath and other JVM options". | |
| # |
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
| ;---------------------------------------; | |
| ; JONATHAN MERRITT'S EMACS STARTUP FILE ; | |
| ;---------------------------------------; | |
| ; Setup: | |
| ; | |
| ; 1. Create vendor directory: | |
| ; > mkdir -p ~/.emacs.d/vendor | |
| ; | |
| ; 2. Install milkypostman/powerline (cute status bar / modeline): | |
| ; > cd ~/.emacs.d/vendor |
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
| import scala.collection.immutable._ | |
| object TypeclassProjection { | |
| trait Show[T] { | |
| def show(t: T): String | |
| } | |
| object Show { | |
| def apply[T](showFn: T => String): Show[T] = new Show[T] { def show(t: T): String = showFn(t) } | |
| } |
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
| -- in ~/.config/yi/yi.hs | |
| import Data.Monoid ((<>)) | |
| import Yi (Attributes(..), Config, UIConfig(..), configUI, defaultEmacsConfig, emptyAttributes, override, yi) | |
| import Yi.Style (Color(..), UIStyle(..), grey, withBg, withFg) | |
| import Yi.Style.Library (defaultTheme) | |
| config :: Config | |
| config = defaultEmacsConfig | |
| { configUI = (configUI defaultEmacsConfig) |
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
| import Data.Monoid (Monoid(..)) | |
| {- | |
| Summary | |
| If we have a type, 'a', and some monoid defined for 'a', then 'Operation' is an AST representing | |
| computations that could be done by the monoid. 'Operation' can represent something like | |
| [ 1, 2, 3 ] ++ ( [4, 5, 6] ++ [] ) | |
| or |
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
| // (This is an older version of the Gist here: https://gist.github.com/lancelet/0d0713af7eb1401c9b1a) | |
| // (Only hanging around because I posted it to a Gitter group.) | |
| // Intended to be run in shapeless current master sbt console; use :paste | |
| //--- paste this first to define the macro | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros.whitebox | |
| import scala.util.control.NonFatal |
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
| // Intended to be run in shapeless sbt console; use :paste | |
| //--- paste this first to define the macro | |
| import scala.language.experimental.macros | |
| import scala.reflect.macros.whitebox | |
| import scala.util.control.NonFatal | |
| object WillBeTrue { |
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
| #! /usr/bin/env nix-shell | |
| #! nix-shell -i runghc -p 'ghc.withPackages (ps: [ ps.hmatrix ])' | |
| import Numeric.LinearAlgebra | |
| -- | Represents the coupled ODEs (Example (1)): | |
| -- | |
| -- y[0] = position = p | |
| -- y[1] = velocity = v | |
| -- |
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 #-} | |
| module Main where | |
| import Control.Parallel.OpenCL | |
| import Data.Vector.Storable (Vector) | |
| import qualified Data.Vector.Storable as V | |
| import Data.Vector.Storable.Mutable (IOVector) | |
| import qualified Data.Vector.Storable.Mutable as MV | |
| import Foreign (castPtr, nullPtr, sizeOf) | |
| import Foreign.C.Types (CFloat) |
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
| #!/usr/bin/env stack | |
| {- stack | |
| script | |
| --resolver lts-12.19 | |
| --package containers | |
| --package double-conversion | |
| --package text | |
| --package text-show | |
| -} | |
| {- |
OlderNewer