diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-04-27 11:48:59 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-04-27 11:48:59 +0200 |
commit | 4b3046c72ec4c2a18595ae9631c1930bc8789345 (patch) | |
tree | 5d8843708385be7e243ba977ea6bd5d2c7e776ea /src/LambdaCube/Compiler/Patterns.hs | |
parent | 5f0608c49f79f321de36ae2e4986d7bc4efb0774 (diff) |
split module
Diffstat (limited to 'src/LambdaCube/Compiler/Patterns.hs')
-rw-r--r-- | src/LambdaCube/Compiler/Patterns.hs | 9 |
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 #-} | ||
10 | module LambdaCube.Compiler.Patterns where | 11 | module LambdaCube.Compiler.Patterns where |
11 | 12 | ||
12 | import Data.Monoid | 13 | import Data.Monoid |
@@ -16,7 +17,7 @@ import Control.Monad.Writer | |||
16 | import Control.Arrow hiding ((<+>)) | 17 | import Control.Arrow hiding ((<+>)) |
17 | 18 | ||
18 | import LambdaCube.Compiler.Utils | 19 | import LambdaCube.Compiler.Utils |
19 | 20 | import LambdaCube.Compiler.DeBruijn | |
20 | import LambdaCube.Compiler.Pretty hiding (Doc, braces, parens) | 21 | import LambdaCube.Compiler.Pretty hiding (Doc, braces, parens) |
21 | import LambdaCube.Compiler.DesugaredSource | 22 | import LambdaCube.Compiler.DesugaredSource |
22 | 23 | ||
@@ -112,7 +113,7 @@ instance Rearrange Pat where | |||
112 | instance Rearrange ParPat where | 113 | instance Rearrange ParPat where |
113 | rearrange k f = mapPP (`rearrange` f) k | 114 | rearrange k f = mapPP (`rearrange` f) k |
114 | 115 | ||
115 | instance DeBruijnify ParPat where | 116 | instance 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 | |||
215 | instance Rearrange a => Rearrange (Lets a) where | 216 | instance 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 | ||
218 | instance DeBruijnify a => DeBruijnify (Lets a) where | 219 | instance 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 | ||
221 | data GuardTree | 222 | data GuardTree |
@@ -224,7 +225,7 @@ data GuardTree | |||
224 | | GTFailure | 225 | | GTFailure |
225 | deriving Show | 226 | deriving Show |
226 | 227 | ||
227 | instance DeBruijnify GuardTree where | 228 | instance 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 | ||
230 | type GuardTrees = Lets GuardTree | 231 | type GuardTrees = Lets GuardTree |