Skip to content
Permalink
Browse files

Migrate to haskell-src-exts 1.18.2

  • Loading branch information...
caasi committed Oct 2, 2016
1 parent 997742d commit ed8cf0b2cab2bd6f581a2a453035c60ac6cd37c2
Showing with 31 additions and 15 deletions.
  1. +1 −1 app/Main.hs
  2. +25 −10 src/Desugar.hs
  3. +3 −2 stack.yaml
  4. +2 −2 trans.cabal
@@ -3,7 +3,7 @@ module Main where
import Debug.Trace
import System.Environment
import System.FilePath
import Language.Haskell.Exts.Annotated
import Language.Haskell.Exts
import Codec.Archive.Zip
import Data.Char
import Data.ByteString.Lazy as B hiding (map, length, getContents, putStrLn)
@@ -6,7 +6,7 @@ module Desugar

import Control.Applicative
import Data.Traversable
import Language.Haskell.Exts.Annotated.Syntax
import Language.Haskell.Exts.Syntax



@@ -328,7 +328,7 @@ instance Desugarable Desugar (Type l) where
desugar (TyPromoted l ty) = TyPromoted l <$> desugar ty
desugar (TyEquals l ty0 ty1) = TyEquals l <$> desugar ty0 <*> desugar ty1
desugar (TySplice l splice) = TySplice l <$> desugar splice
desugar (TyBang l bangTy ty) = TyBang l <$> desugar bangTy <*> desugar ty
desugar (TyBang l bangTy unpackedness ty) = TyBang l <$> desugar bangTy <*> desugar unpackedness <*> desugar ty
desugar (TyWildCard l mName) = TyWildCard l <$> mapM desugar mName

instance Desugarable Desugar (GuardedRhs l) where
@@ -340,7 +340,13 @@ instance Desugarable Desugar (Rhs l) where

instance Desugarable Desugar (BangType l) where
desugar (BangedTy l) = pure $ BangedTy l
desugar (UnpackedTy l) = pure $ UnpackedTy l
desugar (LazyTy l) = pure $ LazyTy l
desugar (NoStrictAnnot l) = pure $ NoStrictAnnot l

instance Desugarable Desugar (Unpackedness l) where
desugar (Unpack l) = pure $ Unpack l
desugar (NoUnpack l) = pure $ NoUnpack l
desugar (NoUnpackPragma l) = pure $ NoUnpackPragma l

instance Desugarable Desugar (InstDecl l) where
desugar (InsDecl l decl) = InsDecl l <$> desugar decl
@@ -351,8 +357,8 @@ instance Desugarable Desugar (InstDecl l) where
instance Desugarable Desugar (ClassDecl l) where
desugar (ClsDecl l decl) = ClsDecl l <$> desugar decl
desugar (ClsDataFam l mContext declHead mKind) = ClsDataFam l <$> mapM desugar mContext <*> desugar declHead <*> mapM desugar mKind
desugar (ClsTyFam l declHead mKind) = ClsTyFam l <$> desugar declHead <*> mapM desugar mKind
desugar (ClsTyDef l ty0 ty1) = ClsTyDef l <$> desugar ty0 <*> desugar ty1
desugar (ClsTyFam l declHead mResultSig mInjectivityInfo) = ClsTyFam l <$> desugar declHead <*> mapM desugar mResultSig <*> mapM desugar mInjectivityInfo
desugar (ClsTyDef l tyEqn) = ClsTyDef l <$> desugar tyEqn
desugar (ClsDefSig l name ty) = ClsDefSig l <$> desugar name <*> desugar ty

instance Desugarable Desugar (GadtDecl l) where
@@ -433,8 +439,8 @@ mapP f (a, b) =

instance Desugarable Desugar (Decl l) where
desugar (TypeDecl l declHead ty) = TypeDecl l <$> desugar declHead <*> desugar ty
desugar (TypeFamDecl l declHead mKind) = TypeFamDecl l <$> desugar declHead <*> mapM desugar mKind
desugar (ClosedTypeFamDecl l declHead mKind tyEqnList) = ClosedTypeFamDecl l <$> desugar declHead <*> mapM desugar mKind <*> mapM desugar tyEqnList
desugar (TypeFamDecl l declHead mResultSig mInjectivityInfo) = TypeFamDecl l <$> desugar declHead <*> mapM desugar mResultSig <*> mapM desugar mInjectivityInfo
desugar (ClosedTypeFamDecl l declHead mResultSig mInjectivityInfo tyEqnList) = ClosedTypeFamDecl l <$> desugar declHead <*> mapM desugar mResultSig <*> mapM desugar mInjectivityInfo <*> mapM desugar tyEqnList
desugar (DataDecl l dataOrNew mContext declHead qualConDeclList mDeriving) = DataDecl l <$> desugar dataOrNew <*> mapM desugar mContext <*> desugar declHead <*> mapM desugar qualConDeclList <*> mapM desugar mDeriving
desugar (GDataDecl l dataOrNew mContext declHead mKind gadtDeclList mDeriving) = GDataDecl l <$> desugar dataOrNew <*> mapM desugar mContext <*> desugar declHead <*> mapM desugar mKind <*> mapM desugar gadtDeclList <*> mapM desugar mDeriving
desugar (DataFamDecl l mContext declHead mKind) = DataFamDecl l <$> mapM desugar mContext <*> desugar declHead <*> mapM desugar mKind
@@ -488,14 +494,16 @@ instance Desugarable Desugar (Namespace l) where
instance Desugarable Desugar (ExportSpec l) where
desugar (EVar l qName) = EVar l <$> desugar qName
desugar (EAbs l namespace qName) = EAbs l <$> desugar namespace <*> desugar qName
desugar (EThingAll l qName) = EThingAll l <$> desugar qName
desugar (EThingWith l qName cNameList) = EThingWith l <$> desugar qName <*> mapM desugar cNameList
desugar (EThingWith l eWildcard qName cNameList) = EThingWith l <$> desugar eWildcard <*> desugar qName <*> mapM desugar cNameList
desugar (EModuleContents l moduleName) = EModuleContents l <$> desugar moduleName

instance Desugarable Desugar (ExportSpecList l) where
desugar (ExportSpecList l exportSpecList) = ExportSpecList l <$> mapM desugar exportSpecList

-- missing from the Annotated list
instance Desugarable Desugar (EWildcard l) where
desugar (NoWildcard l) = pure $ NoWildcard l
desugar (EWildcard l int) = EWildcard l <$> pure int

instance Desugarable Desugar (ImportDecl l) where
desugar (ImportDecl l moduleName bool0 bool1 bool2 mStr mModuleName mImportSpecList) = ImportDecl l <$> desugar moduleName <*> pure bool0 <*> pure bool1 <*> pure bool2 <*> mapM pure mStr <*> mapM desugar mModuleName <*> mapM desugar mImportSpecList

@@ -548,4 +556,11 @@ instance Desugarable Desugar (PatternSynDirection l) where
desugar (ImplicitBidirectional) = pure ImplicitBidirectional
desugar (ExplicitBidirectional l declList) = ExplicitBidirectional l <$> mapM desugar declList

instance Desugarable Desugar (InjectivityInfo l) where
desugar (InjectivityInfo l name nameList) = InjectivityInfo l <$> desugar name <*> mapM desugar nameList

instance Desugarable Desugar (ResultSig l) where
desugar (KindSig l kind) = KindSig l <$> desugar kind
desugar (TyVarSig l tyVarBind) = TyVarSig l <$> desugar tyVarBind

-- what is (=~=)?
@@ -2,13 +2,14 @@
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-5.14
resolver: lts-7.1

# Local packages, usually specified by relative directory name
packages:
- '.'
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps: []
extra-deps:
- haskell-src-exts-1.18.2

# Override default flag values for local packages and extra-deps
flags: {}
@@ -19,7 +19,7 @@ library
, Desugar
default-extensions: MultiParamTypeClasses
build-depends: base >= 4.7 && < 5
, haskell-src-exts
, haskell-src-exts >= 1.18 && < 1.19
default-language: Haskell2010

executable trans
@@ -31,7 +31,7 @@ executable trans
, bytestring
, trans
, filepath
, haskell-src-exts
, haskell-src-exts >= 1.18 && < 1.19
, zip-archive
default-language: Haskell2010

0 comments on commit ed8cf0b

Please sign in to comment.
You can’t perform that action at this time.