Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.1.3.1

- Fix linking issue `symbol not found in flat namespace '_kSecRandomDefault'`
when using splitmix in TH on macOS.

# 0.1.3

- Use system specific entropy/randomess sources to initialise the default generator.
Expand Down
17 changes: 14 additions & 3 deletions splitmix.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: splitmix
version: 0.1.3
version: 0.1.3.1
synopsis: Fast Splittable PRNG
description:
Pure Haskell implementation of SplitMix described in
Expand Down Expand Up @@ -95,8 +95,8 @@ library
c-sources: cbits-win/init.c

elif (os(osx) || os(ios))
c-sources: cbits-apple/init.c
ld-options: -framework Security
c-sources: cbits-apple/init.c
frameworks: Security

else
c-sources: cbits-unix/init.c
Expand Down Expand Up @@ -239,3 +239,14 @@ test-suite initialization
, base
, HUnit >=1.6.0.0 && <1.7
, splitmix

test-suite splitmix-th-test
default-language: Haskell2010
type: exitcode-stdio-1.0
ghc-options: -Wall -threaded -rtsopts
hs-source-dirs: tests
main-is: splitmix-th-test.hs
build-depends:
, base
, template-haskell
, splitmix
11 changes: 11 additions & 0 deletions tests/splitmix-th-test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,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)
Loading