1
1
mirror of https://github.com/sol/hpack.git synced 2024-10-04 11:47:15 +03:00

add support for ghc-8

This commit is contained in:
Sönke Hahn 2016-06-10 18:03:10 +08:00
parent 57dac2d7b0
commit 2b1a38a753
4 changed files with 9 additions and 6 deletions

View File

@ -10,6 +10,9 @@ matrix:
- env: BUILD=tinc CABALVER=1.22 GHCVER=7.10.3 - env: BUILD=tinc CABALVER=1.22 GHCVER=7.10.3
compiler: ": #tinc 7.10.3" compiler: ": #tinc 7.10.3"
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}} addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}}
- env: BUILD=tinc CABALVER=1.24 GHCVER=8.0.1
compiler: ": #tinc 8.0.1"
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5], sources: [hvr-ghc]}}
- env: BUILD=stack GHCVER=7.10.3 STACK_YAML=stack.yaml - env: BUILD=stack GHCVER=7.10.3 STACK_YAML=stack.yaml
compiler: ": #stack 7.10.3" compiler: ": #stack 7.10.3"
addons: {apt: {packages: [ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}} addons: {apt: {packages: [ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}}
@ -19,7 +22,7 @@ matrix:
before_install: before_install:
- unset CC - unset CC
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.22/bin:/opt/happy/1.19.5/bin:$PATH - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:/opt/happy/1.19.5/bin:$PATH
- ./.travis-setup.sh - ./.travis-setup.sh
- ghc --version || stack exec -- ghc --version - ghc --version || stack exec -- ghc --version
- happy --version || true - happy --version || true

View File

@ -119,7 +119,7 @@ type FieldName = String
class HasFieldNames a where class HasFieldNames a where
fieldNames :: Proxy a -> [FieldName] fieldNames :: Proxy a -> [FieldName]
default fieldNames :: (HasTypeName a, Generic a, Selectors (Rep a)) => Proxy a -> [String] default fieldNames :: (HasTypeName a, Selectors (Rep a)) => Proxy a -> [String]
fieldNames proxy = map (hyphenize $ typeName proxy) (selectors proxy) fieldNames proxy = map (hyphenize $ typeName proxy) (selectors proxy)
data CaptureUnknownFields a = CaptureUnknownFields { data CaptureUnknownFields a = CaptureUnknownFields {

View File

@ -21,10 +21,10 @@ class HasTypeName a where
instance (Datatype d, Generic a, Rep a ~ M1 D d m) => HasTypeName a where instance (Datatype d, Generic a, Rep a ~ M1 D d m) => HasTypeName a where
typeName _ = datatypeName (undefined :: M1 D d x y) typeName _ = datatypeName (undefined :: M1 D d x y)
selectors :: (Generic a, Selectors (Rep a)) => Proxy a -> [String] selectors :: (Selectors (Rep a)) => Proxy a -> [String]
selectors = f selectors = f
where where
f :: forall a. (Generic a, Selectors (Rep a)) => Proxy a -> [String] f :: forall a. (Selectors (Rep a)) => Proxy a -> [String]
f _ = selNames (Proxy :: Proxy (Rep a)) f _ = selNames (Proxy :: Proxy (Rep a))
class Selectors a where class Selectors a where

View File

@ -10,14 +10,14 @@ module Helper (
import Test.Hspec import Test.Hspec
import Test.Mockery.Directory import Test.Mockery.Directory
import Control.Applicative import Control.Applicative
import System.Directory import System.Directory (getCurrentDirectory, setCurrentDirectory, canonicalizePath)
import Control.Exception import Control.Exception
import qualified System.IO.Temp as Temp import qualified System.IO.Temp as Temp
import System.FilePath import System.FilePath
withCurrentDirectory :: FilePath -> IO a -> IO a withCurrentDirectory :: FilePath -> IO a -> IO a
withCurrentDirectory dir action = do withCurrentDirectory dir action = do
bracket (getCurrentDirectory) (setCurrentDirectory) $ \ _ -> do bracket getCurrentDirectory setCurrentDirectory $ \ _ -> do
setCurrentDirectory dir setCurrentDirectory dir
action action