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 RecordWildCards #-} | |
module Orbits where | |
import Units | |
import Vec | |
data OrbitalElements | |
= OrbitalElements |
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
FROM centos:6.4 | |
# Install wget for fetching Haskell dependencies | |
RUN yum install -y wget | |
# Install dependencies for GHC and core Haskell libraries | |
RUN yum install -y libbsd-devel gmp-devel gmp zlib-devel | |
# Install tools needed for installing GHC and Cabal-install | |
RUN yum install -y make perl gcc |
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 Data.Array | |
waterVolume :: Array Int Int -> Int | |
waterVolume arr = go 0 minB maxB where | |
(minB,maxB) = bounds arr | |
go !acc lpos rpos | |
| lpos >= rpos = acc | |
| leftHeight < rightHeight = segment leftHeight 1 acc lpos contLeft | |
| otherwise = segment rightHeight (-1) acc rpos contRight |
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 ConcurrencyExamples where | |
import Control.Concurrent | |
import Control.Concurrent.STM | |
import Control.Monad | |
import Control.Applicative | |
import System.Random | |
example1 :: IO () | |
example1 = do |
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.exports = (grunt) -> | |
grunt.initConfig | |
coffee: | |
compile: | |
files: | |
"public/js/modules/*.js": "src/coffee/**/*.coffee" | |
options: | |
flatten: false | |
bare: false |
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
s x y z = x z (y z) | |
k x y = x | |
i = s k k | |
c = s (s (k (s (k s) k)) s) (k k) | |
b = s (k s) k | |
hello = | |
s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s | |
b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(c k)))))))))))))))))))))))))))))))))))))))))) | |
)))))))))))))))))))))))))))(s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s |
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
quotedString :: Parser String | |
quotedString = char '"' *> many (escaped <|> nonQuote) <* char '"' where | |
escaped = char '\\' *> anyChar | |
nonQuote = charIf (/= '"') |
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 TypeOperators, NoImplicitPrelude #-} | |
import qualified Data.List as L | |
import Control.Arrow | |
import Control.Monad | |
import Prelude (Bool, Int, Float, fst, snd, flip, ($), uncurry, Show(..), String, (.), otherwise, IO) | |
import qualified Prelude as P | |
data s :. a = !s :. !a | |
infixl 1 :. |
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 TemplateHaskell, QuasiQuotes #-} | |
import Data.Graphs.DSL.TH | |
thExample = [digraph| | |
a | |
b -> c | |
e <-> c | |
|] |
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 TemplateHaskell, FlexibleInstances #-} | |
module CustomShow where | |
import Language.Haskell.TH | |
import Data.List (intercalate) | |
emptyShow :: Name -> Q [Dec] | |
emptyShow name = [d|instance Show $(conT name) where show _ = ""|] |
NewerOlder