summaryrefslogtreecommitdiff
path: root/src/LambdaCube/Compiler/Patterns.hs
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-04-27 11:48:59 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-04-27 11:48:59 +0200
commit4b3046c72ec4c2a18595ae9631c1930bc8789345 (patch)
tree5d8843708385be7e243ba977ea6bd5d2c7e776ea /src/LambdaCube/Compiler/Patterns.hs
parent5f0608c49f79f321de36ae2e4986d7bc4efb0774 (diff)
split module
Diffstat (limited to 'src/LambdaCube/Compiler/Patterns.hs')
-rw-r--r--src/LambdaCube/Compiler/Patterns.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/LambdaCube/Compiler/Patterns.hs b/src/LambdaCube/Compiler/Patterns.hs
index cffedffb..0ebb6a97 100644
--- a/src/LambdaCube/Compiler/Patterns.hs
+++ b/src/LambdaCube/Compiler/Patterns.hs
@@ -7,6 +7,7 @@
7{-# LANGUAGE OverloadedStrings #-} 7{-# LANGUAGE OverloadedStrings #-}
8{-# LANGUAGE DeriveFunctor #-} 8{-# LANGUAGE DeriveFunctor #-}
9{-# LANGUAGE ScopedTypeVariables #-} 9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE MultiParamTypeClasses #-}
10module LambdaCube.Compiler.Patterns where 11module LambdaCube.Compiler.Patterns where
11 12
12import Data.Monoid 13import Data.Monoid
@@ -16,7 +17,7 @@ import Control.Monad.Writer
16import Control.Arrow hiding ((<+>)) 17import Control.Arrow hiding ((<+>))
17 18
18import LambdaCube.Compiler.Utils 19import LambdaCube.Compiler.Utils
19 20import LambdaCube.Compiler.DeBruijn
20import LambdaCube.Compiler.Pretty hiding (Doc, braces, parens) 21import LambdaCube.Compiler.Pretty hiding (Doc, braces, parens)
21import LambdaCube.Compiler.DesugaredSource 22import LambdaCube.Compiler.DesugaredSource
22 23
@@ -112,7 +113,7 @@ instance Rearrange Pat where
112instance Rearrange ParPat where 113instance Rearrange ParPat where
113 rearrange k f = mapPP (`rearrange` f) k 114 rearrange k f = mapPP (`rearrange` f) k
114 115
115instance DeBruijnify ParPat where 116instance DeBruijnify SIName ParPat where
116 deBruijnify_ l ns = mapPP (`deBruijnify_` ns) l 117 deBruijnify_ l ns = mapPP (`deBruijnify_` ns) l
117 118
118-- pattern variables 119-- pattern variables
@@ -215,7 +216,7 @@ mapLets f h l = \case
215instance Rearrange a => Rearrange (Lets a) where 216instance Rearrange a => Rearrange (Lets a) where
216 rearrange l f = mapLets (`rearrange` f) (`rearrange` f) l 217 rearrange l f = mapLets (`rearrange` f) (`rearrange` f) l
217 218
218instance DeBruijnify a => DeBruijnify (Lets a) where 219instance DeBruijnify SIName a => DeBruijnify SIName (Lets a) where
219 deBruijnify_ l ns = mapLets (`deBruijnify_` ns) (`deBruijnify_` ns) l 220 deBruijnify_ l ns = mapLets (`deBruijnify_` ns) (`deBruijnify_` ns) l
220 221
221data GuardTree 222data GuardTree
@@ -224,7 +225,7 @@ data GuardTree
224 | GTFailure 225 | GTFailure
225 deriving Show 226 deriving Show
226 227
227instance DeBruijnify GuardTree where 228instance DeBruijnify SIName GuardTree where
228 deBruijnify_ l ns = mapGT (`deBruijnify_` ns) (`deBruijnify_` ns) l 229 deBruijnify_ l ns = mapGT (`deBruijnify_` ns) (`deBruijnify_` ns) l
229 230
230type GuardTrees = Lets GuardTree 231type GuardTrees = Lets GuardTree