Skip to content
Permalink
Browse files

First implementation

❯ time .stack-work/install/x86_64-osx/lts-13.21/8.6.5/bin/bingo-sim 100000
Trials:   100000
Bingos:   3558
Hit rate: 0.03558
    0.83s user 0.01s system 94% cpu 0.899 total
  • Loading branch information...
jez committed May 19, 2019
1 parent b1a3c11 commit 994481b0040c686383f4c3153d5d44098fd37a60
Showing with 510 additions and 5 deletions.
  1. +12 −0 app/Main.hs
  2. +11 −4 bingo-sim.cabal
  3. +4 −1 package.yaml
  4. +200 −0 prof/bingo-sim.1.prof
  5. +164 −0 src/BingoSim/Board.hs
  6. +119 −0 src/BingoSim/Simulation.hs
@@ -0,0 +1,12 @@
{-# LANGUAGE LambdaCase #-}

module Main where

import System.Environment

import BingoSim.Simulation

main :: IO ()
main = getArgs >>= \case
[arg1] -> runSimulation (read arg1)
_ -> runSimulation 5000
@@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 395bd0817263e9250ab33ee808a41e7beb5698eb332b5588c05d5c0a7647fabd
-- hash: b0e67a2eb9d86d2863fe5c9d113188176f9b2e23ff22eb6072d87707b03a902b

name: bingo-sim
version: 0.0.0.0
version: 0.0.1.0
synopsis: A small playground to learn about profiling Haskell.

description: This package simulates the probability of scoring a bingo at a particular children's carnival game. I've been using it to learn how profiling in Haskell works.
@@ -23,13 +23,18 @@ extra-source-files:
README.md

library
exposed-modules:
BingoSim.Board
BingoSim.Simulation
other-modules:
Paths_bingo_sim
hs-source-dirs:
src
ghc-options: -Wall -Wcompat -Wmissing-signatures -Werror -funbox-strict-fields
ghc-options: -Wall -Wcompat -Wmissing-signatures -Werror -funbox-strict-fields -O2
build-depends:
base >=4.7 && <5
, random
, random-shuffle
default-language: Haskell2010

executable bingo-sim
@@ -38,8 +43,10 @@ executable bingo-sim
Paths_bingo_sim
hs-source-dirs:
app
ghc-options: -Wall -Wcompat -Wmissing-signatures -Werror -funbox-strict-fields
ghc-options: -Wall -Wcompat -Wmissing-signatures -Werror -funbox-strict-fields -O2
build-depends:
base >=4.7 && <5
, bingo-sim
, random
, random-shuffle
default-language: Haskell2010
@@ -1,5 +1,5 @@
name: bingo-sim
version: 0.0.0.0
version: 0.0.1.0
homepage: https://github.com/jez/bingo-sim
author: Jake Zimmerman
maintainer: zimmerman.jake@gmail.com
@@ -24,9 +24,12 @@ ghc-options:
- -Wmissing-signatures
- -Werror
- -funbox-strict-fields
- -O2

dependencies:
- base >=4.7 && <5
- random
- random-shuffle

library:
source-dirs: src

0 comments on commit 994481b

Please sign in to comment.
You can’t perform that action at this time.