diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+0.3.1.2: [2019.04.02]
+---------------------
+* Fix build error on windows caused by providing instances
+  to POSIX types. Thanks to @Bodigrim and @CarlEdman for
+  reporting this.
+
 0.3.1.1: [2019.01.12]
 ---------------------
 * Fix build error caused by disabling building with containers.
diff --git a/Data/Semiring.hs b/Data/Semiring.hs
--- a/Data/Semiring.hs
+++ b/Data/Semiring.hs
@@ -140,10 +140,19 @@
 import           GHC.Real (Integral, Fractional, Real, RealFrac)
 import           GHC.Show (Show)
 import           Numeric.Natural (Natural)
+
+#ifdef mingw32_HOST_OS
+#define HOST_OS_WINDOWS 1
+#else
+#define HOST_OS_WINDOWS 0
+#endif
+
+#if !HOST_OS_WINDOWS
 import           System.Posix.Types
   (CCc, CDev, CGid, CIno, CMode, CNlink,
    COff, CPid, CRLim, CSpeed, CSsize,
    CTcflag, CUid, Fd)
+#endif
 
 infixl 7 *, `times`
 infixl 6 +, `plus`, -, `minus`
@@ -397,26 +406,31 @@
 -- convention when talking about semirings.
 --
 -- For any type R with a 'Prelude.Num'
--- instance, the additive monoid is (R, '(Prelude.+)', 0)
--- and the multiplicative monoid is (R, '(Prelude.*)', 1).
+-- instance, the additive monoid is (R, 'Prelude.+', 0)
+-- and the multiplicative monoid is (R, 'Prelude.*', 1).
 --
 -- For 'Prelude.Bool', the additive monoid is ('Prelude.Bool', 'Prelude.||', 'Prelude.False')
 -- and the multiplicative monoid is ('Prelude.Bool', 'Prelude.&&', 'Prelude.True').
 --
 -- Instances should satisfy the following laws:
 --
--- [/additive identity/]
---     @x '+' 'zero' = 'zero' '+' x = x@
+-- [/additive left identity/]
+--     @'zero' '+' x = x@
+-- [/additive right identity/]
+--     @x '+' 'zero' = x@
 -- [/additive associativity/]
 --     @x '+' (y '+' z) = (x '+' y) '+' z@
 -- [/additive commutativity/]
 --     @x '+' y = y '+' x@
--- [/multiplicative identity/]
---     @x '*' 'one' = 'one' '*' x = x@
+-- [/multiplicative left identity/]
+--     @'one' '*' x = x@    
+-- [/multiplicative right identity/]
+--     @x '*' 'one' = x@ 
 -- [/multiplicative associativity/]
 --     @x '*' (y '*' z) = (x '*' y) '*' z@
--- [/left- and right-distributivity of '*' over '+'/]
+-- [/left-distributivity of '*' over '+'/]
 --     @x '*' (y '+' z) = (x '*' y) '+' (x '*' z)@
+-- [/right-distributivity of '*' over '+'/]   
 --     @(x '+' y) '*' z = (x '*' z) '+' (y '*' z)@
 -- [/annihilation/]
 --     @'zero' '*' x = x '*' 'zero' = 'zero'@
@@ -685,21 +699,26 @@
 deriveSemiring(CChar)
 deriveSemiring(IntPtr)
 deriveSemiring(WordPtr)
-deriveSemiring(Fd)
-deriveSemiring(CRLim)
-deriveSemiring(CTcflag)
-deriveSemiring(CSpeed)
+
+#if !HOST_OS_WINDOWS
 deriveSemiring(CCc)
-deriveSemiring(CUid)
-deriveSemiring(CNlink)
+deriveSemiring(CDev)
 deriveSemiring(CGid)
-deriveSemiring(CSsize)
-deriveSemiring(CPid)
-deriveSemiring(COff)
-deriveSemiring(CMode)
 deriveSemiring(CIno)
-deriveSemiring(CDev)
+deriveSemiring(CMode)
+deriveSemiring(CNlink)
+deriveSemiring(COff)
+deriveSemiring(CPid)
+deriveSemiring(CRLim)
+deriveSemiring(CSpeed)
+deriveSemiring(CSsize)
+deriveSemiring(CTcflag)
+deriveSemiring(CUid)
+deriveSemiring(Fd)
+#endif
+
 deriveSemiring(Natural)
+
 instance Integral a => Semiring (Ratio a) where
   {-# SPECIALIZE instance Semiring Rational #-}
   zero  = 0 % 1
@@ -770,21 +789,25 @@
 deriveRing(CChar)
 deriveRing(IntPtr)
 deriveRing(WordPtr)
-deriveRing(Fd)
-deriveRing(CRLim)
-deriveRing(CTcflag)
-deriveRing(CSpeed)
+deriveRing(Natural)
+
+#if !HOST_OS_WINDOWS
 deriveRing(CCc)
-deriveRing(CUid)
-deriveRing(CNlink)
+deriveRing(CDev)
 deriveRing(CGid)
-deriveRing(CSsize)
-deriveRing(CPid)
-deriveRing(COff)
-deriveRing(CMode)
 deriveRing(CIno)
-deriveRing(CDev)
-deriveRing(Natural)
+deriveRing(CMode)
+deriveRing(CNlink)
+deriveRing(COff)
+deriveRing(CPid)
+deriveRing(CRLim)
+deriveRing(CSpeed)
+deriveRing(CSsize)
+deriveRing(CTcflag)
+deriveRing(CUid)
+deriveRing(Fd)
+#endif
+
 instance Integral a => Ring (Ratio a) where
   negate = Num.negate
   {-# INLINE negate #-}
diff --git a/semirings.cabal b/semirings.cabal
--- a/semirings.cabal
+++ b/semirings.cabal
@@ -1,6 +1,6 @@
 name:          semirings
 category:      Algebra, Data, Data Structures, Math, Maths, Mathematics
-version:       0.3.1.1
+version:       0.3.1.2
 license:       BSD3
 cabal-version: >= 1.10
 license-file:  LICENSE
