diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # fast-combinatorics
 
+[![Build Status](https://travis-ci.org/vmchale/fast-combinatorics.svg?branch=master)](https://travis-ci.org/vmchale/fast-combinatorics)
+
 This is a library for fast combinatorics using ATS. You may need to download the 
 relevant ATS libraries
 [here](http://www.ats-lang.org/Downloads.html#Install_of_ATS2_include) if
@@ -8,7 +10,7 @@
 Currently it is in-progress, being somewhat constrained by the fact that I have
 yet to figure out how to share arbitrary-precision types between ATS and Haskell.
 
-# Building
+## Building
 
 The Haskell library comes with the C bundled, however you may wish to build from
 source if you are hacking on the library. To that end, you can install
@@ -18,3 +20,29 @@
 ```bash
  $ ./shake.hs
 ```
+
+You will also likely want to install
+[GHC](https://www.haskell.org/ghc/download.html) as well as
+[cabal](https://www.haskell.org/cabal/).
+
+## Documentation
+
+### Using the ATS library
+
+One of the nice things about a Haskell wrapper is that some of Haskell's
+tooling/libraries may be used. In particular, you may like to interact with the
+library via a REPL, viz.
+
+```bash
+ $ cabal new-repl
+```
+
+### Using the Haskell library
+
+You may wish to read the ATS source code for an indication of what sorts of
+things ATS allows us to prove things about our programs, such as proofs of
+termination.
+
+There are also a few caveats: note that all results and arguments
+must be of the `Int` type. This unfortunate constraint will hopefully be fixed
+in the future, but right now it limits the usefulness of the library.
diff --git a/bench/Bench.hs b/bench/Bench.hs
--- a/bench/Bench.hs
+++ b/bench/Bench.hs
@@ -2,17 +2,25 @@
 
 import           Criterion.Main
 import           Lib
-import qualified Math.Combinatorics.Binomial as MB
-import qualified Math.Combinatorics.Factorial as MB
+import qualified Math.Combinatorics.Binomial as Ext
+import qualified Math.Combinatorics.Factorial as Ext
 
+hsIsPrime :: Int -> Bool
+hsIsPrime x = null [ y | y <- [2..m], x `mod` y == 0]
+    where m = floor (sqrt (fromIntegral x))
+
 main :: IO ()
 main =
     defaultMain [ bgroup "factorial"
                       [ bench "factorial" $ nf factorial 12
-                      , bench "MB.factorial" $ nf factorial 12
+                      , bench "Ext.factorial" $ nf factorial 12
                       ]
                 , bgroup "choose"
                       [ bench "choose" $ nf (13 `choose`) 4
-                      , bench "MB.choose" $ nf (13 `choose`) 4
+                      , bench "Ext.choose" $ nf (13 `choose`) 4
+                      ]
+                , bgroup "isPrime"
+                      [ bench "isPrime" $ nf isPrime 2017
+                      , bench "hsIsPrime" $ nf hsIsPrime 2017
                       ]
                 ]
diff --git a/cbits/fast-combinatorics.c b/cbits/fast-combinatorics.c
--- a/cbits/fast-combinatorics.c
+++ b/cbits/fast-combinatorics.c
@@ -1,7 +1,7 @@
 /*
 **
 ** The C code is generated by [ATS/Postiats-0-3-8]
-** The starting compilation time is: 2017-12-30: 10h:46m
+** The starting compilation time is: 2017-12-30: 12h:55m
 **
 */
 
@@ -249,6 +249,12 @@
 /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/checkast.dats: 1531(line=44, offs=1) -- 1570(line=45, offs=32)
 */
 /*
+/usr/local/lib/ats2-postiats-0.3.8/libats/libc/SATS/math.sats: 1380(line=35, offs=1) -- 1426(line=38, offs=3)
+*/
+
+#include \
+"libats/libc/CATS/math.cats"
+/*
 staload-prologues(end)
 */
 /*
@@ -271,6 +277,13 @@
 ATSdyncst_mac(atspre_g1int_mul_int)
 ATSdyncst_mac(atspre_g1int_add_int)
 ATSdyncst_mac(atspre_g0int_div_int)
+ATSdyncst_mac(atspre_g0float2int_float_int)
+ATSdyncst_mac(atslib_libats_libc_sqrt_float)
+ATSdyncst_mac(atspre_g0int2float_int_float)
+ATSdyncst_mac(atspre_g0int2int_int_int)
+ATSdyncst_mac(atspre_g0int_lte_int)
+ATSdyncst_mac(atspre_g0int_eq_int)
+ATSdyncst_mac(atspre_g0int_mod_int)
 /*
 dyncstlst-declaration(end)
 */
@@ -324,8 +337,40 @@
 atstkind_t0ype(atstype_int)
 numerator_loop_5(atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int)) ;
 
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+is_prime_9(atstkind_t0ype(atstype_int)) ;
+
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+loop_11(atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int)) ;
+
 #if(0)
+#if(0)
 ATSextern()
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__lte_g0int_int__12(atstkind_t0ype(atstyvar_type(tk)), atstkind_t0ype(atstype_int)) ;
+#endif // end of [QUALIFIED]
+#endif // end of [TEMPLATE]
+
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__lte_g0int_int__12__1(atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int)) ;
+
+#if(0)
+#if(0)
+ATSextern()
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__eq_g0int_int__16(atstkind_t0ype(atstyvar_type(tk)), atstkind_t0ype(atstype_int)) ;
+#endif // end of [QUALIFIED]
+#endif // end of [TEMPLATE]
+
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__eq_g0int_int__16__1(atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int)) ;
+
+#if(0)
+ATSextern()
 atstkind_t0ype(atstype_int)
 choose_ats(atstkind_t0ype(atstype_int), atstkind_t0ype(atstype_int)) ;
 #endif // end of [QUALIFIED]
@@ -338,12 +383,18 @@
 
 #if(0)
 ATSextern()
+atstkind_t0ype(atstype_bool)
+is_prime_ats(atstkind_t0ype(atstype_int)) ;
+#endif // end of [QUALIFIED]
+
+#if(0)
+ATSextern()
 atstkind_t0ype(atstype_int)
 factorial_ats(atstkind_t0ype(atstype_int)) ;
 #endif // end of [QUALIFIED]
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 70(line=5, offs=5) -- 167(line=8, offs=28)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 187(line=9, offs=5) -- 284(line=12, offs=28)
 */
 /*
 local: fact_0$0(level=0)
@@ -366,11 +417,11 @@
 */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 70(line=5, offs=5) -- 167(line=8, offs=28)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 187(line=9, offs=5) -- 284(line=12, offs=28)
 */
 ATSINSflab(__patsflab_fact_0):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 116(line=6, offs=3) -- 167(line=8, offs=28)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 233(line=10, offs=3) -- 284(line=12, offs=28)
 */
 ATScaseof_beg()
 /*
@@ -378,15 +429,15 @@
 */
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 133(line=7, offs=7) -- 134(line=7, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 250(line=11, offs=7) -- 251(line=11, offs=8)
 */
 ATSINSlab(__atstmplab0):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 92(line=5, offs=27) -- 93(line=5, offs=28)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 209(line=9, offs=27) -- 210(line=9, offs=28)
 */
 ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(0))) { ATSINSgoto(__atstmplab2) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 134(line=7, offs=8) -- 134(line=7, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 251(line=11, offs=8) -- 251(line=11, offs=8)
 */
 ATSINSlab(__atstmplab1):
 /*
@@ -396,14 +447,14 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 138(line=7, offs=12) -- 139(line=7, offs=13)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 255(line=11, offs=12) -- 256(line=11, offs=13)
 */
 ATSINSmove(tmpret0, ATSPMVi0nt(1)) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 147(line=8, offs=8) -- 147(line=8, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 264(line=12, offs=8) -- 264(line=12, offs=8)
 */
 ATSINSlab(__atstmplab2):
 /*
@@ -413,17 +464,17 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 157(line=8, offs=18) -- 162(line=8, offs=23)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 274(line=12, offs=18) -- 279(line=12, offs=23)
 */
 ATSINSmove(tmp2, atspre_g1int_sub_int(arg0, ATSPMVi0nt(1))) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 152(line=8, offs=13) -- 163(line=8, offs=24)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 269(line=12, offs=13) -- 280(line=12, offs=24)
 */
 ATSINSmove(tmp1, fact_0(tmp2)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 152(line=8, offs=13) -- 167(line=8, offs=28)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 269(line=12, offs=13) -- 284(line=12, offs=28)
 */
 ATSINSmove(tmpret0, atspre_g0int_mul_int(tmp1, arg0)) ;
 
@@ -442,7 +493,7 @@
 } /* end of [fact_0] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 173(line=10, offs=5) -- 285(line=14, offs=29)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 290(line=14, offs=5) -- 402(line=18, offs=29)
 */
 /*
 local: dfact_3$0(level=0)
@@ -465,11 +516,11 @@
 */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 173(line=10, offs=5) -- 285(line=14, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 290(line=14, offs=5) -- 402(line=18, offs=29)
 */
 ATSINSflab(__patsflab_dfact_3):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 220(line=11, offs=3) -- 285(line=14, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 337(line=15, offs=3) -- 402(line=18, offs=29)
 */
 ATScaseof_beg()
 /*
@@ -477,15 +528,15 @@
 */
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 237(line=12, offs=7) -- 238(line=12, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 354(line=16, offs=7) -- 355(line=16, offs=8)
 */
 ATSINSlab(__atstmplab3):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 196(line=10, offs=28) -- 197(line=10, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 313(line=14, offs=28) -- 314(line=14, offs=29)
 */
 ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(0))) { ATSINSgoto(__atstmplab5) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 238(line=12, offs=8) -- 238(line=12, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 355(line=16, offs=8) -- 355(line=16, offs=8)
 */
 ATSINSlab(__atstmplab4):
 /*
@@ -495,22 +546,22 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 242(line=12, offs=12) -- 243(line=12, offs=13)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 359(line=16, offs=12) -- 360(line=16, offs=13)
 */
 ATSINSmove(tmpret3, ATSPMVi0nt(1)) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 250(line=13, offs=7) -- 251(line=13, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 367(line=17, offs=7) -- 368(line=17, offs=8)
 */
 ATSINSlab(__atstmplab5):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 196(line=10, offs=28) -- 197(line=10, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 313(line=14, offs=28) -- 314(line=14, offs=29)
 */
 ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(1))) { ATSINSgoto(__atstmplab7) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 251(line=13, offs=8) -- 251(line=13, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 368(line=17, offs=8) -- 368(line=17, offs=8)
 */
 ATSINSlab(__atstmplab6):
 /*
@@ -520,14 +571,14 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 255(line=13, offs=12) -- 256(line=13, offs=13)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 372(line=17, offs=12) -- 373(line=17, offs=13)
 */
 ATSINSmove(tmpret3, ATSPMVi0nt(1)) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 264(line=14, offs=8) -- 264(line=14, offs=8)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 381(line=18, offs=8) -- 381(line=18, offs=8)
 */
 ATSINSlab(__atstmplab7):
 /*
@@ -537,17 +588,17 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 279(line=14, offs=23) -- 284(line=14, offs=28)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 396(line=18, offs=23) -- 401(line=18, offs=28)
 */
 ATSINSmove(tmp5, atspre_g1int_sub_int(arg0, ATSPMVi0nt(2))) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 273(line=14, offs=17) -- 285(line=14, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 390(line=18, offs=17) -- 402(line=18, offs=29)
 */
 ATSINSmove(tmp4, dfact_3(tmp5)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 269(line=14, offs=13) -- 285(line=14, offs=29)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 386(line=18, offs=13) -- 402(line=18, offs=29)
 */
 ATSINSmove(tmpret3, atspre_g0int_mul_int(arg0, tmp4)) ;
 
@@ -566,7 +617,7 @@
 } /* end of [dfact_3] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 324(line=17, offs=4) -- 680(line=29, offs=6)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 441(line=21, offs=4) -- 797(line=33, offs=6)
 */
 /*
 local: fact_0$0(level=0)
@@ -585,11 +636,11 @@
 /* tmpvardeclst(end) */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 324(line=17, offs=4) -- 680(line=29, offs=6)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 441(line=21, offs=4) -- 797(line=33, offs=6)
 */
 ATSINSflab(__patsflab_choose_4):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 396(line=18, offs=3) -- 680(line=29, offs=6)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 513(line=22, offs=3) -- 797(line=33, offs=6)
 */
 /*
 letpush(beg)
@@ -599,7 +650,7 @@
 */
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 592(line=25, offs=5) -- 674(line=28, offs=42)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 709(line=29, offs=5) -- 791(line=32, offs=42)
 */
 ATScaseof_beg()
 /*
@@ -607,15 +658,15 @@
 */
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 611(line=26, offs=9) -- 612(line=26, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 728(line=30, offs=9) -- 729(line=30, offs=10)
 */
 ATSINSlab(__atstmplab13):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 374(line=17, offs=54) -- 375(line=17, offs=55)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 491(line=21, offs=54) -- 492(line=21, offs=55)
 */
 ATSifnthen(ATSCKpat_int(arg1, ATSPMVint(0))) { ATSINSgoto(__atstmplab15) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 612(line=26, offs=10) -- 612(line=26, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 729(line=30, offs=10) -- 729(line=30, offs=10)
 */
 ATSINSlab(__atstmplab14):
 /*
@@ -625,22 +676,22 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 616(line=26, offs=14) -- 617(line=26, offs=15)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 733(line=30, offs=14) -- 734(line=30, offs=15)
 */
 ATSINSmove(tmpret6, ATSPMVi0nt(1)) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 626(line=27, offs=9) -- 627(line=27, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 743(line=31, offs=9) -- 744(line=31, offs=10)
 */
 ATSINSlab(__atstmplab15):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 374(line=17, offs=54) -- 375(line=17, offs=55)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 491(line=21, offs=54) -- 492(line=21, offs=55)
 */
 ATSifnthen(ATSCKpat_int(arg1, ATSPMVint(1))) { ATSINSgoto(__atstmplab17) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 627(line=27, offs=10) -- 627(line=27, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 744(line=31, offs=10) -- 744(line=31, offs=10)
 */
 ATSINSlab(__atstmplab16):
 /*
@@ -650,14 +701,14 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 631(line=27, offs=14) -- 632(line=27, offs=15)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 748(line=31, offs=14) -- 749(line=31, offs=15)
 */
 ATSINSmove(tmpret6, arg0) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 642(line=28, offs=10) -- 642(line=28, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 759(line=32, offs=10) -- 759(line=32, offs=10)
 */
 ATSINSlab(__atstmplab17):
 /*
@@ -667,17 +718,17 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 647(line=28, offs=15) -- 663(line=28, offs=31)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 764(line=32, offs=15) -- 780(line=32, offs=31)
 */
 ATSINSmove(tmp13, numerator_loop_5(arg0, arg1)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 667(line=28, offs=35) -- 673(line=28, offs=41)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 784(line=32, offs=35) -- 790(line=32, offs=41)
 */
 ATSINSmove(tmp14, fact_0(arg1)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 647(line=28, offs=15) -- 673(line=28, offs=41)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 764(line=32, offs=15) -- 790(line=32, offs=41)
 */
 ATSINSmove(tmpret6, atspre_g0int_div_int(tmp13, tmp14)) ;
 
@@ -689,7 +740,7 @@
 ATScaseof_end()
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 396(line=18, offs=3) -- 680(line=29, offs=6)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 513(line=22, offs=3) -- 797(line=33, offs=6)
 */
 /*
 INSletpop()
@@ -699,7 +750,7 @@
 } /* end of [choose_4] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 408(line=19, offs=9) -- 582(line=23, offs=52)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 525(line=23, offs=9) -- 699(line=27, offs=52)
 */
 /*
 local: numerator_loop_5$0(level=1)
@@ -721,11 +772,11 @@
 /* tmpvardeclst(end) */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 408(line=19, offs=9) -- 582(line=23, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 525(line=23, offs=9) -- 699(line=27, offs=52)
 */
 ATSINSflab(__patsflab_numerator_loop_5):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 476(line=20, offs=7) -- 582(line=23, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 593(line=24, offs=7) -- 699(line=27, offs=52)
 */
 ATScaseof_beg()
 /*
@@ -733,15 +784,15 @@
 */
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 497(line=21, offs=11) -- 498(line=21, offs=12)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 614(line=25, offs=11) -- 615(line=25, offs=12)
 */
 ATSINSlab(__atstmplab8):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 450(line=19, offs=51) -- 451(line=19, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 567(line=23, offs=51) -- 568(line=23, offs=52)
 */
 ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(1))) { ATSINSgoto(__atstmplab10) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 498(line=21, offs=12) -- 498(line=21, offs=12)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 615(line=25, offs=12) -- 615(line=25, offs=12)
 */
 ATSINSlab(__atstmplab9):
 /*
@@ -751,22 +802,22 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 502(line=21, offs=16) -- 503(line=21, offs=17)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 619(line=25, offs=16) -- 620(line=25, offs=17)
 */
 ATSINSmove(tmpret7, env0) ;
 ATSbranch_end()
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 514(line=22, offs=11) -- 515(line=22, offs=12)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 631(line=26, offs=11) -- 632(line=26, offs=12)
 */
 ATSINSlab(__atstmplab10):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 450(line=19, offs=51) -- 451(line=19, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 567(line=23, offs=51) -- 568(line=23, offs=52)
 */
 ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(2))) { ATSINSgoto(__atstmplab12) ; } ;
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 515(line=22, offs=12) -- 515(line=22, offs=12)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 632(line=26, offs=12) -- 632(line=26, offs=12)
 */
 ATSINSlab(__atstmplab11):
 /*
@@ -776,12 +827,12 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 520(line=22, offs=17) -- 525(line=22, offs=22)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 637(line=26, offs=17) -- 642(line=26, offs=22)
 */
 ATSINSmove(tmp8, atspre_g1int_sub_int(env0, ATSPMVi0nt(1))) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 519(line=22, offs=16) -- 530(line=22, offs=27)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 636(line=26, offs=16) -- 647(line=26, offs=27)
 */
 ATSINSmove(tmpret7, atspre_g1int_mul_int(tmp8, env0)) ;
 
@@ -789,7 +840,7 @@
 
 ATSbranch_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 542(line=23, offs=12) -- 542(line=23, offs=12)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 659(line=27, offs=12) -- 659(line=27, offs=12)
 */
 ATSINSlab(__atstmplab12):
 /*
@@ -799,27 +850,27 @@
 ibranch-mbody:
 */
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 548(line=23, offs=18) -- 553(line=23, offs=23)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 665(line=27, offs=18) -- 670(line=27, offs=23)
 */
 ATSINSmove(tmp10, atspre_g1int_add_int(env0, ATSPMVi0nt(1))) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 548(line=23, offs=18) -- 557(line=23, offs=27)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 665(line=27, offs=18) -- 674(line=27, offs=27)
 */
 ATSINSmove(tmp9, atspre_g1int_sub_int(tmp10, arg0)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 576(line=23, offs=46) -- 581(line=23, offs=51)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 693(line=27, offs=46) -- 698(line=27, offs=51)
 */
 ATSINSmove(tmp12, atspre_g1int_sub_int(arg0, ATSPMVi0nt(1))) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 561(line=23, offs=31) -- 582(line=23, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 678(line=27, offs=31) -- 699(line=27, offs=52)
 */
 ATSINSmove(tmp11, numerator_loop_5(env0, tmp12)) ;
 
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 547(line=23, offs=17) -- 582(line=23, offs=52)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 664(line=27, offs=17) -- 699(line=27, offs=52)
 */
 ATSINSmove(tmpret7, atspre_g0int_mul_int(tmp9, tmp11)) ;
 
@@ -835,11 +886,397 @@
 } /* end of [numerator_loop_5] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 793(line=35, offs=22) -- 816(line=36, offs=15)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 843(line=36, offs=5) -- 1341(line=55, offs=10)
 */
 /*
+local: 
+global: is_prime_9$0(level=0)
+local: 
+global: 
+*/
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+is_prime_9(atstkind_t0ype(atstype_int) arg0)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret15, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmpref16, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmp17, atstkind_t0ype(atstype_float)) ;
+ATStmpdec(tmp18, atstkind_t0ype(atstype_float)) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 843(line=36, offs=5) -- 1341(line=55, offs=10)
+*/
+ATSINSflab(__patsflab_is_prime_9):
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 877(line=37, offs=3) -- 1341(line=55, offs=10)
+*/
+ATScaseof_beg()
+/*
+** ibranchlst-beg
+*/
+ATSbranch_beg()
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 894(line=38, offs=7) -- 895(line=38, offs=8)
+*/
+ATSINSlab(__atstmplab18):
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 852(line=36, offs=14) -- 853(line=36, offs=15)
+*/
+ATSifnthen(ATSCKpat_int(arg0, ATSPMVint(1))) { ATSINSgoto(__atstmplab20) ; } ;
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 895(line=38, offs=8) -- 895(line=38, offs=8)
+*/
+ATSINSlab(__atstmplab19):
+/*
+emit_instr: loc0 = : 0(line=0, offs=0) -- 0(line=0, offs=0)
+*/
+/*
+ibranch-mbody:
+*/
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 899(line=38, offs=12) -- 904(line=38, offs=17)
+*/
+ATSINSmove(tmpret15, ATSPMVbool_false()) ;
+ATSbranch_end()
+
+ATSbranch_beg()
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 912(line=39, offs=8) -- 912(line=39, offs=8)
+*/
+ATSINSlab(__atstmplab20):
+/*
+emit_instr: loc0 = : 0(line=0, offs=0) -- 0(line=0, offs=0)
+*/
+/*
+ibranch-mbody:
+*/
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 937(line=41, offs=9) -- 1331(line=54, offs=12)
+*/
+/*
+letpush(beg)
+*/
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 955(line=42, offs=15) -- 960(line=42, offs=20)
+*/
+/*
+ATSINStmpdec(tmpref16) ;
+*/
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 991(line=42, offs=51) -- 1014(line=42, offs=74)
+*/
+ATSINSmove(tmp18, atspre_g0int2float_int_float(arg0)) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 980(line=42, offs=40) -- 1016(line=42, offs=76)
+*/
+ATSINSmove(tmp17, atslib_libats_libc_sqrt_float(tmp18)) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 968(line=42, offs=28) -- 1017(line=42, offs=77)
+*/
+ATSINSmove(tmpref16, atspre_g0float2int_float_int(tmp17)) ;
+
+/*
+letpush(end)
+*/
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1305(line=53, offs=11) -- 1319(line=53, offs=25)
+*/
+ATSINSmove(tmpret15, loop_11(arg0, ATSPMVi0nt(2), tmpref16)) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 937(line=41, offs=9) -- 1331(line=54, offs=12)
+*/
+/*
+INSletpop()
+*/
+ATSbranch_end()
+
+/*
+** ibranchlst-end
+*/
+ATScaseof_end()
+
+ATSfunbody_end()
+ATSreturn(tmpret15) ;
+} /* end of [is_prime_9] */
+
+/*
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1043(line=44, offs=15) -- 1283(line=51, offs=19)
+*/
+/*
+local: loop_11$0(level=1)
+global: loop_11$0(level=1)
+local: k$4742(1)(HSEapp(HSEcst(atstkind_t0ype); HSEs2exp(S2Eextkind(atstype_int))))
+global: k$4742(1)(HSEapp(HSEcst(atstkind_t0ype); HSEs2exp(S2Eextkind(atstype_int))))
+*/
+ATSstatic()
+atstkind_t0ype(atstype_bool)
+loop_11(atstkind_t0ype(atstype_int) env0, atstkind_t0ype(atstype_int) arg0, atstkind_t0ype(atstype_int) arg1)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(apy0, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(apy1, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmpret19, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp20, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp25, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp30, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmp31, atstkind_t0ype(atstype_int)) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1043(line=44, offs=15) -- 1283(line=51, offs=19)
+*/
+ATSINSflab(__patsflab_loop_11):
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1114(line=45, offs=16) -- 1124(line=45, offs=26)
+*/
+ATSINSmove(tmp20, ATSLIB_056_prelude__lte_g0int_int__12__1(arg0, arg1)) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1111(line=45, offs=13) -- 1283(line=51, offs=19)
+*/
+ATSif(
+tmp20
+) ATSthen() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1147(line=46, offs=18) -- 1154(line=46, offs=25)
+*/
+ATSINSmove(tmp30, atspre_g0int_mod_int(env0, arg0)) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1147(line=46, offs=18) -- 1158(line=46, offs=29)
+*/
+ATSINSmove(tmp25, ATSLIB_056_prelude__eq_g0int_int__16__1(tmp30, ATSPMVi0nt(0))) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1144(line=46, offs=15) -- 1247(line=49, offs=43)
+*/
+ATSif(
+tmp25
+) ATSthen() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1180(line=47, offs=17) -- 1185(line=47, offs=22)
+*/
+ATSINSmove(tmpret19, ATSPMVbool_false()) ;
+} ATSelse() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1221(line=49, offs=17) -- 1247(line=49, offs=43)
+*/
+ATSif(
+ATSPMVbool_true()
+) ATSthen() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1221(line=49, offs=17) -- 1247(line=49, offs=43)
+*/
+ATSINSmove(tmp31, atspre_g1int_add_int(arg0, ATSPMVi0nt(1))) ;
+
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1221(line=49, offs=17) -- 1247(line=49, offs=43)
+*/
+ATStailcal_beg()
+ATSINSmove_tlcal(apy0, tmp31) ;
+ATSINSmove_tlcal(apy1, arg1) ;
+ATSINSargmove_tlcal(arg0, apy0) ;
+ATSINSargmove_tlcal(arg1, apy1) ;
+ATSINSfgoto(__patsflab_loop_11) ;
+ATStailcal_end()
+
+} ATSelse() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1221(line=49, offs=17) -- 1247(line=49, offs=43)
+*/
+ATSINSmove(tmpret19, ATSPMVbool_false()) ;
+} /* ATSendif */
+} /* ATSendif */
+} ATSelse() {
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1279(line=51, offs=15) -- 1283(line=51, offs=19)
+*/
+ATSINSmove(tmpret19, ATSPMVbool_true()) ;
+} /* ATSendif */
+ATSfunbody_end()
+ATSreturn(tmpret19) ;
+} /* end of [loop_11] */
+
+#if(0)
+/*
+/usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats: 12019(line=621, offs=3) -- 12059(line=621, offs=43)
+*/
+/*
+local: 
+global: lte_g0int_int$12$0(level=0)
+local: 
+global: 
+*/
+ATSextern()
+/*
+imparg = tk(4691)
+tmparg = S2Evar(tk(4691))
+tmpsub = None()
+*/
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__lte_g0int_int__12(atstkind_t0ype(atstyvar_type(tk)) arg0, atstkind_t0ype(atstype_int) arg1)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret21, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp22, atstkind_t0ype(atstyvar_type(tk))) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12003(line=620, offs=1) -- 12059(line=621, offs=43)
+*/
+ATSINSflab(__patsflab_lte_g0int_int):
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12046(line=621, offs=30) -- 12057(line=621, offs=41)
+*/
+ATSINSmove(tmp22, PMVtmpltcst(g0int2int<S2Eextkind(atstype_int), S2Evar(tk(4691))>)(arg1)) ;
+
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12028(line=621, offs=12) -- 12059(line=621, offs=43)
+*/
+ATSINSmove(tmpret21, PMVtmpltcst(g0int_lte<S2Evar(tk(4691))>)(arg0, tmp22)) ;
+
+ATSfunbody_end()
+ATSreturn(tmpret21) ;
+} /* end of [ATSLIB_056_prelude__lte_g0int_int__12] */
+#endif // end of [TEMPLATE]
+
+/*
+/usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats: 12019(line=621, offs=3) -- 12059(line=621, offs=43)
+*/
+/*
+local: 
+global: lte_g0int_int$12$1(level=2)
+local: 
+global: 
+*/
+ATSstatic()
+/*
+imparg = tk(4691)
+tmparg = S2Evar(tk(4691))
+tmpsub = Some(tk(4691) -> S2Eextkind(atstype_int))
+*/
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__lte_g0int_int__12__1(atstkind_t0ype(atstype_int) arg0, atstkind_t0ype(atstype_int) arg1)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret21__1, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp22__1, atstkind_t0ype(atstype_int)) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12003(line=620, offs=1) -- 12059(line=621, offs=43)
+*/
+ATSINSflab(__patsflab_lte_g0int_int):
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12046(line=621, offs=30) -- 12057(line=621, offs=41)
+*/
+ATSINSmove(tmp22__1, atspre_g0int2int_int_int(arg1)) ;
+
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12028(line=621, offs=12) -- 12059(line=621, offs=43)
+*/
+ATSINSmove(tmpret21__1, atspre_g0int_lte_int(arg0, tmp22__1)) ;
+
+ATSfunbody_end()
+ATSreturn(tmpret21__1) ;
+} /* end of [ATSLIB_056_prelude__lte_g0int_int__12__1] */
+
+#if(0)
+/*
+/usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats: 12259(line=635, offs=3) -- 12298(line=635, offs=42)
+*/
+/*
+local: 
+global: eq_g0int_int$16$0(level=0)
+local: 
+global: 
+*/
+ATSextern()
+/*
+imparg = tk(4694)
+tmparg = S2Evar(tk(4694))
+tmpsub = None()
+*/
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__eq_g0int_int__16(atstkind_t0ype(atstyvar_type(tk)) arg0, atstkind_t0ype(atstype_int) arg1)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret26, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp27, atstkind_t0ype(atstyvar_type(tk))) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12244(line=634, offs=1) -- 12298(line=635, offs=42)
+*/
+ATSINSflab(__patsflab_eq_g0int_int):
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12285(line=635, offs=29) -- 12296(line=635, offs=40)
+*/
+ATSINSmove(tmp27, PMVtmpltcst(g0int2int<S2Eextkind(atstype_int), S2Evar(tk(4694))>)(arg1)) ;
+
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12268(line=635, offs=12) -- 12298(line=635, offs=42)
+*/
+ATSINSmove(tmpret26, PMVtmpltcst(g0int_eq<S2Evar(tk(4694))>)(arg0, tmp27)) ;
+
+ATSfunbody_end()
+ATSreturn(tmpret26) ;
+} /* end of [ATSLIB_056_prelude__eq_g0int_int__16] */
+#endif // end of [TEMPLATE]
+
+/*
+/usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats: 12259(line=635, offs=3) -- 12298(line=635, offs=42)
+*/
+/*
+local: 
+global: eq_g0int_int$16$1(level=2)
+local: 
+global: 
+*/
+ATSstatic()
+/*
+imparg = tk(4694)
+tmparg = S2Evar(tk(4694))
+tmpsub = Some(tk(4694) -> S2Eextkind(atstype_int))
+*/
+atstkind_t0ype(atstype_bool)
+ATSLIB_056_prelude__eq_g0int_int__16__1(atstkind_t0ype(atstype_int) arg0, atstkind_t0ype(atstype_int) arg1)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret26__1, atstkind_t0ype(atstype_bool)) ;
+ATStmpdec(tmp27__1, atstkind_t0ype(atstype_int)) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12244(line=634, offs=1) -- 12298(line=635, offs=42)
+*/
+ATSINSflab(__patsflab_eq_g0int_int):
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12285(line=635, offs=29) -- 12296(line=635, offs=40)
+*/
+ATSINSmove(tmp27__1, atspre_g0int2int_int_int(arg1)) ;
+
+/*
+emit_instr: loc0 = /usr/local/lib/ats2-postiats-0.3.8/prelude/DATS/integer.dats({$PATSPRE}/DATS/integer.dats): 12268(line=635, offs=12) -- 12298(line=635, offs=42)
+*/
+ATSINSmove(tmpret26__1, atspre_g0int_eq_int(arg0, tmp27__1)) ;
+
+ATSfunbody_end()
+ATSreturn(tmpret26__1) ;
+} /* end of [ATSLIB_056_prelude__eq_g0int_int__16__1] */
+
+/*
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1656(line=73, offs=22) -- 1679(line=74, offs=15)
+*/
+/*
 local: choose_4$0(level=0)
-global: fact_0$0(level=0), choose_4$0(level=0), choose_ats$9$0(level=0)
+global: fact_0$0(level=0), choose_4$0(level=0), choose_ats$20$0(level=0)
 local: 
 global: 
 */
@@ -848,28 +1285,28 @@
 choose_ats(atstkind_t0ype(atstype_int) arg0, atstkind_t0ype(atstype_int) arg1)
 {
 /* tmpvardeclst(beg) */
-ATStmpdec(tmpret15, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmpret32, atstkind_t0ype(atstype_int)) ;
 /* tmpvardeclst(end) */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 782(line=35, offs=11) -- 816(line=36, offs=15)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1645(line=73, offs=11) -- 1679(line=74, offs=15)
 */
 ATSINSflab(__patsflab_choose_ats):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 804(line=36, offs=3) -- 816(line=36, offs=15)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1667(line=74, offs=3) -- 1679(line=74, offs=15)
 */
-ATSINSmove(tmpret15, choose_4(arg0, arg1)) ;
+ATSINSmove(tmpret32, choose_4(arg0, arg1)) ;
 
 ATSfunbody_end()
-ATSreturn(tmpret15) ;
+ATSreturn(tmpret32) ;
 } /* end of [choose_ats] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 911(line=42, offs=28) -- 926(line=43, offs=10)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1708(line=76, offs=28) -- 1723(line=77, offs=10)
 */
 /*
 local: dfact_3$0(level=0)
-global: dfact_3$0(level=0), double_factorial$10$0(level=0)
+global: dfact_3$0(level=0), double_factorial$21$0(level=0)
 local: 
 global: 
 */
@@ -878,28 +1315,58 @@
 double_factorial(atstkind_t0ype(atstype_int) arg0)
 {
 /* tmpvardeclst(beg) */
-ATStmpdec(tmpret16, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmpret33, atstkind_t0ype(atstype_int)) ;
 /* tmpvardeclst(end) */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 894(line=42, offs=11) -- 927(line=43, offs=11)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1691(line=76, offs=11) -- 1724(line=77, offs=11)
 */
 ATSINSflab(__patsflab_double_factorial):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 919(line=43, offs=3) -- 926(line=43, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1716(line=77, offs=3) -- 1723(line=77, offs=10)
 */
-ATSINSmove(tmpret16, dfact_3(arg0)) ;
+ATSINSmove(tmpret33, dfact_3(arg0)) ;
 
 ATSfunbody_end()
-ATSreturn(tmpret16) ;
+ATSreturn(tmpret33) ;
 } /* end of [double_factorial] */
 
 /*
-/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1016(line=49, offs=25) -- 1030(line=50, offs=9)
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1749(line=79, offs=24) -- 1767(line=80, offs=13)
 */
 /*
+local: is_prime_9$0(level=0)
+global: is_prime_9$0(level=0), is_prime_ats$22$0(level=0)
+local: 
+global: 
+*/
+ATSextern()
+atstkind_t0ype(atstype_bool)
+is_prime_ats(atstkind_t0ype(atstype_int) arg0)
+{
+/* tmpvardeclst(beg) */
+ATStmpdec(tmpret34, atstkind_t0ype(atstype_bool)) ;
+/* tmpvardeclst(end) */
+ATSfunbody_beg()
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1736(line=79, offs=11) -- 1768(line=80, offs=14)
+*/
+ATSINSflab(__patsflab_is_prime_ats):
+/*
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1757(line=80, offs=3) -- 1767(line=80, offs=13)
+*/
+ATSINSmove(tmpret34, is_prime_9(arg0)) ;
+
+ATSfunbody_end()
+ATSreturn(tmpret34) ;
+} /* end of [is_prime_ats] */
+
+/*
+/home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1794(line=82, offs=25) -- 1808(line=83, offs=9)
+*/
+/*
 local: fact_0$0(level=0)
-global: fact_0$0(level=0), factorial_ats$11$0(level=0)
+global: fact_0$0(level=0), factorial_ats$23$0(level=0)
 local: 
 global: 
 */
@@ -908,20 +1375,20 @@
 factorial_ats(atstkind_t0ype(atstype_int) arg0)
 {
 /* tmpvardeclst(beg) */
-ATStmpdec(tmpret17, atstkind_t0ype(atstype_int)) ;
+ATStmpdec(tmpret35, atstkind_t0ype(atstype_int)) ;
 /* tmpvardeclst(end) */
 ATSfunbody_beg()
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1002(line=49, offs=11) -- 1031(line=50, offs=10)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1780(line=82, offs=11) -- 1809(line=83, offs=10)
 */
 ATSINSflab(__patsflab_factorial_ats):
 /*
-emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1024(line=50, offs=3) -- 1030(line=50, offs=9)
+emit_instr: loc0 = /home/vanessa/programming/haskell/current/fast-combinatorics/ats-src/fast-combinatorics.dats: 1802(line=83, offs=3) -- 1808(line=83, offs=9)
 */
-ATSINSmove(tmpret17, fact_0(arg0)) ;
+ATSINSmove(tmpret35, fact_0(arg0)) ;
 
 ATSfunbody_end()
-ATSreturn(tmpret17) ;
+ATSreturn(tmpret35) ;
 } /* end of [factorial_ats] */
 
 /*
diff --git a/fast-combinatorics.cabal b/fast-combinatorics.cabal
--- a/fast-combinatorics.cabal
+++ b/fast-combinatorics.cabal
@@ -1,5 +1,5 @@
 name:                fast-combinatorics
-version:             0.1.0.0
+version:             0.1.0.1
 synopsis:            Fast combinatorics.
 description:         Fast combinatorics code with a high level of safety guaranteed by writing it in ATS.
 homepage:            https://github.com//fast-combinatorics#readme
@@ -29,7 +29,7 @@
   default-language:    Haskell2010
   if flag(development)
     ghc-options:       -Werror
-  ghc-options:         -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat
+  ghc-options:         -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat -optc-mtune=native -optc-flto -optc-O3
 
 test-suite fast-combinatorics-test
   type:                exitcode-stdio-1.0
@@ -39,6 +39,7 @@
                      , fast-combinatorics
                      , hspec
                      , combinatorics
+                     , arithmoi
   if flag(development)
     ghc-options: -Werror
   ghc-options:         -threaded -rtsopts -with-rtsopts=-N -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat
@@ -54,7 +55,7 @@
                      , combinatorics
   if flag(development)
     ghc-options: -Werror
-  ghc-options:         -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat -optc-mtune=native -optc-flto
+  ghc-options:         -Wincomplete-uni-patterns -Wincomplete-record-updates -Wcompat -optc-mtune=native -optc-flto -optc-O3
   default-language:    Haskell2010
 
 source-repository head
diff --git a/src/Lib.hs b/src/Lib.hs
--- a/src/Lib.hs
+++ b/src/Lib.hs
@@ -4,14 +4,28 @@
     ( factorial
     , choose
     , doubleFactorial
+    , isPrime
     ) where
 
 import Control.Composition
 import           Foreign.C
+import Data.Word
 
 foreign import ccall unsafe factorial_ats :: CInt -> CInt
 foreign import ccall unsafe choose_ats :: CInt -> CInt -> CInt
 foreign import ccall unsafe double_factorial :: CInt -> CInt
+foreign import ccall unsafe is_prime_ats :: CInt -> CBool
+
+convertBool :: CBool -> Bool
+convertBool = go . fromIntegral
+    where
+        go :: Word8 -> Bool
+        go 0 = False
+        go 1 = True
+        go _ = False
+
+isPrime :: Int -> Bool
+isPrime = convertBool . is_prime_ats . fromIntegral
 
 {-@ choose :: { n : Nat | n >= 0 } -> { k : Nat | k >= 0 && k <= n } -> Int @-}
 choose :: Int -> Int -> Int
diff --git a/test/Spec.hs b/test/Spec.hs
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -1,14 +1,18 @@
 import           Lib
 import           Test.Hspec
 import           Test.Hspec.QuickCheck
-import qualified Math.Combinatorics.Binomial as MB
-import qualified Math.Combinatorics.Factorial as MB
+import qualified Math.Combinatorics.Binomial as Ext
+import qualified Math.Combinatorics.Factorial as Ext
+import qualified Math.NumberTheory.Primes.Testing as Ext
 
 main :: IO ()
 main = hspec $ do
     parallel $ describe "factorial" $
         prop "should agree with the pure Haskell function" $
-            \x -> x < 1 || x > 12 || factorial x == MB.factorial (fromIntegral x)
+            \x -> x < 1 || x > 12 || factorial x == Ext.factorial (fromIntegral x)
     parallel $ describe "choose" $
         prop "should agree with the pure Haskell function" $
-            \x y -> x < 0 || y < 0 || x > 13 || y > 12 || (x `choose` y) == (x `MB.choose` y)
+            \x y -> x < 0 || y < 0 || x > 13 || y > 11 || (x `choose` y) == (x `Ext.choose` y)
+    parallel $ describe "isPrime" $
+        prop "should agree with the pure Haskell function" $
+            \x -> x < 1 || isPrime x == Ext.isCertifiedPrime (fromIntegral x)
