#!/usr/bin/env nix-shell
#nix-shell -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [ mwc-random ])" -i runghc
{-# LANGUAGE ScopedTypeVariables #-}
import System.Random.MWC
import Data.Vector.Unboxed
import Control.Monad.ST
main = do
vs <- withSystemRandom $
\(gen::GenST s) -> uniformVector gen 20 :: ST s (Vector Int)
print vs
-
-
Save heath/5df7b0df76bad1f0f61e4a15d6456808 to your computer and use it in GitHub Desktop.
Running a haskell script without GHC using nix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment