diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,8 @@
-
-Changes in 0.7.2:
-* Put all exported unsafe functions in Unsafe.BLAS
-
-Changes in 0.7.1:
+Changes in 0.7.5:
 
-* Update minimum Quickcheck version in cabal file
+* Export all unsafe functions in Unsafe.BLAS.
 
+* Use enumerations instead of Bools in data types.
 
 Changes in 0.7:
 
diff --git a/blas.cabal b/blas.cabal
--- a/blas.cabal
+++ b/blas.cabal
@@ -1,5 +1,5 @@
 name:            blas
-version:         0.7.2
+version:         0.7.5
 homepage:        http://github.com/patperry/blas
 synopsis:        Bindings to the BLAS library
 description:
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -3094,23 +3094,38 @@
 
 fi
 
-# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+# BLAS in Apple vecLib library?
 if test $ax_blas_ok = no; then
-	as_ac_Lib=`$as_echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5
-$as_echo_n "checking for $sgemm in -lblas... " >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+	save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
+	as_ac_var=`$as_echo "ac_cv_func_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm" >&5
+$as_echo_n "checking for $sgemm... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $sgemm to an innocuous variant, in case <limits.h> declares $sgemm.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $sgemm innocuous_$sgemm
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $sgemm (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $sgemm
+
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
@@ -3118,6 +3133,13 @@
 extern "C"
 #endif
 char $sgemm ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$sgemm || defined __stub___$sgemm
+choke me
+#endif
+
 int
 main ()
 {
@@ -3147,33 +3169,41 @@
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_Lib=yes"
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_Lib=no"
+	eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval 'as_val=${'$as_ac_Lib'}
+ac_res=`eval 'as_val=${'$as_ac_var'}
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
+if test `eval 'as_val=${'$as_ac_var'}
 		 $as_echo "$as_val"'` = yes; then
-  as_ac_Lib=`$as_echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5
-$as_echo_n "checking for $dgemm in -ldgemm... " >&6; }
+  ax_blas_ok=yes
+	     BLAS_LIBS="-framework vecLib"
+fi
+
+	LIBS="$save_LIBS"
+fi
+
+# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+if test $ax_blas_ok = no; then
+	as_ac_Lib=`$as_echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5
+$as_echo_n "checking for $sgemm in -lblas... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldgemm -lblas $LIBS"
+LIBS="-lblas  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3187,11 +3217,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char $dgemm ();
+char $sgemm ();
 int
 main ()
 {
-return $dgemm ();
+return $sgemm ();
   ;
   return 0;
 }
@@ -3236,14 +3266,14 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  as_ac_Lib=`$as_echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5
-$as_echo_n "checking for $sgemm in -lsgemm... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5
+$as_echo_n "checking for $dgemm in -ldgemm... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsgemm -lblas $LIBS"
+LIBS="-ldgemm -lblas $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3257,11 +3287,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char $sgemm ();
+char $dgemm ();
 int
 main ()
 {
-return $sgemm ();
+return $dgemm ();
   ;
   return 0;
 }
@@ -3306,25 +3336,14 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"
-fi
-
-fi
-
-fi
-
-fi
-
-# BLAS in Intel MKL library?
-if test $ax_blas_ok = no; then
-	as_ac_Lib=`$as_echo "ac_cv_lib_mkl_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lmkl" >&5
-$as_echo_n "checking for $sgemm in -lmkl... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5
+$as_echo_n "checking for $sgemm in -lsgemm... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmkl  $LIBS"
+LIBS="-lsgemm -lblas $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3387,43 +3406,32 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes;BLAS_LIBS="-lmkl"
+  ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"
 fi
 
 fi
 
-# BLAS in Apple vecLib library?
+fi
+
+fi
+
+# BLAS in Intel MKL library?
 if test $ax_blas_ok = no; then
-	save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
-	as_ac_var=`$as_echo "ac_cv_func_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm" >&5
-$as_echo_n "checking for $sgemm... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+	as_ac_Lib=`$as_echo "ac_cv_lib_mkl_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lmkl" >&5
+$as_echo_n "checking for $sgemm in -lmkl... " >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmkl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $sgemm to an innocuous variant, in case <limits.h> declares $sgemm.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $sgemm innocuous_$sgemm
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $sgemm (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $sgemm
-
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
@@ -3431,13 +3439,6 @@
 extern "C"
 #endif
 char $sgemm ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$sgemm || defined __stub___$sgemm
-choke me
-#endif
-
 int
 main ()
 {
@@ -3467,28 +3468,29 @@
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  eval "$as_ac_Lib=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	eval "$as_ac_Lib=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
+ac_res=`eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
+if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"
+  ax_blas_ok=yes
+	     BLAS_LIBS="-lmkl"
 fi
 
-	LIBS="$save_LIBS"
 fi
 
 # BLAS in Alpha CXML library?
@@ -4571,23 +4573,38 @@
 
 fi
 
-# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+# BLAS in Apple vecLib library?
 if test $ax_blas_ok = no; then
-	as_ac_Lib=`$as_echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5
-$as_echo_n "checking for $sgemm in -lblas... " >&6; }
-if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+	save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
+	as_ac_var=`$as_echo "ac_cv_func_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm" >&5
+$as_echo_n "checking for $sgemm... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* Define $sgemm to an innocuous variant, in case <limits.h> declares $sgemm.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $sgemm innocuous_$sgemm
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $sgemm (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $sgemm
+
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
@@ -4595,6 +4612,13 @@
 extern "C"
 #endif
 char $sgemm ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$sgemm || defined __stub___$sgemm
+choke me
+#endif
+
 int
 main ()
 {
@@ -4624,33 +4648,41 @@
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_Lib=yes"
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_Lib=no"
+	eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval 'as_val=${'$as_ac_Lib'}
+ac_res=`eval 'as_val=${'$as_ac_var'}
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Lib'}
+if test `eval 'as_val=${'$as_ac_var'}
 		 $as_echo "$as_val"'` = yes; then
-  as_ac_Lib=`$as_echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5
-$as_echo_n "checking for $dgemm in -ldgemm... " >&6; }
+  ax_blas_ok=yes
+	     BLAS_LIBS="-framework vecLib"
+fi
+
+	LIBS="$save_LIBS"
+fi
+
+# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
+if test $ax_blas_ok = no; then
+	as_ac_Lib=`$as_echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5
+$as_echo_n "checking for $sgemm in -lblas... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldgemm -lblas $LIBS"
+LIBS="-lblas  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4664,11 +4696,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char $dgemm ();
+char $sgemm ();
 int
 main ()
 {
-return $dgemm ();
+return $sgemm ();
   ;
   return 0;
 }
@@ -4713,14 +4745,14 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  as_ac_Lib=`$as_echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5
-$as_echo_n "checking for $sgemm in -lsgemm... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5
+$as_echo_n "checking for $dgemm in -ldgemm... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsgemm -lblas $LIBS"
+LIBS="-ldgemm -lblas $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4734,11 +4766,11 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char $sgemm ();
+char $dgemm ();
 int
 main ()
 {
-return $sgemm ();
+return $dgemm ();
   ;
   return 0;
 }
@@ -4783,25 +4815,14 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"
-fi
-
-fi
-
-fi
-
-fi
-
-# BLAS in Intel MKL library?
-if test $ax_blas_ok = no; then
-	as_ac_Lib=`$as_echo "ac_cv_lib_mkl_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lmkl" >&5
-$as_echo_n "checking for $sgemm in -lmkl... " >&6; }
+  as_ac_Lib=`$as_echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5
+$as_echo_n "checking for $sgemm in -lsgemm... " >&6; }
 if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmkl  $LIBS"
+LIBS="-lsgemm -lblas $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4864,43 +4885,32 @@
 $as_echo "$ac_res" >&6; }
 if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes;BLAS_LIBS="-lmkl"
+  ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"
 fi
 
 fi
 
-# BLAS in Apple vecLib library?
+fi
+
+fi
+
+# BLAS in Intel MKL library?
 if test $ax_blas_ok = no; then
-	save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
-	as_ac_var=`$as_echo "ac_cv_func_$sgemm" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $sgemm" >&5
-$as_echo_n "checking for $sgemm... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+	as_ac_Lib=`$as_echo "ac_cv_lib_mkl_$sgemm" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $sgemm in -lmkl" >&5
+$as_echo_n "checking for $sgemm in -lmkl... " >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmkl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $sgemm to an innocuous variant, in case <limits.h> declares $sgemm.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $sgemm innocuous_$sgemm
 
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $sgemm (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $sgemm
-
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
    builtin and then its argument prototype would still apply.  */
@@ -4908,13 +4918,6 @@
 extern "C"
 #endif
 char $sgemm ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$sgemm || defined __stub___$sgemm
-choke me
-#endif
-
 int
 main ()
 {
@@ -4944,28 +4947,29 @@
 	 test "$cross_compiling" = yes ||
 	 $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  eval "$as_ac_Lib=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	eval "$as_ac_var=no"
+	eval "$as_ac_Lib=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
+ac_res=`eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'`
 	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_var'}
+if test `eval 'as_val=${'$as_ac_Lib'}
 		 $as_echo "$as_val"'` = yes; then
-  ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"
+  ax_blas_ok=yes
+	     BLAS_LIBS="-lmkl"
 fi
 
-	LIBS="$save_LIBS"
 fi
 
 # BLAS in Alpha CXML library?
diff --git a/lib/BLAS/Types.hs b/lib/BLAS/Types.hs
--- a/lib/BLAS/Types.hs
+++ b/lib/BLAS/Types.hs
@@ -9,48 +9,63 @@
 
 module BLAS.Types (
     OrderEnum(..),
+    flipOrder,
+
     TransEnum(..),
+    flipTrans,
+
     UpLoEnum(..),
+    flipUpLo,
+
     DiagEnum(..),
+
     SideEnum(..),
-    
-    flipOrder,
-    flipTrans,
-    flipUpLo,
     flipSide,
+
+    ConjEnum(..),
+    flipConj,
+        
     ) where
 
 -- | Matrix element storage order.
-data OrderEnum = RowMajor | ColMajor deriving (Eq, Show, Enum)
-
--- | Transpose type.
-data TransEnum = NoTrans | ConjTrans deriving (Eq, Show, Enum)
-
--- | Lower or upper triangular storage.
-data UpLoEnum = Upper | Lower deriving (Eq, Show, Enum)
-
--- | Diagonal storage.
-data DiagEnum = Unit | NonUnit deriving (Eq, Show, Enum)
-
--- | Multiplication side.
-data SideEnum = LeftSide | RightSide deriving (Eq, Show, Enum)
+data OrderEnum = RowMajor | ColMajor deriving (Eq, Show)
 
 -- | Exchange @RowMajor@ and @ColMajor@.
 flipOrder :: OrderEnum -> OrderEnum
 flipOrder RowMajor = ColMajor
 flipOrder ColMajor = RowMajor
 
+-- | Transpose type.
+data TransEnum = NoTrans | ConjTrans deriving (Eq, Show)
+
 -- | Exchange @NoTrans@ and @ConjTrans@.
 flipTrans :: TransEnum -> TransEnum
 flipTrans NoTrans = ConjTrans
 flipTrans ConjTrans = NoTrans
 
+-- | Lower or upper triangular storage.
+data UpLoEnum = Upper | Lower deriving (Eq, Show)
+
 -- | Exchange @Upper@ and @Lower@.
 flipUpLo :: UpLoEnum -> UpLoEnum
 flipUpLo Upper = Lower
 flipUpLo Lower = Upper
-        
+
+-- | Diagonal storage.
+data DiagEnum = Unit | NonUnit deriving (Eq, Show)
+
+-- | Multiplication side.
+data SideEnum = LeftSide | RightSide deriving (Eq, Show)
+
 -- | Exchange @LeftSide@ and @RigthSide@.
 flipSide :: SideEnum -> SideEnum
 flipSide LeftSide  = RightSide
 flipSide RightSide = LeftSide
+
+-- | Vector conjugacy
+data ConjEnum = NoConj | Conj deriving (Eq, Show)
+
+-- | Exchange @NoConj@ and @Conj@.
+flipConj :: ConjEnum -> ConjEnum
+flipConj NoConj = Conj
+flipConj Conj   = NoConj
diff --git a/lib/Data/Elem/BLAS/Level1.hs b/lib/Data/Elem/BLAS/Level1.hs
--- a/lib/Data/Elem/BLAS/Level1.hs
+++ b/lib/Data/Elem/BLAS/Level1.hs
@@ -1,6 +1,5 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# OPTIONS_GHC -fno-excess-precision #-}
-{-# OPTIONS_HADDOCK hide #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module     : Data.Elem.BLAS.Level1
@@ -9,25 +8,26 @@
 -- Maintainer : Patrick Perry <patperry@stanford.edu>
 -- Stability  : experimental
 --
+-- Vector operations.
+--
 
 module Data.Elem.BLAS.Level1
     where
      
-import Prelude hiding ( div )
-
+import Control.Monad( liftM )
 import Foreign ( Ptr, Storable, advancePtr, castPtr, peek, poke, with )
 import Foreign.Storable.Complex ()
 import Data.Complex ( Complex(..) )
 
 import Data.Elem.BLAS.Base
+import BLAS.Types
 import BLAS.CTypes
 import Data.Elem.BLAS.Double  
 import Data.Elem.BLAS.Zomplex
         
 -- | Types with vector-vector operations.
 class (Elem a) => BLAS1 a where
-    dotu  :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO a
-    dotc  :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO a
+    dot   :: ConjEnum -> ConjEnum -> Int -> Ptr a -> Int -> Ptr a -> Int -> IO a
     nrm2  :: Int -> Ptr a -> Int -> IO Double
     asum  :: Int -> Ptr a -> Int -> IO Double
     iamax :: Int -> Ptr a -> Int -> IO Int
@@ -41,29 +41,28 @@
     rotg  :: Ptr a -> Ptr a -> Ptr a -> Ptr a -> IO ()
     rot   :: Int -> Ptr a -> Int -> Ptr a -> Int -> Double -> Double -> IO ()
 
-    -- Replaces @y@ with @conj y@.
+    -- | Replaces @y@ with @conj y@.
     vconj  :: Int -> Ptr a -> Int -> IO ()
 
-    -- Replaces @y@ with @alpha (conj x) + y@
+    -- | Replaces @y@ with @alpha (conj x) + y@
     acxpy :: Int -> a -> Ptr a -> Int -> Ptr a -> Int -> IO ()
 
-    -- Replaces @y@ with @x*y@.
+    -- | Replaces @y@ with @x*y@.
     vmul :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO ()
 
-    -- Replaces @y@ with @conj(x)*y@.
+    -- | Replaces @y@ with @conj(x)*y@.
     vcmul :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO ()
 
-    -- Replaces @y@ with @y/x@.
+    -- | Replaces @y@ with @y/x@.
     vdiv :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO ()
 
-    -- Replaces @y@ with @y/conj(x)@.
+    -- | Replaces @y@ with @y/conj(x)@.
     vcdiv :: Int -> Ptr a -> Int -> Ptr a -> Int -> IO ()
 
 
 
 instance BLAS1 Double where
-    dotu  = ddot
-    dotc  = ddot
+    dot _ _ = ddot
     nrm2  = dnrm2
     asum  = dasum
     iamax = idamax
@@ -81,15 +80,21 @@
     vcdiv  = vdiv
 
 instance BLAS1 (Complex Double) where
-    dotu n pX incX pY incY =
-        with 0 $ \pDotu -> do
-            zdotu_sub n pX incX pY incY pDotu
-            peek pDotu
+    dot conjX conjY n pX incX pY incY =
+        case (conjX, conjY) of
+            (NoConj, NoConj) -> dotc
+            (Conj  , NoConj) -> dotu
+            (Conj  , Conj  ) -> liftM conjugate dotc
+            (NoConj, Conj  ) -> liftM conjugate dotu
+      where
+        dotu = with 0 $ \pDotu -> do
+                   zdotu_sub n pX incX pY incY pDotu
+                   peek pDotu
 
-    dotc n pX incX pY incY =
-        with 0 $ \pDotc -> do
-            zdotc_sub n pX incX pY incY pDotc
-            peek pDotc
+        dotc = with 0 $ \pDotc -> do
+                   zdotc_sub n pX incX pY incY pDotc
+                   peek pDotc
+    {-# INLINE dot #-}
 
     nrm2  = znrm2
     asum  = zasum
diff --git a/lib/Data/Elem/BLAS/Level2.hs b/lib/Data/Elem/BLAS/Level2.hs
--- a/lib/Data/Elem/BLAS/Level2.hs
+++ b/lib/Data/Elem/BLAS/Level2.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE FlexibleInstances #-}
-{-# OPTIONS_HADDOCK hide #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module     : Data.Elem.BLAS.Level2
@@ -7,6 +6,8 @@
 -- License    : BSD3
 -- Maintainer : Patrick Perry <patperry@stanford.edu>
 -- Stability  : experimental
+--
+-- Matrix-Vector operations.
 --
 
 module Data.Elem.BLAS.Level2
diff --git a/lib/Data/Elem/BLAS/Level3.hs b/lib/Data/Elem/BLAS/Level3.hs
--- a/lib/Data/Elem/BLAS/Level3.hs
+++ b/lib/Data/Elem/BLAS/Level3.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE FlexibleInstances #-}
-{-# OPTIONS_HADDOCK hide #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module     : Data.Elem.BLAS.Level3
@@ -7,6 +6,8 @@
 -- License    : BSD3
 -- Maintainer : Patrick Perry <patperry@stanford.edu>
 -- Stability  : experimental
+--
+-- Matrix-Matrix operations.
 --
 
 module Data.Elem.BLAS.Level3
diff --git a/lib/Data/Matrix/Banded.hs b/lib/Data/Matrix/Banded.hs
--- a/lib/Data/Matrix/Banded.hs
+++ b/lib/Data/Matrix/Banded.hs
@@ -14,8 +14,10 @@
     Banded,
 
     -- * Overloaded interface for banded matrices
-    BaseBanded( numLower, numUpper, bandwidths
-              , maybeMatrixStorageFromBanded, maybeBandedFromMatrixStorage, coerceBanded ),
+    BaseBanded( numLower, numUpper, bandwidths, ldaBanded
+              , isHermBanded, transEnumBanded
+              , maybeMatrixStorageFromBanded 
+              , maybeBandedFromMatrixStorage, coerceBanded ),
 
     -- * Overloaded interface for matrices
     module Data.Matrix.Class,
diff --git a/lib/Data/Matrix/Banded/Base.hs b/lib/Data/Matrix/Banded/Base.hs
--- a/lib/Data/Matrix/Banded/Base.hs
+++ b/lib/Data/Matrix/Banded/Base.hs
@@ -96,9 +96,14 @@
     -- banded matrix.
     ldaBanded :: a (n,p) e -> Int
     
-    -- | Indicate whether or not the banded matrix is transposed and
-    -- conjugated.
+    -- | Get the storage type of the banded matrix.
+    transEnumBanded :: a (n,p) e -> TransEnum
+
+    -- | Indicate whether or not the banded matrix storage is 
+    -- transposed and conjugated.
     isHermBanded :: a (n,p) e -> Bool
+    isHermBanded = (ConjTrans ==) . transEnumBanded
+    {-# INLINE isHermBanded #-}
 
     -- | Cast the shape type of the banded matrix.
     coerceBanded :: a np e -> a np' e
@@ -425,8 +430,8 @@
     {-# INLINE bandwidths #-}
     ldaBanded = IO.ldaIOBanded
     {-# INLINE ldaBanded #-}
-    isHermBanded = IO.isHermIOBanded
-    {-# INLINE isHermBanded #-}
+    transEnumBanded = IO.transEnumIOBanded
+    {-# INLINE transEnumBanded #-}
     maybeMatrixStorageFromBanded = IO.maybeMatrixStorageFromIOBanded
     {-# INLINE maybeMatrixStorageFromBanded #-}
     maybeBandedFromMatrixStorage = IO.maybeIOBandedFromMatrixStorage
@@ -652,8 +657,8 @@
     {-# INLINE bandwidths #-}
     ldaBanded (Banded a) = IO.ldaIOBanded a
     {-# INLINE ldaBanded #-}
-    isHermBanded (Banded a) = IO.isHermIOBanded a
-    {-# INLINE isHermBanded #-}
+    transEnumBanded (Banded a) = IO.transEnumIOBanded a
+    {-# INLINE transEnumBanded #-}
     maybeMatrixStorageFromBanded (Banded a) = liftM Matrix $ IO.maybeMatrixStorageFromIOBanded a
     {-# INLINE maybeMatrixStorageFromBanded #-}
     maybeBandedFromMatrixStorage mn kl (Matrix a) = 
diff --git a/lib/Data/Matrix/Banded/Class.hs b/lib/Data/Matrix/Banded/Class.hs
--- a/lib/Data/Matrix/Banded/Class.hs
+++ b/lib/Data/Matrix/Banded/Class.hs
@@ -15,7 +15,8 @@
 module Data.Matrix.Banded.Class (
     -- * Banded matrix type classes
     BaseBanded( numLower, numUpper, bandwidths, ldaBanded, isHermBanded
-              , maybeMatrixStorageFromBanded, maybeBandedFromMatrixStorage, coerceBanded ),
+              , transEnumBanded, maybeMatrixStorageFromBanded
+              , maybeBandedFromMatrixStorage, coerceBanded ),
     ReadBanded,
     WriteBanded,
 
diff --git a/lib/Data/Matrix/Banded/IOBase.hs b/lib/Data/Matrix/Banded/IOBase.hs
--- a/lib/Data/Matrix/Banded/IOBase.hs
+++ b/lib/Data/Matrix/Banded/IOBase.hs
@@ -56,34 +56,40 @@
 --       are supported.
 --
 data IOBanded np e =
-    IOBanded { fptrIOBanded     :: {-# UNPACK #-} !(ForeignPtr e)
-             , ptrIOBanded      :: {-# UNPACK #-} !(Ptr e)
-             , numRowsIOBanded  :: {-# UNPACK #-} !Int
-             , numColsIOBanded  :: {-# UNPACK #-} !Int
-             , numLowerIOBanded :: {-# UNPACK #-} !Int
-             , numUpperIOBanded :: {-# UNPACK #-} !Int
-             , ldaIOBanded      :: {-# UNPACK #-} !Int
-             , isHermIOBanded   :: {-# UNPACK #-} !Bool
+    IOBanded { transEnumIOBanded :: {-# UNPACK #-} !TransEnum
+             , numRowsIOBanded   :: {-# UNPACK #-} !Int
+             , numColsIOBanded   :: {-# UNPACK #-} !Int
+             , numLowerIOBanded  :: {-# UNPACK #-} !Int
+             , numUpperIOBanded  :: {-# UNPACK #-} !Int
+             , fptrIOBanded      :: {-# UNPACK #-} !(ForeignPtr e)
+             , ptrIOBanded       :: {-# UNPACK #-} !(Ptr e)
+             , ldaIOBanded       :: {-# UNPACK #-} !Int
              }
 
 hermIOBanded :: IOBanded np e -> IOBanded pn e
-hermIOBanded a = a{ numRowsIOBanded  = numColsIOBanded a
-                  , numColsIOBanded  = numRowsIOBanded a
-                  , numLowerIOBanded = numUpperIOBanded a
-                  , numUpperIOBanded = numLowerIOBanded a
-                  , isHermIOBanded   = not (isHermIOBanded a)
+hermIOBanded a = a{ numRowsIOBanded   = numColsIOBanded a
+                  , numColsIOBanded   = numRowsIOBanded a
+                  , numLowerIOBanded  = numUpperIOBanded a
+                  , numUpperIOBanded  = numLowerIOBanded a
+                  , transEnumIOBanded = flipTrans (transEnumIOBanded a)
                   }
 {-# INLINE hermIOBanded #-}
 
+isHermIOBanded :: IOBanded np e -> Bool
+isHermIOBanded = (ConjTrans ==) . transEnumIOBanded
+{-# INLINE isHermIOBanded #-}
+
 indexIOBanded :: IOBanded np e -> (Int,Int) -> Int
-indexIOBanded (IOBanded _ _ _ _ kl ku ld h) (i,j) =
-    let (ku',i',j') = if h then (kl,j,i) else (ku,i,j)
+indexIOBanded (IOBanded h _ _ kl ku _ _ ld) (i,j) =
+    let (ku',i',j') = if h == ConjTrans then (kl,j,i) else (ku,i,j)
     in ku' + (i' - j') + j' * ld
 {-# INLINE indexIOBanded #-}
 
 hasStorageIOBanded :: IOBanded np e -> (Int,Int) -> Bool
-hasStorageIOBanded (IOBanded _ _ m n kl ku _ h) (i,j) =
-    let (m',kl',ku',i',j') = if h then (n,ku,kl,j,i) else (m,kl,ku,i,j)
+hasStorageIOBanded (IOBanded h m n kl ku _ _ _) (i,j) =
+    let (m',kl',ku',i',j') = if h == ConjTrans
+                                 then (n,ku,kl,j,i) 
+                                 else (m,kl,ku,i,j)
     in inRange (max 0 (j'-ku'), min (m'-1) (j'+kl')) i'
 {-# INLINE hasStorageIOBanded #-}
 
@@ -104,16 +110,16 @@
 {-# INLINE withIOBandedElem #-}
 
 maybeMatrixStorageFromIOBanded :: IOBanded (n,p) e -> Maybe (IOMatrix (k,p) e)
-maybeMatrixStorageFromIOBanded (IOBanded f p _ n kl ku l h)
-    | h         = Nothing
-    | otherwise = Just $ IOMatrix f p (kl+1+ku) n l False
+maybeMatrixStorageFromIOBanded (IOBanded h _ n kl ku f p l)
+    | h == ConjTrans = Nothing
+    | otherwise      = Just $ IOMatrix NoTrans (kl+1+ku) n f p l
 {-# INLINE maybeMatrixStorageFromIOBanded #-}
 
 maybeIOBandedFromMatrixStorage :: (Int,Int)
                    -> (Int,Int)
                    -> IOMatrix np e
                    -> Maybe (IOBanded np' e)
-maybeIOBandedFromMatrixStorage (m,n) (kl,ku) (IOMatrix f p m' n' l h)
+maybeIOBandedFromMatrixStorage (m,n) (kl,ku) (IOMatrix h m' n' f p l)
     | m < 0 || n < 0 =
         err "dimensions must be non-negative."
     | kl < 0 =
@@ -130,30 +136,32 @@
     | n' /= n =
         err $ "numbers of columns must be equal"
             ++ " to the number of columns in the underlying matrix."
-    | h =
+    | h == ConjTrans =
         Nothing    
     | otherwise =
-        Just $ IOBanded f p m n kl ku l False
+        Just $ IOBanded NoTrans m n kl ku f p l
   where
     err s = 
       error $ "maybeBandedFromMatrixStorage " ++ show (m,n) ++ " " ++ show (kl,ku) 
             ++ " <matrix of shape " ++ show (m',n') ++ ">: " ++ show s
 
 viewVectorAsIOBanded :: (Int,Int) -> IOVector k e -> IOBanded (n,p) e
-viewVectorAsIOBanded (m,n) (IOVector f p k l c)
+viewVectorAsIOBanded (m,n) (IOVector c k f p l)
     | k /= m && k /= n =
         error $ "viewVectorAsBanded " ++ show (m,n) ++ " "
               ++ " <vector of dim " ++ show k ++ ">: "
               ++ "vector must have length equal to one of the specified"
               ++ " diemsion sizes"
     | otherwise =
-        IOBanded f p m n 0 0 l c
+        let h = if c == Conj then ConjTrans else NoTrans
+        in IOBanded h m n 0 0 f p l
 {-# INLINE viewVectorAsIOBanded #-}
 
 maybeViewIOBandedAsVector :: IOBanded (n,p) e -> Maybe (IOVector k e)
-maybeViewIOBandedAsVector (IOBanded f p m n kl ku l h)
+maybeViewIOBandedAsVector (IOBanded h m n kl ku f p l)
     | kl == 0 && ku == 0 =
-        Just $ IOVector f p (min m n) l h
+        let c = if h == ConjTrans then Conj else NoConj
+        in Just $ IOVector c (min m n) f p l
     | otherwise =
         Nothing
 {-# INLINE maybeViewIOBandedAsVector #-}
@@ -176,7 +184,7 @@
 {-# INLINE boundsIOBanded #-}
 
 sizeIOBanded :: IOBanded np e -> Int
-sizeIOBanded (IOBanded _ _ m n kl ku _ _) =
+sizeIOBanded (IOBanded _ m n kl ku _ _ _) =
     foldl' (+) 0 $ map (diagLen (m,n)) [(-kl)..ku]
 
 indicesIOBanded :: IOBanded np e -> [(Int,Int)]
@@ -266,11 +274,11 @@
     | otherwise =
         let m'  = kl + 1 + ku
             l   = m'
-            h   = False
+            h   = NoTrans
         in do
             fp <- mallocForeignPtrArray (m' * n)
             let p = unsafeForeignPtrToPtr fp
-            return $ IOBanded fp p m n kl ku l h
+            return $ IOBanded h m n kl ku fp p l
     where
       err s = fail $ "newBanded_ " ++ show (m,n) ++ " " ++ show (kl,ku) ++ ": " ++ s
 
@@ -353,8 +361,8 @@
                       => IOBanded np e
                       -> Int
                       -> (Int, IOVector k e, Int)
-unsafeRowViewIOBanded a@(IOBanded f p _ n kl ku ld h) i =
-    if h then
+unsafeRowViewIOBanded a@(IOBanded h _ n kl ku f p ld) i =
+    if h == ConjTrans then
         case unsafeColViewIOBanded (hermIOBanded a) i of
             (nb, v, na) -> (nb, conj v, na)
     else
@@ -365,14 +373,14 @@
             p'  = p `advancePtr` (r + c * ld)
             inc = max (ld - 1) 1
             len = n - (nb + na)
-        in (nb, IOVector f p' len inc False, na)
+        in (nb, IOVector NoConj len f p' inc, na)
 
 unsafeColViewIOBanded :: (Elem e)
                       => IOBanded np e
                       -> Int
                       -> (Int, IOVector k e, Int)
-unsafeColViewIOBanded a@(IOBanded f p m _ kl ku ld h) j =
-    if h then
+unsafeColViewIOBanded a@(IOBanded h m _ kl ku f p ld) j =
+    if h == ConjTrans then
         case unsafeRowViewIOBanded (hermIOBanded a) j of
             (nb, v, na) -> (nb, conj v, na)
     else
@@ -383,19 +391,19 @@
             p'  = p `advancePtr` (r + c * ld)
             inc = 1
             len = m - (nb + na)
-        in (nb, IOVector f p' len inc False, na)
+        in (nb, IOVector NoConj len f p' inc, na)
 
 unsafeDiagViewIOBanded :: (Elem e) => 
     IOBanded np e -> Int -> IOVector k e
-unsafeDiagViewIOBanded a@(IOBanded fp p m n _ _ ld h) d
-    | h         = conj $ unsafeDiagViewIOBanded (hermIOBanded a) (negate d)
+unsafeDiagViewIOBanded a@(IOBanded h m n _ _ fp p ld) d
+    | h == ConjTrans =
+         conj $ unsafeDiagViewIOBanded (hermIOBanded a) (negate d)
     | otherwise =
         let off = indexIOBanded a (diagStart d)
             p'  = p `advancePtr` off
             len = diagLen (m,n) d
             inc = ld
-            c   = False
-        in (IOVector fp p' len inc c)
+        in (IOVector NoConj len fp p' inc)
 
 
 unsafeGetRowIOBanded :: (WriteVector y e IO, BLAS1 e) 
@@ -426,7 +434,7 @@
         gbmv alpha a x beta (conj y)
         doConjVector y
     | otherwise =
-        let transA = transIOBanded a
+        let transA = transEnumIOBanded a
             (m,n)  = case (isHermIOBanded a) of
                          False -> shape a
                          True  -> (flipShape . shape) a
@@ -683,11 +691,3 @@
     {-# INLINE unsafeDoSSolve #-}
     unsafeDoSSolveMat  = tbsm'
     {-# INLINE unsafeDoSSolveMat #-}    
-
-transIOBanded :: IOBanded np e -> TransEnum
-transIOBanded a =
-    case (isHermIOBanded a) of
-          False -> NoTrans
-          True  -> ConjTrans
-{-# INLINE transIOBanded #-}
-
diff --git a/lib/Data/Matrix/Banded/STBase.hs b/lib/Data/Matrix/Banded/STBase.hs
--- a/lib/Data/Matrix/Banded/STBase.hs
+++ b/lib/Data/Matrix/Banded/STBase.hs
@@ -111,8 +111,8 @@
     {-# INLINE bandwidths #-}
     ldaBanded (STBanded a) = IO.ldaIOBanded a
     {-# INLINE ldaBanded #-}
-    isHermBanded (STBanded a) = IO.isHermIOBanded a
-    {-# INLINE isHermBanded #-}
+    transEnumBanded (STBanded a) = IO.transEnumIOBanded a
+    {-# INLINE transEnumBanded #-}
     maybeMatrixStorageFromBanded (STBanded a) = 
         liftM STMatrix $ IO.maybeMatrixStorageFromIOBanded a
     {-# INLINE maybeMatrixStorageFromBanded #-}
diff --git a/lib/Data/Matrix/Dense.hs b/lib/Data/Matrix/Dense.hs
--- a/lib/Data/Matrix/Dense.hs
+++ b/lib/Data/Matrix/Dense.hs
@@ -15,7 +15,7 @@
     Matrix,
 
     -- * Overloaded interface for dense matrices
-    BaseMatrix( isHermMatrix, coerceMatrix ),
+    BaseMatrix( ldaMatrix, isHermMatrix, transEnumMatrix, coerceMatrix ),
 
     -- * Overloaded interface for matrices
     module Data.Matrix.Class,
diff --git a/lib/Data/Matrix/Dense/Base.hs b/lib/Data/Matrix/Dense/Base.hs
--- a/lib/Data/Matrix/Dense/Base.hs
+++ b/lib/Data/Matrix/Dense/Base.hs
@@ -71,9 +71,18 @@
 -- | Common functionality for all dense matrix types.
 class (HasVectorView a, Elem e, MatrixShaped a
       , BaseVector (VectorView a) e) => BaseMatrix a e where
-          
+      
+    -- | Get the leading dimension of the storage of the matrix.    
     ldaMatrix :: a (n,p) e -> Int
+    
+    -- | Get the storage type of the matrix.
+    transEnumMatrix :: a (n,p) e -> TransEnum
+    
+    -- | Indicate whether or not the underlying matrix storage is
+    -- transposed and conjugated.
     isHermMatrix :: a (n,p) e -> Bool
+    isHermMatrix = (ConjTrans ==) . transEnumMatrix
+    {-# INLINE isHermMatrix #-}
 
     -- | Cast the shape type of the matrix.
     coerceMatrix :: a np e -> a np' e
@@ -708,7 +717,7 @@
         
     | isConj y && (isConj x || stride x == 1) =
         let transA = if isConj x then NoTrans else ConjTrans
-            transB = transMatrix (herm a)
+            transB = transEnumMatrix (herm a)
             m      = 1
             n      = dim y
             k      = dim x
@@ -731,7 +740,7 @@
         doConjVector y
         
     | otherwise =
-        let transA = transMatrix a
+        let transA = transEnumMatrix a
             (m,n)  = case (isHermMatrix a) of
                          False -> shape a
                          True  -> (flipShape . shape) a
@@ -757,8 +766,8 @@
         scaleByMatrix beta c
     | isHermMatrix c = gemm (conjugate alpha) (herm b) (herm a) (conjugate beta) (herm c)
     | otherwise =
-        let transA = transMatrix a
-            transB = transMatrix b
+        let transA = transEnumMatrix a
+            transB = transEnumMatrix b
             (m,n)  = shape c
             k      = numCols a
             ldA    = ldaMatrix a
@@ -1197,8 +1206,8 @@
 instance (Elem e) => BaseMatrix IOMatrix e where
     ldaMatrix = ldaMatrixIOMatrix
     {-# INLINE ldaMatrix #-}
-    isHermMatrix = isHermIOMatrix
-    {-# INLINE isHermMatrix #-}
+    transEnumMatrix = transEnumIOMatrix
+    {-# INLINE transEnumMatrix #-}
     unsafeSubmatrixView = unsafeSubmatrixViewIOMatrix
     {-# INLINE unsafeSubmatrixView #-}
     unsafeDiagView = unsafeDiagViewIOMatrix
@@ -1411,8 +1420,8 @@
 {-# INLINE unsafeDiag #-}
 
 unsafeAtMatrix :: (Elem e) => Matrix np e -> (Int,Int) -> e
-unsafeAtMatrix (Matrix (IOMatrix f p _ _ l h)) (i,j)
-    | h = inlinePerformIO $ do
+unsafeAtMatrix (Matrix (IOMatrix h _ _ f p l)) (i,j)
+    | h == ConjTrans = inlinePerformIO $ do
         e  <- liftM conjugate $ peekElemOff p (i*l+j)
         io <- touchForeignPtr f
         e `seq` io `seq` return e
@@ -1480,8 +1489,8 @@
 instance (Elem e) => BaseMatrix Matrix e where
     ldaMatrix (Matrix a) = ldaMatrixIOMatrix a
     {-# INLINE ldaMatrix #-}
-    isHermMatrix (Matrix a) = isHermMatrix a
-    {-# INLINE isHermMatrix #-}
+    transEnumMatrix (Matrix a) = transEnumIOMatrix a
+    {-# INLINE transEnumMatrix #-}
     unsafeSubmatrixView (Matrix a) ij mn =
         Matrix (unsafeSubmatrixViewIOMatrix a ij mn)
     {-# INLINE unsafeSubmatrixView #-}
@@ -1781,13 +1790,6 @@
     c <- newCopyMatrix a
     f c b
     return c
-
-transMatrix :: (BaseMatrix a e) => a (n,p) e -> TransEnum
-transMatrix a = 
-    case (isHermMatrix a) of
-          False -> NoTrans
-          True  -> ConjTrans
-{-# INLINE transMatrix #-}
 
 indexOfMatrix :: (BaseMatrix a e) => a (n,p) e -> (Int,Int) -> Int
 indexOfMatrix a (i,j) = 
diff --git a/lib/Data/Matrix/Dense/Class.hs b/lib/Data/Matrix/Dense/Class.hs
--- a/lib/Data/Matrix/Dense/Class.hs
+++ b/lib/Data/Matrix/Dense/Class.hs
@@ -14,7 +14,7 @@
 
 module Data.Matrix.Dense.Class (
     -- * Dense matrix type classes
-    BaseMatrix( ldaMatrix, isHermMatrix, coerceMatrix ),
+    BaseMatrix( ldaMatrix, isHermMatrix, transEnumMatrix, coerceMatrix ),
     ReadMatrix,
     WriteMatrix,
     
diff --git a/lib/Data/Matrix/Dense/IOBase.hs b/lib/Data/Matrix/Dense/IOBase.hs
--- a/lib/Data/Matrix/Dense/IOBase.hs
+++ b/lib/Data/Matrix/Dense/IOBase.hs
@@ -41,12 +41,12 @@
 --       are supported.
 --
 data IOMatrix np e =
-      IOMatrix {-# UNPACK #-} !(ForeignPtr e) -- a pointer to the storage region
-               {-# UNPACK #-} !(Ptr e)        -- a pointer to the first element
+      IOMatrix {-# UNPACK #-} !TransEnum      -- indicates whether or not the matrix is transposed and conjugated
                {-# UNPACK #-} !Int            -- the number of rows in the matrix
                {-# UNPACK #-} !Int            -- the number of colunps in the matrix
+               {-# UNPACK #-} !(ForeignPtr e) -- a pointer to the storage region
+               {-# UNPACK #-} !(Ptr e)        -- a pointer to the first element
                {-# UNPACK #-} !Int            -- the leading dimension size of the matrix
-               {-# UNPACK #-} !Bool           -- indicates whether or not the matrix is transposed and conjugated
 
 -- | View an array in memory as a matrix.
 matrixViewArray :: (Elem e)
@@ -67,113 +67,118 @@
                        -> IOMatrix (n,p) e
 matrixViewArrayWithLda l f o (m,n) =
     let p = unsafeForeignPtrToPtr f `advancePtr` o
-    in IOMatrix f p m n l False
+    in IOMatrix NoTrans m n f p l
 {-# INLINE matrixViewArrayWithLda #-}
 
 
 numRowsIOMatrix :: IOMatrix np e -> Int
-numRowsIOMatrix (IOMatrix _ _ m _ _ _) = m
+numRowsIOMatrix (IOMatrix _ m _ _ _ _) = m
 {-# INLINE numRowsIOMatrix #-}
 
 numColsIOMatrix :: IOMatrix np e -> Int
-numColsIOMatrix (IOMatrix _ _ _ n _ _) = n
+numColsIOMatrix (IOMatrix _ _ n _ _ _) = n
 {-# INLINE numColsIOMatrix #-}
 
 ldaMatrixIOMatrix :: IOMatrix np e -> Int
-ldaMatrixIOMatrix (IOMatrix _ _ _ _ l _) = l
+ldaMatrixIOMatrix (IOMatrix _ _ _ _ _ l) = l
 {-# INLINE ldaMatrixIOMatrix #-}
 
+transEnumIOMatrix :: IOMatrix np e -> TransEnum
+transEnumIOMatrix (IOMatrix h _ _ _ _ _) = h
+{-# INLINE transEnumIOMatrix #-}
+
 isHermIOMatrix :: IOMatrix np e -> Bool
-isHermIOMatrix (IOMatrix _ _ _ _ _ h) = h
+isHermIOMatrix = (ConjTrans ==) . transEnumIOMatrix
 {-# INLINE isHermIOMatrix #-}
 
 hermIOMatrix :: IOMatrix np e -> IOMatrix nm e
-hermIOMatrix (IOMatrix f p m n l h) = (IOMatrix f p n m l (not h))
+hermIOMatrix (IOMatrix h m n f p l) = (IOMatrix (flipTrans h) n m f p l)
 {-# INLINE hermIOMatrix #-}
 
 unsafeSubmatrixViewIOMatrix :: (Elem e) =>
     IOMatrix np e -> (Int,Int) -> (Int,Int) -> IOMatrix np' e
-unsafeSubmatrixViewIOMatrix (IOMatrix f p _ _ l h) (i,j) (m',n') =
-    let o = if h then i*l+j else i+j*l
+unsafeSubmatrixViewIOMatrix (IOMatrix h _ _ f p l) (i,j) (m',n') =
+    let o = if h == ConjTrans then i*l+j else i+j*l
         p' = p `advancePtr` o
-    in IOMatrix f p' m' n' l h
+    in IOMatrix h m' n' f p' l
 {-# INLINE unsafeSubmatrixViewIOMatrix #-}
 
 unsafeRowViewIOMatrix :: (Elem e) => IOMatrix np e -> Int -> IOVector p e
-unsafeRowViewIOMatrix (IOMatrix f p _ n l h) i =
-    let (o,s) = if h then (i*l,1) else (i,l)
-        p'    = p `advancePtr` o
-    in IOVector f p' n s h
+unsafeRowViewIOMatrix (IOMatrix h _ n f p l) i =
+    let (c,o,s) = if h == ConjTrans then (Conj,i*l,1) else (NoConj,i,l)
+        p'      = p `advancePtr` o
+    in IOVector c n f p' s
 {-# INLINE unsafeRowViewIOMatrix #-}
 
 unsafeColViewIOMatrix :: (Elem e) => IOMatrix np e -> Int -> IOVector n e
-unsafeColViewIOMatrix (IOMatrix f p m _ l h) j =
-    let (o,s) = if h then (j,l) else (j*l,1)
-        p'    = p `advancePtr` o
-    in IOVector f p' m s h
+unsafeColViewIOMatrix (IOMatrix h m _ f p l) j =
+    let (c,o,s) = if h == ConjTrans then (Conj,j,l) else (NoConj,j*l,1)
+        p'      = p `advancePtr` o
+    in IOVector c m f p' s
 {-# INLINE unsafeColViewIOMatrix #-}
 
 unsafeDiagViewIOMatrix :: (Elem e) => IOMatrix np e -> Int -> IOVector k e
-unsafeDiagViewIOMatrix (IOMatrix f p m n l h) i =
+unsafeDiagViewIOMatrix (IOMatrix h m n f p l) i =
     let o = if i >= 0 
-                then if h then  i   else  i*l
-                else if h then -i*l else -i
+                then if h == ConjTrans then  i   else  i*l
+                else if h == ConjTrans then -i*l else -i
+        c  = if h == ConjTrans then Conj else NoConj
         p' = p `advancePtr` o
         k  = diagLen (m,n) i
         s  = l+1
-    in IOVector f p' k s h
+    in IOVector c k f p' s
 {-# INLINE unsafeDiagViewIOMatrix #-}
 
 maybeViewVectorAsRowIOMatrix :: (Elem e) => IOVector p e -> Maybe (IOMatrix p1 e)
-maybeViewVectorAsRowIOMatrix (IOVector f p n s c)
-    | c && (s == 1) =
-        Just $ IOMatrix f p 1 n (max 1 n) True
-    | not c =
-        Just $ IOMatrix f p 1 n s         False
+maybeViewVectorAsRowIOMatrix (IOVector c n f p s)
+    | c == Conj && s == 1 =
+        Just $ IOMatrix ConjTrans 1 n f p (max 1 n)
+    | c == NoConj =
+        Just $ IOMatrix NoTrans   1 n f p s
     | otherwise =
         Nothing
 {-# INLINE maybeViewVectorAsRowIOMatrix #-}
 
 maybeViewVectorAsColIOMatrix :: (Elem e) => IOVector n e -> Maybe (IOMatrix n1 e)
-maybeViewVectorAsColIOMatrix (IOVector f p n s c)
-    | c =
-        Just $ IOMatrix f p n 1 s         True
+maybeViewVectorAsColIOMatrix (IOVector c n f p s)
+    | c == Conj =
+        Just $ IOMatrix ConjTrans n 1 f p s        
     | s == 1 =
-        Just $ IOMatrix f p n 1 (max 1 n) False
+        Just $ IOMatrix NoTrans   n 1 f p (max 1 n)
     | otherwise =
         Nothing
 {-# INLINE maybeViewVectorAsColIOMatrix #-}
 
 maybeViewIOMatrixAsVector :: (Elem e) => IOMatrix np e -> Maybe (IOVector k e)
-maybeViewIOMatrixAsVector (IOMatrix f p m n l h)
-    | h         = Nothing
-    | l /= m    = Nothing
-    | otherwise = Just $ IOVector f p (m*n) 1 False
+maybeViewIOMatrixAsVector (IOMatrix h m n f p l)
+    | h == ConjTrans = Nothing
+    | l /= m         = Nothing
+    | otherwise      = Just $ IOVector NoConj (m*n) f p 1
 {-# INLINE maybeViewIOMatrixAsVector #-}
 
 maybeViewVectorAsIOMatrix :: (Elem e) => (Int,Int) -> IOVector k e -> Maybe (IOMatrix np e)
-maybeViewVectorAsIOMatrix (m,n) (IOVector f p k inc c)
+maybeViewVectorAsIOMatrix (m,n) (IOVector c k f p inc)
     | m*n /= k =
         error $ "maybeViewVectorAsMatrix " ++ show (m,n)
               ++ " <vector of dim " ++ show k ++ ">: vector dimension"
               ++ " must equal product of specified dimensions"
-    | c         = Nothing
+    | c == Conj = Nothing
     | inc /= 1  = Nothing
-    | otherwise = Just $ IOMatrix f p m n m False
+    | otherwise = Just $ IOMatrix NoTrans m n f p m
 {-# INLINE maybeViewVectorAsIOMatrix #-}
 
 liftIOMatrix :: (Elem e) => (forall n. IOVector n e -> IO ()) -> IOMatrix np e -> IO ()
-liftIOMatrix g (IOMatrix f p m n l h)
-    | h && (l == n) =
-        g (IOVector f p (m*n) 1 True)
-    | (not h) && (l == m) =
-        g (IOVector f p (m*n) 1 False)
+liftIOMatrix g (IOMatrix h m n f p l)
+    | h == ConjTrans && l == n =
+        g (IOVector Conj   (m*n) f p 1)
+    | h == NoTrans   && l == m =
+        g (IOVector NoConj (m*n) f p 1)
     | otherwise =
-        let (m',n') = if h then (n,m) else (m,n)
+        let (c,m',n') = if h == ConjTrans then (Conj,n,m) else (NoConj,m,n)
             end     = p `advancePtr` (n'*l)
             go p' | p' == end = return ()
                   | otherwise = do
-                      g (IOVector f p' m' 1 h)
+                      g (IOVector c m' f p' 1)
                       go (p' `advancePtr` l)
         in go p
 
@@ -203,7 +208,7 @@
 -- | Perform an 'IO' action with a pointer to the first element of the
 -- matrix.
 withIOMatrix :: IOMatrix (n,p) e -> (Ptr e -> IO a) -> IO a
-withIOMatrix (IOMatrix f p _ _ _ _) g = do
+withIOMatrix (IOMatrix _ _ _ f p _) g = do
     a <- g p
     touchForeignPtr f
     return a
@@ -217,15 +222,15 @@
             "Tried to create a matrix with shape `" ++ show (m,n) ++ "'"
     | otherwise =  do
         f <- mallocForeignPtrArray (m*n)
-        return (IOMatrix f (unsafeForeignPtrToPtr f) m n (max 1 m) False)
+        return $ IOMatrix NoTrans m n f (unsafeForeignPtrToPtr f) (max 1 m)
 {-# INLINE newIOMatrix_ #-}
 
 newCopyIOMatrix :: (BLAS1 e) => IOMatrix np e -> IO (IOMatrix np e)
-newCopyIOMatrix (IOMatrix f p m n l h) = 
-    let (m',n') = if h then (n,m) else (m,n)
+newCopyIOMatrix (IOMatrix h m n f p l) = 
+    let (m',n') = if h == ConjTrans then (n,m) else (m,n)
         l'      = max 1 m'
     in do
-        (IOMatrix f' p' _ _ _ _) <- newIOMatrix_ (m',n')
+        (IOMatrix _ _ _ f' p' _) <- newIOMatrix_ (m',n')
         if l == m'
             then do
                 BLAS.copy (m*n) p 1 p' 1
@@ -237,11 +242,11 @@
                 in go p p' 0
         touchForeignPtr f
         touchForeignPtr f'
-        return (IOMatrix f' p' m n l' h)
+        return (IOMatrix h m n f' p' l')
 {-# INLINE newCopyIOMatrix #-}
 
 shapeIOMatrix :: IOMatrix np e -> (Int,Int)
-shapeIOMatrix (IOMatrix _ _ m n _ _) = (m,n)
+shapeIOMatrix (IOMatrix _ m n _ _ _) = (m,n)
 {-# INLINE shapeIOMatrix #-}
 
 boundsIOMatrix :: IOMatrix np e -> ((Int,Int), (Int,Int))
@@ -249,7 +254,7 @@
 {-# INLINE boundsIOMatrix #-}
 
 sizeIOMatrix :: IOMatrix np e -> Int
-sizeIOMatrix (IOMatrix _ _ m n _ _) = m*n
+sizeIOMatrix (IOMatrix _ m n _ _ _) = m*n
 {-# INLINE sizeIOMatrix #-}
 
 getSizeIOMatrix :: IOMatrix np e -> IO Int
@@ -261,9 +266,9 @@
 {-# INLINE getMaxSizeIOMatrix #-}
 
 indicesIOMatrix :: IOMatrix np e -> [(Int,Int)]
-indicesIOMatrix (IOMatrix _ _ m n _ h)
-    | h         = [ (i,j) | i <- [ 0..m-1 ], j <- [ 0..n-1 ] ]
-    | otherwise = [ (i,j) | j <- [ 0..n-1 ], i <- [ 0..m-1 ] ]
+indicesIOMatrix (IOMatrix h m n _ _ _)
+    | h == ConjTrans = [ (i,j) | i <- [ 0..m-1 ], j <- [ 0..n-1 ] ]
+    | otherwise      = [ (i,j) | j <- [ 0..n-1 ], i <- [ 0..m-1 ] ]
 {-# INLINE indicesIOMatrix #-}
 
 getIndicesIOMatrix :: IOMatrix np e -> IO [(Int,Int)]
@@ -275,15 +280,17 @@
 {-# INLINE getIndicesIOMatrix' #-}
 
 getElemsIOMatrix :: (Elem e) => IOMatrix np e -> IO [e]
-getElemsIOMatrix (IOMatrix f p m n l h) 
-    | h         = liftM (map conjugate) $ 
-                      getElemsIOMatrix (IOMatrix f p n m l False)
-    | l == m    = getElemsIOVector (IOVector f p (m*n) 1 False)
+getElemsIOMatrix (IOMatrix h m n f p l)
+    | h == ConjTrans = 
+        liftM (map conjugate) $ 
+            getElemsIOMatrix (IOMatrix NoTrans n m f p l)
+    | l == m = 
+        getElemsIOVector (IOVector NoConj (m*n) f p 1)
     | otherwise =
         let end   = p `advancePtr` (n*l)
             go p' | p' == end = return []
                   | otherwise = unsafeInterleaveIO $ do
-                        c  <- getElemsIOVector (IOVector f p' m 1 False)
+                        c  <- getElemsIOVector (IOVector NoConj m f p' 1)
                         cs <- go (p' `advancePtr` l)
                         return (c ++ cs)
         in go p
@@ -291,15 +298,17 @@
 {-# SPECIALIZE INLINE getElemsIOMatrix :: IOMatrix np (Complex Double) -> IO [Complex Double] #-}
 
 getElemsIOMatrix' :: (Elem e) => IOMatrix np e -> IO [e]
-getElemsIOMatrix' (IOMatrix f p m n l h) 
-    | h         = liftM (map conjugate) $ 
-                      getElemsIOMatrix' (IOMatrix f p n m l False)
-    | l == m    = getElemsIOVector' (IOVector f p (m*n) 1 False)
+getElemsIOMatrix' (IOMatrix h m n f p l) 
+    | h == ConjTrans = 
+        liftM (map conjugate) $ 
+            getElemsIOMatrix' (IOMatrix NoTrans n m f p l)
+    | l == m    = 
+        getElemsIOVector' (IOVector NoConj (m*n) f p 1)
     | otherwise =
         let end   = p `advancePtr` (n*l)
             go p' | p' == end = return []
                   | otherwise = do
-                        c  <- getElemsIOVector' (IOVector f p' m 1 False)
+                        c  <- getElemsIOVector' (IOVector NoConj m f p' 1)
                         cs <- go (p' `advancePtr` l)
                         return (c ++ cs)
         in go p
@@ -321,8 +330,8 @@
 {-# INLINE getAssocsIOMatrix' #-}
 
 unsafeReadElemIOMatrix :: (Elem e) => IOMatrix np e -> (Int,Int) -> IO e
-unsafeReadElemIOMatrix (IOMatrix f p _ _ l h) (i,j)
-    | h = do
+unsafeReadElemIOMatrix (IOMatrix h _ _ f p l) (i,j)
+    | h == ConjTrans = do
         e <- liftM conjugate $ peekElemOff p (i*l+j)
         touchForeignPtr f
         return e
@@ -339,8 +348,8 @@
 
 unsafeWriteElemIOMatrix :: (Elem e) => 
     IOMatrix np e -> (Int,Int) -> e -> IO ()
-unsafeWriteElemIOMatrix (IOMatrix f p _ _ l h) (i,j) e
-    | h = do
+unsafeWriteElemIOMatrix (IOMatrix h _ _ f p l) (i,j) e
+    | h == ConjTrans = do
         pokeElemOff p (i*l+j) (conjugate e)
         touchForeignPtr f
     | otherwise = do
@@ -351,9 +360,10 @@
 
 unsafeModifyElemIOMatrix :: (Elem e) => 
     IOMatrix n e -> (Int,Int) -> (e -> e) -> IO ()
-unsafeModifyElemIOMatrix (IOMatrix f p _ _ l h) (i,j) g =
-    let g' = if h then conjugate . g . conjugate else g
-        p' = if h then p `advancePtr` (i*l+j) else p `advancePtr` (i+j*l)
+unsafeModifyElemIOMatrix (IOMatrix h _ _ f p l) (i,j) g =
+    let g' = if h == ConjTrans then conjugate . g . conjugate else g
+        p' = if h == ConjTrans then p `advancePtr` (i*l+j) 
+                               else p `advancePtr` (i+j*l)
     in do
         e <- peek p'
         poke p' (g' e)
@@ -363,9 +373,11 @@
 
 unsafeSwapElemsIOMatrix :: (Elem e) => 
     IOMatrix n e -> (Int,Int) -> (Int,Int) -> IO ()
-unsafeSwapElemsIOMatrix (IOMatrix f p _ _ l h) (i1,j1) (i2,j2) =
-    let (p1,p2) = if h then (p `advancePtr` (i1*l+j1), p `advancePtr` (i2*l+j2))
-                       else (p `advancePtr` (i1+j1*l), p `advancePtr` (i2+j2*l))
+unsafeSwapElemsIOMatrix (IOMatrix h _ _ f p l) (i1,j1) (i2,j2) =
+    let (p1,p2) = 
+            if h == ConjTrans 
+                then (p `advancePtr` (i1*l+j1), p `advancePtr` (i2*l+j2))
+                else (p `advancePtr` (i1+j1*l), p `advancePtr` (i2+j2*l))
     in do
         e1 <- peek p1
         e2 <- peek p2
diff --git a/lib/Data/Matrix/Dense/STBase.hs b/lib/Data/Matrix/Dense/STBase.hs
--- a/lib/Data/Matrix/Dense/STBase.hs
+++ b/lib/Data/Matrix/Dense/STBase.hs
@@ -156,8 +156,8 @@
 instance (Elem e) => BaseMatrix (STMatrix s) e where
     ldaMatrix (STMatrix a) = ldaMatrixIOMatrix a
     {-# INLINE ldaMatrix #-}
-    isHermMatrix (STMatrix a) = isHermMatrix a
-    {-# INLINE isHermMatrix #-}
+    transEnumMatrix (STMatrix a) = transEnumIOMatrix a
+    {-# INLINE transEnumMatrix #-}
     unsafeSubmatrixView (STMatrix a) ij mn =
         STMatrix (unsafeSubmatrixViewIOMatrix a ij mn)
     {-# INLINE unsafeSubmatrixView #-}
diff --git a/lib/Data/Vector/Dense.hs b/lib/Data/Vector/Dense.hs
--- a/lib/Data/Vector/Dense.hs
+++ b/lib/Data/Vector/Dense.hs
@@ -13,7 +13,7 @@
     Vector,
 
     -- * Overloaded interface for vectors
-    BaseVector( dim, conj, isConj, coerceVector ),
+    BaseVector( dim, conj, isConj, conjEnum, coerceVector ),
 
     -- * Creating new vectors
     vector, 
diff --git a/lib/Data/Vector/Dense/Base.hs b/lib/Data/Vector/Dense/Base.hs
--- a/lib/Data/Vector/Dense/Base.hs
+++ b/lib/Data/Vector/Dense/Base.hs
@@ -20,6 +20,7 @@
 
 import BLAS.Internal( checkBinaryOp, clearArray, inlinePerformIO,
     checkedSubvector, checkedSubvectorWithStride, checkVecVecOp )
+import BLAS.Types( ConjEnum(..) )
 
 import Data.Elem.BLAS ( Complex, Elem, BLAS1, conjugate )
 import qualified Data.Elem.BLAS.Level1 as BLAS
@@ -67,7 +68,12 @@
     -- | Indicate whether or not internally the vector stores the complex
     -- conjugates of its elements.
     isConj :: x n e -> Bool
+    isConj x = conjEnum x == Conj
+    {-# INLINE isConj #-}
 
+    -- | Get the storage type.
+    conjEnum :: x n e -> ConjEnum
+    
     -- | Get a view into the complex conjugate of a vector.
     conj :: x n e -> x n e
 
@@ -495,11 +501,7 @@
 unsafeGetDot :: (ReadVector x e m, ReadVector y e m) => 
     x n e -> y n e -> m e
 unsafeGetDot x y =
-    case (isConj x, isConj y) of
-        (False, False) -> vectorCall2 BLAS.dotc x y
-        (True , False) -> vectorCall2 BLAS.dotu x y
-        (False, True ) -> liftM conjugate $ vectorCall2 BLAS.dotu x y
-        (True , True)  -> liftM conjugate $ vectorCall2 BLAS.dotc x y
+    vectorCall2 (BLAS.dot (conjEnum x) (conjEnum y)) x y
 {-# INLINE unsafeGetDot #-}
 
 instance (Elem e) => BaseVector IOVector e where
@@ -507,8 +509,8 @@
     {-# INLINE dim #-}
     stride = strideIOVector
     {-# INLINE stride #-}
-    isConj = isConjIOVector
-    {-# INLINE isConj #-}
+    conjEnum = conjEnumIOVector
+    {-# INLINE conjEnum #-}
     conj = conjIOVector
     {-# INLINE conj #-}
     unsafeSubvectorViewWithStride = unsafeSubvectorViewWithStrideIOVector
@@ -628,7 +630,7 @@
 
 elemsVector :: (Elem e) => Vector n e -> [e]
 elemsVector x | isConj x  = (map conjugate . elemsVector . conj) x
-              | otherwise = case x of { (Vector (IOVector f p n incX _)) ->
+              | otherwise = case x of { (Vector (IOVector _ n f p incX)) ->
     let end = p `advancePtr` (n*incX)
         go p' | p' == end = inlinePerformIO $ do
                                 io <- touchForeignPtr f
@@ -646,7 +648,7 @@
 
 unsafeAtVector :: (Elem e) => Vector n e -> Int -> e
 unsafeAtVector x i | isConj x  = conjugate $ unsafeAtVector (conj x) i
-                   | otherwise = case x of { (Vector (IOVector f p _ inc _)) ->
+                   | otherwise = case x of { (Vector (IOVector _ _ f p inc)) ->
     inlinePerformIO $ do
         e  <- peekElemOff p (i*inc)
         io <- touchForeignPtr f
@@ -758,8 +760,8 @@
     {-# INLINE dim #-}
     stride (Vector x) = strideIOVector x
     {-# INLINE stride #-}
-    isConj (Vector x) = isConjIOVector x
-    {-# INLINE isConj #-}
+    conjEnum (Vector x) = conjEnumIOVector x
+    {-# INLINE conjEnum #-}
     conj (Vector x) = (Vector (conjIOVector x))
     {-# INLINE conj #-}
     unsafeSubvectorViewWithStride s (Vector x) o n = 
diff --git a/lib/Data/Vector/Dense/Class.hs b/lib/Data/Vector/Dense/Class.hs
--- a/lib/Data/Vector/Dense/Class.hs
+++ b/lib/Data/Vector/Dense/Class.hs
@@ -14,7 +14,7 @@
 
 module Data.Vector.Dense.Class (
     -- * Dense vector type classes
-    BaseVector( dim, conj, stride, isConj, coerceVector ),
+    BaseVector( dim, conj, stride, isConj, conjEnum, coerceVector ),
     ReadVector,
     WriteVector,
     
diff --git a/lib/Data/Vector/Dense/IOBase.hs b/lib/Data/Vector/Dense/IOBase.hs
--- a/lib/Data/Vector/Dense/IOBase.hs
+++ b/lib/Data/Vector/Dense/IOBase.hs
@@ -17,6 +17,7 @@
 import System.IO.Unsafe
 
 import BLAS.Internal ( clearArray )
+import BLAS.Types( ConjEnum(..), flipConj )
 import Data.Elem.BLAS ( Complex, Elem, BLAS1, conjugate )
 import qualified Data.Elem.BLAS.Level1 as BLAS
 
@@ -31,11 +32,11 @@
 --       are supported.
 --
 data IOVector n e = 
-      IOVector {-# UNPACK #-} !(ForeignPtr e) -- memory owner
-               {-# UNPACK #-} !(Ptr e)        -- pointer to the first element
+      IOVector {-# UNPACK #-} !ConjEnum       
                {-# UNPACK #-} !Int            -- the length of the vector
+               {-# UNPACK #-} !(ForeignPtr e) -- memory owner
+               {-# UNPACK #-} !(Ptr e)        -- pointer to the first element
                {-# UNPACK #-} !Int            -- the stride (in elements, not bytes) between elements.
-               {-# UNPACK #-} !Bool           -- indicates whether or not the vector is conjugated
 
 -- | View an array in memory as a vector.
 vectorViewArray :: (Elem e)
@@ -55,35 +56,39 @@
                           -> IOVector n e
 vectorViewArrayWithStride s f o n =
     let p = unsafeForeignPtrToPtr f `advancePtr` o
-    in IOVector f p n s False
+    in IOVector NoConj n f p s
 {-# INLINE vectorViewArrayWithStride #-}
                           
 dimIOVector :: IOVector n e -> Int
-dimIOVector (IOVector _ _ n _ _) = n
+dimIOVector (IOVector _ n _ _ _) = n
 {-# INLINE dimIOVector #-}
 
 strideIOVector :: IOVector n e -> Int
-strideIOVector (IOVector _ _ _ incX _) = incX
+strideIOVector (IOVector _ _ _ _ incX) = incX
 {-# INLINE strideIOVector #-}
 
+conjEnumIOVector :: IOVector n e -> ConjEnum
+conjEnumIOVector (IOVector c _ _ _ _) = c
+{-# INLINE conjEnumIOVector #-}
+
 isConjIOVector :: IOVector n e -> Bool
-isConjIOVector (IOVector _ _ _ _ c) = c
+isConjIOVector x = conjEnumIOVector x == Conj
 {-# INLINE isConjIOVector #-}
 
 conjIOVector :: IOVector n e -> IOVector n e
-conjIOVector (IOVector f p n incX c) = (IOVector f p n incX (not c))
+conjIOVector (IOVector c n f p incX) = (IOVector (flipConj c) n f p incX)
 {-# INLINE conjIOVector #-}
 
 unsafeSubvectorViewWithStrideIOVector :: (Elem e) =>
     Int -> IOVector n e -> Int -> Int -> IOVector n' e
-unsafeSubvectorViewWithStrideIOVector s' (IOVector f p _ inc c) o' n' =
-    IOVector f (p `advancePtr` (inc*o')) n' (inc*s') c
+unsafeSubvectorViewWithStrideIOVector s' (IOVector c _ f p inc) o' n' =
+    IOVector c n' f (p `advancePtr` (inc*o')) (inc*s')
 {-# INLINE unsafeSubvectorViewWithStrideIOVector #-}
 
 -- | Execute an 'IO' action with a pointer to the first element in the
 -- vector.
 withIOVector :: IOVector n e -> (Ptr e -> IO a) -> IO a
-withIOVector (IOVector f p _ _ _) g = do
+withIOVector (IOVector _ _ f p _) g = do
     a <- g p
     touchForeignPtr f
     return a
@@ -95,15 +100,15 @@
         fail $ "Tried to create a vector with `" ++ show n ++ "' elements."
     | otherwise = do
         arr <- mallocForeignPtrArray n
-        return $ IOVector arr (unsafeForeignPtrToPtr arr) n 1 False
+        return $ IOVector NoConj n arr (unsafeForeignPtrToPtr arr) 1
 
 newCopyIOVector :: (BLAS1 e) => IOVector n e -> IO (IOVector n e)
-newCopyIOVector (IOVector f p n incX c) = do
-    (IOVector f' p' _ _ _) <- newIOVector_ n
+newCopyIOVector (IOVector c n f p incX) = do
+    (IOVector _ _ f' p' _) <- newIOVector_ n
     BLAS.copy n p incX p' 1
     touchForeignPtr f
     touchForeignPtr f'
-    return (IOVector f' p' n 1 c)
+    return (IOVector c n f' p' 1)
 
 shapeIOVector :: IOVector n e -> Int
 shapeIOVector = dimIOVector
@@ -138,10 +143,10 @@
 {-# INLINE getIndicesIOVector' #-}
 
 getElemsIOVector :: (Elem e) => IOVector n e -> IO [e]
-getElemsIOVector (IOVector f p n incX True) = do
-    es <- getElemsIOVector (IOVector f p n incX False)
+getElemsIOVector (IOVector Conj n f p incX) = do
+    es <- getElemsIOVector (IOVector NoConj n f p incX)
     return $ map conjugate es
-getElemsIOVector (IOVector f p n incX False) =
+getElemsIOVector (IOVector NoConj n f p incX) =
     let end = p `advancePtr` (n*incX)
         go p' | p' == end = do
                    touchForeignPtr f
@@ -154,11 +159,11 @@
 {-# SPECIALIZE INLINE getElemsIOVector :: IOVector n Double -> IO [Double] #-}
 {-# SPECIALIZE INLINE getElemsIOVector :: IOVector n (Complex Double) -> IO [Complex Double] #-}
 
-getElemsIOVector' :: (Elem e) => IOVector n e -> IO [e]
-getElemsIOVector' (IOVector f p n incX True) = do
-    es <- getElemsIOVector' (IOVector f p n incX False)
+getElemsIOVector' :: (Elem e) => IOVector      n e -> IO [e]
+getElemsIOVector' (IOVector Conj n f p incX) = do
+    es <- getElemsIOVector' (IOVector NoConj n f p incX)
     return $ map conjugate es    
-getElemsIOVector' (IOVector f p n incX False) =
+getElemsIOVector' (IOVector NoConj n f p incX) =
     let end = p `advancePtr` (-incX)
         go p' es | p' == end = do
                       touchForeignPtr f
@@ -179,12 +184,12 @@
 {-# INLINE getAssocsIOVector' #-}
 
 unsafeReadElemIOVector :: (Elem e) => IOVector n e -> Int -> IO e
-unsafeReadElemIOVector (IOVector f p n incX c) i
-    | c = liftM conjugate $ unsafeReadElemIOVector (IOVector f p n incX False) i
-    | otherwise = do
-        e <- peekElemOff p (i*incX)
-        touchForeignPtr f
-        return e
+unsafeReadElemIOVector (IOVector Conj   n f p incX) i = 
+    liftM conjugate $ unsafeReadElemIOVector (IOVector NoConj n f p incX) i
+unsafeReadElemIOVector (IOVector NoConj _ f p incX) i = do
+    e <- peekElemOff p (i*incX)
+    touchForeignPtr f
+    return e
 {-# SPECIALIZE INLINE unsafeReadElemIOVector :: IOVector n Double -> Int -> IO (Double) #-}
 {-# SPECIALIZE INLINE unsafeReadElemIOVector :: IOVector n (Complex Double) -> Int -> IO (Complex Double) #-}
 
@@ -193,8 +198,8 @@
 {-# INLINE canModifyElemIOVector #-}
 
 unsafeWriteElemIOVector :: (Elem e) => IOVector n e -> Int -> e -> IO ()
-unsafeWriteElemIOVector (IOVector f p _ incX c) i e =
-    let e' = if c then conjugate e else e
+unsafeWriteElemIOVector (IOVector c _ f p incX) i e =
+    let e' = if c == Conj then conjugate e else e
     in do
         pokeElemOff p (i*incX) e'
         touchForeignPtr f
@@ -202,8 +207,8 @@
 {-# SPECIALIZE INLINE unsafeWriteElemIOVector :: IOVector n (Complex Double) -> Int -> Complex Double -> IO () #-}
 
 unsafeModifyElemIOVector :: (Elem e) => IOVector n e -> Int -> (e -> e) -> IO ()
-unsafeModifyElemIOVector (IOVector f p _ incX c) i g =
-    let g' = if c then conjugate . g . conjugate else g
+unsafeModifyElemIOVector (IOVector c _ f p incX) i g =
+    let g' = if c == Conj then conjugate . g . conjugate else g
         p' = p `advancePtr` (i*incX)
     in do
         e <- peek p'
@@ -213,7 +218,7 @@
 {-# SPECIALIZE INLINE unsafeModifyElemIOVector :: IOVector n (Complex Double) -> Int -> (Complex Double -> Complex Double) -> IO () #-}
 
 unsafeSwapElemsIOVector :: (Elem e) => IOVector n e -> Int -> Int -> IO ()
-unsafeSwapElemsIOVector (IOVector f p _ incX _) i1 i2 =
+unsafeSwapElemsIOVector (IOVector _ _ f p incX) i1 i2 =
     let p1 = p `advancePtr` (i1*incX)
         p2 = p `advancePtr` (i2*incX)
     in do
@@ -226,8 +231,8 @@
 {-# SPECIALIZE INLINE unsafeSwapElemsIOVector :: IOVector n (Complex Double) -> Int -> Int -> IO () #-}
                             
 modifyWithIOVector :: (Elem e) => (e -> e) -> IOVector n e -> IO ()
-modifyWithIOVector g (IOVector f p n incX c) =
-    let g'  = if c then (conjugate . g . conjugate) else g
+modifyWithIOVector g (IOVector c n f p incX) =
+    let g'  = if c == Conj then (conjugate . g . conjugate) else g
         end = p `advancePtr` (n*incX)
         go p' | p' == end = touchForeignPtr f
               | otherwise = do
@@ -239,15 +244,15 @@
 {-# SPECIALIZE INLINE modifyWithIOVector :: (Complex Double -> Complex Double) -> IOVector n (Complex Double) -> IO () #-}
 
 setZeroIOVector :: (Elem e) => IOVector n e -> IO ()
-setZeroIOVector x@(IOVector f p n incX _)
+setZeroIOVector x@(IOVector _ n f p incX)
     | incX == 1 = clearArray p n >> touchForeignPtr f
     | otherwise = setConstantIOVector 0 x
 {-# INLINE setZeroIOVector #-}
 
 setConstantIOVector :: (Elem e) => e -> IOVector n e -> IO ()
 setConstantIOVector 0 x | strideIOVector x == 1 = setZeroIOVector x
-setConstantIOVector e (IOVector f p n incX c) =
-    let e'   = if c then conjugate e else e
+setConstantIOVector e (IOVector c n f p incX) =
+    let e'   = if c == Conj then conjugate e else e
         end = p `advancePtr` (n*incX)
         go p' | p' == end = touchForeignPtr f
               | otherwise = do
@@ -257,14 +262,14 @@
 {-# INLINE setConstantIOVector #-}
 
 doConjIOVector :: (BLAS1 e) => IOVector n e -> IO ()
-doConjIOVector (IOVector f p n incX _) =
+doConjIOVector (IOVector _ n f p incX) =
     BLAS.vconj n p incX >> touchForeignPtr f
 {-# INLINE doConjIOVector #-}
 
 scaleByIOVector :: (BLAS1 e) => e -> IOVector n e -> IO ()
 scaleByIOVector 1 _ = return ()
-scaleByIOVector k (IOVector f p n incX c) =
-    let k' = if c then conjugate k else k
+scaleByIOVector k (IOVector c n f p incX) =
+    let k' = if c == Conj then conjugate k else k
     in BLAS.scal n k' p incX >> touchForeignPtr f
 {-# INLINE scaleByIOVector #-}
                     
diff --git a/lib/Data/Vector/Dense/STBase.hs b/lib/Data/Vector/Dense/STBase.hs
--- a/lib/Data/Vector/Dense/STBase.hs
+++ b/lib/Data/Vector/Dense/STBase.hs
@@ -93,8 +93,8 @@
     {-# INLINE dim #-}
     stride (STVector x) = strideIOVector x
     {-# INLINE stride #-}
-    isConj (STVector x) = isConjIOVector x
-    {-# INLINE isConj #-}
+    conjEnum (STVector x) = conjEnumIOVector x
+    {-# INLINE conjEnum #-}
     conj (STVector x) = STVector (conjIOVector x)
     {-# INLINE conj #-}
     unsafeSubvectorViewWithStride s (STVector x) o n = 
