File: splitmix-th-test.hs

package info (click to toggle)
haskell-splitmix 0.1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 200 kB
  • sloc: haskell: 1,337; ansic: 125; sh: 53; makefile: 3
file content (11 lines) | stat: -rw-r--r-- 257 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
{-# LANGUAGE TemplateHaskell #-}
module Main (main) where

import Language.Haskell.TH.Syntax

import System.Random.SplitMix

main :: IO ()
main = print val where
    val :: Double
    val = $(runIO (newSMGen >>= \g -> return (fst (nextDouble g))) >>= lift)