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 ScopedTypeVariables #-} | |
module Rendering.CLGLBuffer where | |
import Control.Parallel.CLUtil | |
import Foreign.Ptr (nullPtr) | |
import Foreign.Storable (Storable(sizeOf)) | |
import Graphics.GLUtil.BufferObjects | |
import Graphics.Rendering.OpenGL (deleteObjectName, BufferObject, BufferTarget(..)) | |
import Rendering.CLGLInterop | |
data CLGLBuffer a = CLGLBuffer { asVBO :: BufferObject |
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 DataKinds, FlexibleContexts, TypeOperators #-} | |
import Control.Monad.State | |
import Data.Vinyl | |
type OuterData = '("Outer", String) | |
type InnerData = '("Inner", String) | |
outerData :: SField OuterData | |
outerData = SField |
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 OverloadedStrings, QuasiQuotes, RankNTypes #-} | |
{-# LANGUAGE DataKinds, FlexibleContexts, TemplateHaskell, TypeOperators #-} | |
import Frames | |
import Frames.ColumnUniverse | |
import Frames.CSV | |
import Lens.Family | |
import Pipes | |
-- Manually declared columns using a TH helper | |
declareColumn "x2" ''Double |
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, TupleSections #-} | |
-- |A Haskell program that demonstrates a simple "Hello, world!" | |
-- application using genetic algorithms. Based on code by John Svazic. | |
-- | |
-- Author: Anthony Cowley | |
import Control.Applicative | |
import Control.Arrow (second) | |
import Control.Monad (liftM, replicateM) | |
import Control.Monad.Random |
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 ForeignFunctionInterface #-} | |
module Renderer.CLGLInterop (initFromGL) where | |
import Control.Parallel.CLUtil | |
import Foreign.Ptr (nullPtr, Ptr) | |
foreign import ccall "CGLGetCurrentContext" | |
cGLGetCurrentContext :: IO (Ptr ()) | |
foreign import ccall "CGLGetShareGroup" | |
cGLGetShareGroup :: Ptr () -> IO (Ptr ()) |
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
(* Ported from Dan Peebles's proof at: https://gist.github.com/2356060 *) | |
Module SquaredTriangular. | |
Require Import Arith. | |
Definition N := nat. | |
(* Sigma notation for expressing sums. *) | |
Fixpoint Σ (x : N) (f : N -> N) : N := | |
match x with | |
| 0 => 0 |
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
name: cabal-test-test | |
version: 0.1.0.0 | |
build-type: Simple | |
cabal-version: >=1.8 | |
-- Library source in "src/lib", Internal module in "src/misc" | |
library | |
exposed-modules: MyLib.Foo | |
other-modules: MyLib.Internal.Bar | |
hs-source-dirs: src/lib, src/misc |
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 DataKinds, TypeFamilies, UndecidableInstances #-} | |
import Control.Monad (join) | |
import Criterion.Main | |
import Data.Functor.Identity | |
import Data.Vinyl | |
import Data.Vinyl.TypeLevel | |
class Eq2 a where | |
eq2 :: a -> a -> Bool |
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 ScopedTypeVariables #-} | |
import Data.Binary.Builder | |
import Data.Binary.Builder.Internal | |
import Foreign.Ptr (castPtr) | |
import Foreign.Storable (Storable(sizeOf,poke)) | |
-- For testing | |
import Linear | |
import Data.ByteString.Lazy (ByteString) | |
import Data.Monoid ((<>)) |
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 DataKinds, FlexibleContexts, TypeOperators #-} | |
import Data.Vinyl | |
type Model = "model" ::: String | |
model :: Model | |
model = Field | |
type Car = PlainRec ["company":::String, Model, "year":::Int] |
OlderNewer