on master help sign in
Add back PolyKinds in Instances.hs
commit84a52421c3d40d5cc7c7a67284479962ee589207 authorOleg Grenrus <oleg.grenrus@iki.fi> dateThu 2 Jun 2016, 17:11 (10 years ago) parent8a24e09
2 files changed+12
Data/Aeson/Types/Instances.hs+5 tests/UnitTests.hs+7
Data/Aeson/Types/Instances.hs+5
@@ -4,6 +4,11 @@
44 ViewPatterns #-}
55{-# LANGUAGE DefaultSignatures #-}
66
7+-- Needed for Tagged, Const and Proxy instances
8+#if __GLASGOW_HASKELL__ >= 706
9+{-# LANGUAGE PolyKinds #-}
10+#endif
11+
712{-# OPTIONS_GHC -fno-warn-orphans #-}
813
914-- TODO: Drop this when we remove support for Data.Attoparsec.Number
tests/UnitTests.hs+7
@@ -1,4 +1,7 @@
11{-# LANGUAGE CPP, DeriveGeneric, OverloadedStrings, ScopedTypeVariables, TemplateHaskell #-}
2+#if __GLASGOW_HASKELL__ >= 708
3+{-# LANGUAGE DataKinds #-}
4+#endif
25
36{-# OPTIONS_GHC -fno-warn-deprecations #-}
47
@@ -233,6 +236,10 @@ jsonEncoding = [
233236 , assertEqual "Just Nothing" "null" $ encode (Just Nothing :: Maybe (Maybe Int))
234237 , assertEqual "Proxy Int" "null" $ encode (Proxy :: Proxy Int)
235238 , assertEqual "Tagged Char Int" "1" $ encode (Tagged 1 :: Tagged Char Int)
239+#if __GLASGOW_HASKELL__ >= 708
240+ -- Test Tagged instance is polykinded
241+ , assertEqual "Tagged 123 Int" "1" $ encode (Tagged 1 :: Tagged 123 Int)
242+#endif
236243 , assertEqual "Const Char Int" "\"c\"" $ encode (Const 'c' :: Const Char Int)
237244 , assertEqual "Tuple" "[1,2]" $ encode ((1, 2) :: (Int, Int))
238245 , assertEqual "NonEmpty" "[1,2,3]" $ encode (1 :| [2, 3] :: NonEmpty Int)