I hereby claim:
- I am soareschen on github.
- I am soareschen (https://keybase.io/soareschen) on keybase.
- I have a public key ASBFlptlH9b-PeBx6_1vQOQoQ-_rUPKhr-kSRwSkf4znswo
To claim this, I am signing this object:
/* | |
This code snippet demonstrates how to do metaprogramming | |
in JavaScript using proxy and with statement. | |
Run this in non-strict mode. | |
*/ | |
const proxy = new Proxy({}, { | |
get(target, key) { | |
if(key === Symbol.unscopables) return {} | |
return `${key.toUpperCase()} ` | |
}, |
I hereby claim:
To claim this, I am signing this object:
This gist explains the steps required to install CUDA on Ubuntu 16.04 as well as enabling it inside LXD containers.
The setup assumes GTX 10 series hardware, tested with my GTX 1070.
Download the latest Nvidia driver at http://www.nvidia.com/Download/index.aspx.
On 64-bit systems, install 32-bit OpenGL libaries first so that the driver will install
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE ImplicitParams #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
import GHC.Exts | |
-- Dict Typing - Duck Typing in Haskell using dictionaries and implicits |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ImplicitParams #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
import GHC.Exts | |
-- A handler holds a function that takes in any a that | |
-- satisfies constraint p. Note that we are simply returning | |
-- string in here for the sake of simplifying the demo. |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE ExplicitForAll #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} |
module Main where | |
import Prelude | |
import Data.Record | |
import Control.Monad.Eff (Eff) | |
import Control.Monad.Eff.Console (CONSOLE, log) | |
fooHandler :: forall r. { foo :: String | r } -> String | |
fooHandler args = "(foo-handler " <> args.foo <> ")" |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE DuplicateRecordFields #-} | |
{-# LANGUAGE FunctionalDependencies #-} |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ExplicitForAll #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
import GHC.Exts |
{ | |
"parserOptions": { | |
"ecmaVersion": 7, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"rules": { | |
"no-undef": 1, |