diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2015 inaimathi
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Setup.hs b/Setup.hs
new file mode 100644
--- /dev/null
+++ b/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/postgresql-cube.cabal b/postgresql-cube.cabal
new file mode 100644
--- /dev/null
+++ b/postgresql-cube.cabal
@@ -0,0 +1,28 @@
+-- Initial postgresql-cube.cabal generated by cabal init.  For further 
+-- documentation, see http://haskell.org/cabal/users-guide/
+
+name:                postgresql-cube
+version:             0.1.0.0
+synopsis:            Cube support for postgresql-simple
+description:         Adding a type definition and toField support for the postgresql-simple library
+license:             MIT
+license-file:        LICENSE
+author:              inaimathi
+maintainer:          leo.zovic@gmail.com
+-- copyright:           
+category:            Database
+build-type:          Simple
+-- extra-source-files:  
+cabal-version:       >=1.10
+
+library
+  exposed-modules:     Database.PostgreSQL.Cube
+  -- other-modules:       
+  -- other-extensions:    
+  build-depends:       base >=4.7 && <5, bytestring >=0.10 && <0.11, postgresql-simple >=0.4
+  hs-source-dirs:      src
+  default-language:    Haskell2010
+
+source-repository head
+  type:     git
+  location: https://github.com/Inaimathi/postgresql-cube
diff --git a/src/Database/PostgreSQL/Cube.hs b/src/Database/PostgreSQL/Cube.hs
new file mode 100644
--- /dev/null
+++ b/src/Database/PostgreSQL/Cube.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Database.PostgreSQL.Cube (Cube(..))where
+
+import Database.PostgreSQL.Simple.ToField
+
+import Data.List (intersperse, intercalate)
+import Data.ByteString.Builder (byteString, char8)
+
+data Cube = Cube [[Float]]
+
+instance ToField Cube where
+    toField (Cube cs) = Many $
+                        Plain (byteString "CUBE('") :
+                        (intercalate [comma] $ map point cs) ++
+                        [Plain (byteString "')")]
+                            where comma = Plain (char8 ',')
+                                  point lst = Plain (char8 '(') :
+                                              (intersperse comma $ map toField lst) ++
+                                              [Plain (char8 ')')]
