haskell-src-meta 0.6.0.5 → 0.6.0.6
raw patch · 3 files changed
+19/−6 lines, 3 filesdep ~basedep ~haskell-src-exts
Dependency ranges changed: base, haskell-src-exts
Files
- ChangeLog +3/−0
- haskell-src-meta.cabal +2/−2
- src/Language/Haskell/Meta/Syntax/Translate.hs +14/−4
ChangeLog view
@@ -1,3 +1,6 @@+0.6.0.5 -> 0.6.0.6:+- Move to HSE 1.15, adding support for multiway if+ 0.6.0.4 -> 0.6.0.5: - Update th-orphans dependency
haskell-src-meta.cabal view
@@ -1,5 +1,5 @@ name: haskell-src-meta-version: 0.6.0.5+version: 0.6.0.6 cabal-version: >= 1.6 build-type: Simple license: BSD3@@ -19,7 +19,7 @@ library build-depends: base >= 4.2 && < 4.8,- haskell-src-exts == 1.14.*,+ haskell-src-exts == 1.15.*, pretty >= 1.0 && < 1.2, syb >= 0.1 && < 0.5, th-orphans >= 0.5 && < 0.9
src/Language/Haskell/Meta/Syntax/Translate.hs view
@@ -232,6 +232,7 @@ instance ToExp Hs.Exp where toExp (Hs.Var n) = VarE (toName n)+ toExp (Hs.IPVar n) = noTH "toExp" e toExp (Hs.Con n) = ConE (toName n) toExp (Hs.Lit l) = LitE (toLit l) #if MIN_VERSION_template_haskell(2,7,0)@@ -239,13 +240,19 @@ #else toExp (Hs.InfixApp e o f) = InfixE (Just . toExp $ e) (toExp o) (Just . toExp $ f) #endif- toExp (Hs.LeftSection e o) = InfixE (Just . toExp $ e) (toExp o) Nothing- toExp (Hs.RightSection o f) = InfixE Nothing (toExp o) (Just . toExp $ f) toExp (Hs.App e f) = AppE (toExp e) (toExp f) toExp (Hs.NegApp e) = AppE (VarE 'negate) (toExp e) toExp (Hs.Lambda _ ps e) = LamE (fmap toPat ps) (toExp e) toExp (Hs.Let bs e) = LetE (hsBindsToDecs bs) (toExp e) toExp (Hs.If a b c) = CondE (toExp a) (toExp b) (toExp c)+#if MIN_VERSION_template_haskell(2,8,0)+ toExp (Hs.MultiIf ifs) = MultiIfE (map convert ifs)+ where+ convert (Hs.IfAlt cond e) = (NormalG (toExp cond), toExp e)+#else+ toExp e@Hs.MultiIf{} = noTHyet "toExp" "2.8.0" e+#endif+ toExp (Hs.Case e alts) = CaseE (toExp e) (map toMatch alts) toExp (Hs.Do ss) = DoE (map toStmt ss) toExp e@(Hs.MDo _) = noTH "toExp" e toExp (Hs.Tuple Hs.Boxed xs) = TupE (fmap toExp xs)@@ -254,24 +261,26 @@ #else toExp e@(Hs.Tuple Hs.Unboxed _) = noTHyet "toExp" "2.6.0" e #endif+ toExp e@Hs.TupleSection{} = noTH "toExp" e toExp (Hs.List xs) = ListE (fmap toExp xs) #if MIN_VERSION_template_haskell(2,7,0) toExp (Hs.Paren e) = ParensE (toExp e) #else toExp (Hs.Paren e) = toExp e #endif+ toExp (Hs.LeftSection e o) = InfixE (Just . toExp $ e) (toExp o) Nothing+ toExp (Hs.RightSection o f) = InfixE Nothing (toExp o) (Just . toExp $ f) toExp (Hs.RecConstr n xs) = RecConE (toName n) (fmap toFieldExp xs) toExp (Hs.RecUpdate e xs) = RecUpdE (toExp e) (fmap toFieldExp xs) toExp (Hs.EnumFrom e) = ArithSeqE $ FromR (toExp e) toExp (Hs.EnumFromTo e f) = ArithSeqE $ FromToR (toExp e) (toExp f) toExp (Hs.EnumFromThen e f) = ArithSeqE $ FromThenR (toExp e) (toExp f) toExp (Hs.EnumFromThenTo e f g) = ArithSeqE $ FromThenToR (toExp e) (toExp f) (toExp g)- toExp (Hs.ExpTypeSig _ e t) = SigE (toExp e) (toType t) toExp (Hs.ListComp e ss) = CompE $ map convert ss ++ [NoBindS (toExp e)] where convert (Hs.QualStmt st) = toStmt st convert s = noTH "toExp ListComp" s- toExp (Hs.Case e alts) = CaseE (toExp e) (map toMatch alts)+ toExp (Hs.ExpTypeSig _ e t) = SigE (toExp e) (toType t) toExp e = todo "toExp" e @@ -386,6 +395,7 @@ toStmt (Hs.Generator _ p e) = BindS (toPat p) (toExp e) toStmt (Hs.Qualifier e) = NoBindS (toExp e) toStmt a@(Hs.LetStmt bnds) = LetS (hsBindsToDecs bnds)+ toStmt s@Hs.RecStmt{} = noTH "toStmt" s -----------------------------------------------------------------------------